How can I stop a simple click stopping a clip tweening?
Hi,
I have got a clip that tweens across the stage into a new position.
Problem I have got & this is something that I have never noticed with Flash, is that if I put an onPress() event on it & then click the clip as it moves across the stage the whole thing comes to a grinding halt!
Is there anyway to stop this happening or getting the movie going again?
fla attached.
Last edited by pup100; 03-26-2009 at 05:30 AM.
You will know everything when you know you never will.
What is suppose to happen when you click on the ball? I did notice it just stops when clicked and fades to 40%. When they click on it, is it suppose to do anything.....just curious why you have an onPress on the ball in the first place.
Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.
I have got a tween half way into which some playing cards can be clicked to turn them over. Doing this totally screws up the tween!
The ball movie is just a demo created to simplify the point I was making that in Flash if you just wanted to do something as simple as changing the alpha on a clip, clicking it brings the movie to a halt!
Last edited by pup100; 02-27-2009 at 09:27 AM.
You will know everything when you know you never will.
aahhh.... I understand. Instead of timeline tweening, can you tween with script and have a listener check for user interaction before to move each frame....of course, now thinking that may slow it down a bit.
Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.
I'm not sure if this is what you wanted exactly, but it should help you nonetheless.
I took the animation from the main timeline and placed it within ball_mc, then controlled ball_mc's timeline to stop when clicked, and continue playing when clicked again, while changing the alpha of the instance of ball_mc placed on the main timeline.
I think the reason it didn't work while the animation was on the main timeline was that the change in alpha was interrupting the tween.
I used an if/else statement that checks ball_mc's alpha to determine what should happen when it is clicked, so check that out.
Hope this helps.
I will take a look at your card animation as well, and see what the problem might be there.
And thank you Zettl. I had come to a similar conclusion myself & have now got the full card movie to work by putting the turning card into another clip & tweening the new clip across the stage.
I still can't get my head round why Flash should stop a clip tweening just because someone presses a button. It is not like the comand was _alpha=40; & then stop the tweening clip.
As I say, i think i have found a fix. It seems to work, but it leaves a bad taste in my mouth that I coudn't achieve the same without having to create another holding clip.
Thanks again for your help my friend.
You will know everything when you know you never will.
And thank you Zettl. I had come to a similar conclusion myself & have now got the full card movie to work by putting the turning card into another clip & tweening the new clip across the stage.
I still can't get my head round why Flash should stop a clip tweening just because someone presses a button. It is not like the comand was _alpha=40; & then stop the tweening clip.
As I say, i think i have found a fix. It seems to work, but it leaves a bad taste in my mouth that I coudn't achieve the same without having to create another holding clip.
Thanks again for your help my friend.
I believe the reason the tween stopped when you changed the alpha was because it contradicted the tween. The tween tells the movie "move x from x to x in x # of frames", or "change this property of x in x # of frames", and if you interrupt this by changing the properties through code, everything jsut gets tied up.
By putting the tween as a child of a movieclip and changing the overall properties of that movieclip, it doesn't interact with the tween'd object itself.
That's a really rough explanation, but I'm pretty sure that's why you cannont do it the way you intended. :S
Thanks Zettl, that is roughly the conclusion I have come up with, as if you put a "trace" command on the clip it will still tween, but the trace txt will come up.
Annoying thing is that it took me the best part of a week to figure all that out! Flash can throw you these curve balls sometimes - Thank God for Flashkit!
You will know everything when you know you never will.