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.
[This message has been edited by onedot (edited 27 March 2000).]
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
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