check this one
 
 http://forums.livecode.com/viewtopic.ph ... es#p111641
Will of course also work on mobile!
Best
Klaus
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
 
 

Code: Select all
   put the effective filename of this stack into tPath
   set itemdel to "/"
   put tPath & "/Images/TestImage@medium.png" into imageName
   set the icon of the btn btnNameDoNot of card "cardL" to the id of image imageName of card “cardL"
This can happen if you have coded exact coordinates into the script because they will not match on different devices. Never use numerical coordinates, instead use the rectangle of an existing object, like the field itself. Also, when you leave the card, delete the control. On preOpenCard, create it again.But when i scroll down and then up it is going out of the limit.
And this is strange, because is happening only in the iPad simulator. Never in the iPhone simulator.
Do you know how to step through the code in the debugger? Because if you do that you will see immediately what the problem is. Your file path is not correct.fko2 wrote: So i created one folder "Images" i put in this folder two different resolution images.
Then in the setting of the standalone, i add this folder to the copy files.
and then i put this code in my preopenCard of the "cardL" where are the buttons that i want to change them the icon.
But it is evident that i am making something wrong as i have no icon (no medium and no high) in my buttons.Code: Select all
put the effective filename of this stack into tPath set itemdel to "/" put tPath & "/Images/TestImage@medium.png" into imageName set the icon of the btn btnNameDoNot of card "cardL" to the id of image imageName of card “cardL"
 the image is always the 'medium' one.
 the image is always the 'medium' one.Code: Select all
      mobileControlCreate "scroller", "groupScroller2Iphone"
      put the result into sScrollerListIDIphone
      put the topLeft of group "objectsListIphone" into tRect2
      put the right of group "objectsListIphone" into item 3 of tRect2
      put the height of this card into item 4 of tRect2
      
      put the formattedWidth of group "objectsListIphone" into tWidth
      put the formattedHeight of group "objectsListIphone" into tHeight
      mobileControlSet sScrollerListIDIphone,"rect", tRect2
      mobileControlSet sScrollerListIDIphone, "contentRect", (0,0,tWidth,tHeight)
      mobileControlSet sScrollerListIDIphone, "visible", "true"
      
      iphoneControlSet sScrollerListIDIphone, "canBounce", "true"
      iphoneControlSet sScrollerListIDIphone, "scrollingEnabled", "true"
      iphoneControlSet sScrollerListIDIphone, "canScrollToTop", "true"
      iphoneControlSet sScrollerListIDIphone, "lockDirection", "true"
      iphoneControlSet sScrollerListIDIphone, "decelerationRate", "normal"
      iphoneControlSet sScrollerListIDIphone, "pagingEnabled", "false"
      iphoneControlSet sScrollerListIDIphone, "indicatorStyle", "black"
      iphoneControlSet sScrollerListIDIphone, "vIndicator", "true"
      iphoneControlSet sScrollerListIDIphone, "delayTouches", "true"
      iphoneControlSet sScrollerListIDIphone, "canCancelTouches", "true"
      iphoneControlSet sScrollerListIDIphone, "hscroll", 0
      iphoneControlSet sScrollerListIDIphone, "vscroll", 0
Code: Select all
put 0,0,(the formattedWidth of group "scrollArea"),(the formattedHeight of group "scrollArea") into tContentRect 
Code: Select all
      put the topLeft of group "objectsListIphone" into tRect2
      put the right of group "objectsListIphone" into item 3 of tRect2
      put the height of this card into item 4 of tRect2
      
      put the formattedWidth of group "objectsListIphone" into tWidth
      put the formattedHeight of group "objectsListIphone" into tHeight
      mobileControlSet sScrollerListIDIphone,"rect", tRect2
      mobileControlSet sScrollerListIDIphone, "contentRect", (0,0,tWidth,tHeight) 




Code: Select all
on buildIndexList
   lock screen
   set the vScroll of group "master" to 0Code: Select all
   iphoneControlSet scrollID, "vscroll", 0
   iphoneControlSet scrollID, "hscroll", 0
end buildScrollerCode: Select all
put the rect of group "master" into theRect
   put 0 into item 1 of theContentRect
   put 0 into item 2 of theContentRect
   put the width of group "master" of me into item 3 of theContentRect
   
   if the height of group "master" of me >= the formattedheight of group "master" of me then
      put the height of group "master" + 1 into item 4 of theContentRect
   else
      put the formattedheight of group "master" +8  into item 4 of theContentRect
   end if
   
   set the unboundedVScroll of group "master" of me to true
 
Code: Select all
on buildIndexList
   lock screen
   set the vScroll of group "master" to 0
   
   put 1 into count
   repeat 6 timesCode: Select all
   set the vScroll of group "objectsListIphone" to 0
   if the environment is "mobile" then
      if scrollID is not empty then iphoneControlDelete sScrollerListIDIphone
      
      put the rect of group "objectsListIphone" into theRect
      put 0 into item 1 of theContentRect
      put 0 into item 2 of theContentRect
      put the width of group "objectsListIphone" of me into item 3 of theContentRect
      
      if the height of group "objectsListIphone" of me >= the formattedheight of group "objectsListIphone" of me then
         put the height of group "objectsListIphone" + 1 into item 4 of theContentRect
      else
         put the formattedheight of group "objectsListIphone" +200  into item 4 of theContentRect
      end if
      
      set the unboundedVScroll of group "objectsListIphone" of me to true
      
      iphoneControlCreate "scroller"
      put the result into sScrollerListIDIphone
      iphoneControlSet sScrollerListIDIphone, "rect", theRect
      iphoneControlSet sScrollerListIDIphone, "contentRect", theContentRect
      iphoneControlSet sScrollerListIDIphone, "visible", "true"
      iphoneControlSet sScrollerListIDIphone, "canBounce", "true"
      iphoneControlSet sScrollerListIDIphone, "scrollingEnabled", "true"
      iphoneControlSet sScrollerListIDIphone, "canScrollToTop", "true"
      iphoneControlSet sScrollerListIDIphone, "lockDirection", "false"
      iphoneControlSet sScrollerListIDIphone, "decelerationRate", "normal"
      iphoneControlSet sScrollerListIDIphone, "pagingEnabled", "false"
      iphoneControlSet sScrollerListIDIphone, "delayTouches", "true"
      iphoneControlSet sScrollerListIDIphone, "canCancelTouches", "true"
      
      iphoneControlSet sScrollerListIDIphone, "vscroll", 0
      iphoneControlSet sScrollerListIDIphone, "hscroll", 0
   end if
