PDA

View Full Version : animating hotspot PNGs; use of conditionals


cheathamlane
08-26-2007, 02:58 AM
Hey there:

OK, I'm really starting to have fun, animating hotspots and such on rollover/out, etc.

In the Tutorials files, looking at the parameters descriptions:

onOut="s1.rotation=0, 1000, elastic; s1.alignX=-0.5,3000, elastic;

...I understand pretty much what is happening. I attempted to have a hotspot slide out from left-to-right, and jsut by guessing I was able to get it sliding the right amount:


onOver="alignX=.68,2000, elastic;"
onOut="alignX=0,2000, elastic;"


So, exactly what is the first number (fe, .68) mean -- that is, is this a percentage of the width of the hotspot?

The second number I take to be the length of time for the sliding to happen.

The elastic bit is cute, but is there a way to make it more/less bouncy?

If I missed it somewhere, please let me know -- I think I've read thru the documentation pretty well, and can't find much discussion of these scriptlets.

Also... is it possible to use conditionals in the scriptlets? I may want something to fire only if something else is visible, or bounced out, or whatever.

And... What's the easiest way to turn a hotspot into a toggle switch? That is, click #1 sends it somewhere, and click #2 sends it back (similar to saying "visible+=1")... Without having to tell click #2 exactly where to go?

Thanks!

Patrick

(this should be visible at: http://www.cheathamlane.net/ )

cheathamlane
08-26-2007, 04:07 PM
Update re: toggle switches... Viewing source for the FPP example with photos/video/wallClock shows a neat way to do it... :-)

Should I assume that if I can put arbitrary functions in there, that I can use arbitrary conditionals, variables, and so on?

cheathamlane
08-27-2007, 08:23 PM
Anyone?

:)

--
So, from playing with the hotspot example which attaches a timer/movement function to the pano object... I'm having difficulty stopping the function/timer, using another hotspot.

In <global> I have:

<global onStart="pano.goTimer();" ... onPress="timer=0" >

In <pano> I have:
onpress="goTimer()"
onRelease="goTimer()"
onKeyPress="goTimer()"
goTimer="timer+=1,10000,,go1; qualityStatic=high"

...along with several functions, "go1", "go2", etc.

In another hotspot:

<spot
id="blah" static="1" sAlign="rb" staticX="blah" staticY="blah" url="blah" blockMouse="1"
onClick="pano.goTimer();"
onPress="pano.goTimer();"
onRelease="pano.goTimer();"/>


Pressing on the pano itself stops the current running function (go1, go2, whichever). Pressing or clicking on the hotspot "blah" does nothing...

Here's what the flash tracer gives me (my comments are preceded by ##):

##the timer waited, then executed the initial function "go1":
Execute pano: pan=0,1900
Execute pano: tilt=0,1900
Execute pano: zoom=1.01,1900,,pause1
Execute pano: qualityStatic=low
##i moused over the hotspot button:
Execute BLAH: scale=1.0,600,elastic
Execute BLAH: depth+=20
##"pause1" executed "go2":
Execute pano: timer+=1,1000,,go2
Execute pano: qualityStatic=high
Execute pano: pan=-17,1900
Execute pano: tilt=21,1900
Execute pano: zoom=0.74,1900,,pause2
##i clicked the hotspot button:
Execute BLAH: pano.goTimer()
Execute pano: timer+=1,10000,,go1
Execute pano: qualityStatic=high
Execute BLAH: pano.goTimer()
Execute pano: timer+=1,10000,,go1
Execute pano: qualityStatic=high
Execute BLAH: pano.goTimer()
Execute pano: timer+=1,10000,,go1
Execute pano: qualityStatic=high
Execute BLAH: pano.goTimer()
Execute pano: timer+=1,10000,,go1
Execute pano: qualityStatic=high
Execute BLAH: pano.goTimer()
Execute pano: timer+=1,10000,,go1
Execute pano: qualityStatic=high
Execute BLAH: pano.goTimer()
Execute pano: timer+=1,10000,,go1
Execute pano: qualityStatic=high
Execute BLAH: scale=1,300
Execute BLAH: depth-=20
Execute BLAH: scale=1,300
Execute BLAH: depth-=20
##pano just continued on its merry way:
Execute pano: timer+=1,1000,,go3
Execute pano: qualityStatic=high
Execute pano: pan=0,1900
Execute pano: tilt=50,1900
Execute pano: zoom=0.74,1900,,pause3
...



I've tried it with just one "onClick" or "onPress" attribute on the hotspot.

Thanks in advance for any insight!