flash AS question
- Started
- Last post
- 40 Responses
- orpkoobcam20
^ try this:
sorry, i'd not tested it.
Set you flash file in the publishing settings to AS2.
make sure your timeline in flash only has 1 frame in length.
on the a new empty layer, put the code in.
name your movie clip in the instance name bit "myclip_mc"
(put the anchor point of the movieclip in the middle by going into your movie clip and moving the image to the centre of the little + on the stage)test. it'll work or i'll eat my hat.
- Pixter0
Also, if you're using as3, this should work without any tween, just put this in the first frame
- CygnusZero40
^ Giddy up brother, that works, except that its scaling up rather than down. Almost there! How do I change this?
- referring to orpkoobCygnusZero4
- also dont want any easingCygnusZero4
- http://pastebin.com/…orpkoobcam2
- QBN to the rescuepinkfloyd
- orpkoobcam20
AS3 from a designers point of view looks scary - "addeventlistener", "removeEventListener(Event.ENTER... etc...
The beauty of AS1 is that in simple to intermediate cases it can be read as english and be understood in the context of what you see animated on the screen. So for a designer it was super easy to pick up. And it was really forgiving if you wrote bad syntax.
If I hadn't used Flash since before Flash 8, and had just opened up Flash CS5 to create a rollover button in AS3 for the first time - I would cry.
- CygnusZero40
Yeah Im with you, Im more of a designer and animator, but falling behind with scripting. Just not much time right now to catch up.
Im almost there with that code you posted, it working finally, just need to have it scale down rather than up, and get rid of the easing. Not sure how to change it. Im trying to but of course im just breaking it. lol
- orpkoobcam20
^ here's it with no easing and bigger > smaller
have a read of this and you'll soon grasp the 1 function used in this code:
- definitely will, works perfectly now, really appreciate this!CygnusZero4
- orpkoobcam20
AS1 to the rescue!!!
:-)
- orpkoobcam20
opps. try this link:
http://help.adobe.com/en_US/AS2L…It's the inbuilt tween class in Flash AS1 / 2.
- CygnusZero40
One last question, what controls WHEN the fadeout starts? I changed the code so that rather than scalling from 150% to 0%, to 125% to 0%, but now the fadeout doesnt start until the scaling stops.
- guess what i need to know is what each value is so I can know how to modify itCygnusZero4
- CygnusZero40
^ sorry, now scales from 125% to 25%, need fade out to start earlier
- CygnusZero40
One more question about this, sorry guys. Im using this code that orpkoobcam2 gave me, and it works great. Like I said Im going to have like 65 movie clips, and I have this code in each one of them, which means if I build all this and they want to change the speed of the scale for example, I would have to go into each one and change it in the code.
Is there a way that this code doesnt sit within each of these clips, but rather say 1 timeline up, and there is something in the clips that references this code? Just would like some way to set this up so that if they want to make a change, I only need to change it in one place and all of the clips see that one piece of code.
- Hombre_Lobo0
how disappointing,
i read this as 'Flash ass question'. I thought i might be able to show my expertise for once :(
- CygnusZero40
Fucker, you got me all excited when I saw the 32 next to my topic. >.<
- orpkoobcam20
http://www.kirupa.com/developer/…
is each movieclip going to be a separate .fla or all in the same .fla?
- CygnusZero40
^ just 1 fla with 65 MCs in it
- CygnusZero40
A friend of mine told me to try this--
// One level up
function doMyAnimationYo(targetMC)
{
new mx.transitions.Tween(targetMC, "_alpha", mx.transitions.easing.None.easeN... 0, 100, 30, false);
var scaleup = new mx.transitions.Tween(targetMC, "_yscale", mx.transitions.easing.None.easeN... 125, 25, 150, false);
var scaleup = new mx.transitions.Tween(targetMC, "_xscale", mx.transitions.easing.None.easeN... 125, 25, 150, false);
scaleup.onMotionChanged = function()
{
if(scaleup.time == 120){
new mx.transitions.Tween(targetMC, "_alpha", mx.transitions.easing.None.easeN... 100, 0, 30, false);
}
}And then inside each clip put this._parent.doMyAnimationYo(thi...
Getting these errors, some problem with the open the open/close brackets. Any ideas?
Symbol=main, layer=actions, frame=1, Line 3 Statement block must be terminated by '}'
Symbol=main, layer=actions, frame=1, Line 12 Syntax error.
- orpkoobcam20
blimey.
is it one after another? or randomly? or interactively?
you can do this if it sequentially - clip 1 to clip 65:
http://pastebin.com/xEvM5Q6ajust name all your clips sequentially from myclip1_mc to myclip65_mc.
- of course you will need to hide all the other clips on the stage whilst the other animates...orpkoobcam2
- orpkoobcam20
put all 65 clips on the stage. - can be on different layers.
then use this:it hides them all and only reveals the one to be animated when needed. plays all clips one after another from clip 1 to 65.
- CygnusZero40
^ Almost working, except Im seeing all the clips turned on, they arent hidden.
- Used your latest code too. Not sure if it matters that I only have 6 clips right now, not 65 yet.CygnusZero4
- shouldn't matter too much if there's only 6.orpkoobcam2
- CygnusZero40
^ I just tried turning their alpha to 0 by default and its working fine now.
- yeah that's a quick fix. if it works go for it.orpkoobcam2