Does anyone know if it's possible to create movement (or any change of state) without tweening across the timeline?
This seems to be my biggest barrier to creating v. small swf sizes.
For instance, if I wanted to move a symbol across my background on a button click, say, could I script the clip to change the x and y positions over a number of frames rather than 'either/or'? At the moment, I'm having to use tweening and the timeline which is fine but I'm sure that if I could script it instead - my file sizes would be much smaller.
You can change the speed this works at and how far the thing moves etc. by adjusting the 'step' number and the 'i' variable. As well as what you do with it by changing 'xpos' to 'xscale', for instance.
I don't know, but would like to, if you can also adjust the acceleration using this method.
I would imagine that this system is able to cut down drastically the file sizes, depending on what your doing with it.
regards,
neil
[This message has been edited by onedot (edited 27 March 2000).]
does using actionscript in this situation make a smaller file to download, and also, what speed does it go across, is there a way to set how fast the actionscript run?
Sorry, just new to the actionscript thing.
Thanks in advance.
to change the acceleration you can set the step variable to a variable rather than an integer, so the user can then determine the speed by determining this variable.
If you want to achieve the IN/OUT function of tweening you can replace the routine with this:
Set Variable: "finalx" = 400 <-- this is where you want to end up!
Set Variable: "posx" = GetProperty ( "MC", _x )
if (posx < finalx)
Set Variable: "xdif" = posx - finalx
Set Variable: "xStp" = xdif /40
Set Property ("MC", x Position) = posx + xStp
Rosie, this is all fantastic stuff!! How did you learn it all? Are you a programmer first, designer second or vica versa? Or did you just learn it all trial and error?
On that last bit of code, am I right in thinking that everything enclosed in "" is simply a name that you tell Flash to call a variable by?
I'm a designer first, but had to teach myself programming as and when i've needed it.
the principal i find best is find a sample flash that is similar to what you need, then take it apart piece by piece, printing out all the actionscripting. Then wade through the script translating what it does into plain english, learning how to do it in the process