Using [ Control "SomeImageName" ] VS [image "SomeImageName"]

Sannyasin Brahmanathaswami brahma at hindu.org
Mon Feb 1 23:51:00 EST 2016


I using some scripts lately where it seems convenient to do something like this:



global gCurrentHiddenControl, gCurrentShowingControl


# then:


command fadeOutCurrentControl pSpeed

   put (the blendlevel of control gCurrentShowingControl) +1 into tLevel

   set the blendlevel of control gCurrentShowingControl to tLevel

   if tLevel < 100 then

      send fadeOutCurrentControl to this stack in pSpeed ticks

   else

     lastRevealDone

   end if

end fadeOutCurrentControl


# OR (testing which is better… send in time or repeat loops


command revealWithBlendLevel, pSpeed,pIterations

   repeat pIterations times

      set the blendlevel of  control gCurrentHiddenControl to pIterations

      subtract 1 from pIterations

      wait pSpeed milliseconds

   end repeat

end revealWithBlendLevel


How much of hit on the processing time are we inducing by not specify the control type? Is it a trivial amount of extra time?  or is it seriously impacting performance… One never knows.

OTOH… Seeing Animation Engine’s method  which uses the long ID *AND* a specific control declaration.


 aeChangeRect the long ID of  img "stage-1_layer-1", tNewLocation,tMove1Speed,”out”


makes me wonder if using


control “someShortname” is maybe shooting  app performance in the foot


??


BR






More information about the Use-livecode mailing list