-
please
i am in trouble
there is that great script created by steven, enabling us to play a motion tweened animation reversed
my doubt is:
i have one button, rotating on a circular motion path, i want that motion to stop when the mouse is over the button, and when rolled out, play reverse, and when rollon again, play forwards and again again again
please somebody help
not involved in AS alot, but if anyone could make a comment or give a way or just prepare a smart clip, i would feel great!
(puttting a onrollover _root.stop() action wont work in steven's example)
thanx already
(and excuse my english)
:I
-
You can toggle a clip back and forth by using the Logical NOT operator (!). For example:
Code on button:
on(press){
clip.rot = !clip.rot;//clip named "clip"
}
Code on clip:
onClipEvent(enterFrame){
if(rot==true){
_rotation+=5;
}else{
_rotation-=5;
}
}
Of course your code will be more complex but this is the general idea and form. Use the operator, be aware of paths and dot notation, and choose your event handlers.
-
more?
well as i said
not involved in scripting a lot
i guess you have seen steven DeMar's script
could your comment be applied to that script?or should i write a new one
because it got so complicated that the changes i made on that script with names and paths that it became something else
thanx for your help anyways, i will be waiting for other comments or direct scripts again
thanks really
i will restart doing it now
)))
-
I haven't seen the script you mentioned. I just wrote this off the top of my head for this post.
As you mentioned, paths and the proper methods are the keys to good control of clips and you will eventually unlock the answer if you break apart the problem. Sometimes you need dynamic variables, objects, functions, and a host of things previously thought unnecessary to solve a problem. At other times a simple function can control a bounty of clips with complex behavior.
The code I posted is for a fairly simple problem. What I would recommend is that you write down in natural language what you see and try to generate a series of statements that approximate the screen actions. Then, to the best of your ability, write the code piece by piece until it begins to take shape and refine it from there. Good luck.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|