Sie sind nicht angemeldet.

Graydon

Profi

  • »Graydon« ist der Autor dieses Themas

Beiträge: 614

Wohnort: Texas

Beruf: Industrial gas turbine services.

  • Nachricht senden

1

Donnerstag, 19. Februar 2009, 20:15

can't seem to get stop / stopall() / breakall()

I'm playing around today and am having difficulty "stopping" an action.

I have a simple move action...

Quellcode

1
2
3
4
	<action name="move">
		tween(plugin[button].x,500,distance(500,5),linear);
		tween(plugin[button].y,500,distance(500,5),linear);
	</action>


It is called with an "onover" event from another image plugin.

I'm trying to use the "onout" event to stop the movement... but regardless of what I try, I can only get the tween...x to stop. It is the first tween listed.

If I switch the order of the tweens... and put tween...y first, then it is stopped by the onout event.

I've tried the following for the onout...

Quellcode

1
2
3
4
5
6
7
---
onout="breakall()";"
---
onout="stop(action(move));"
---
onout="stopall();"
---


All behave the same way.

So, what is the proper way to stop both tweens?

I've tried on both 1.0.7 and 1.0.8b5 and am using the standalone flashplayer v9.

Thanks,
Graydon

2

Donnerstag, 19. Februar 2009, 20:26

Hi,

a tween can currently only be stopped through a other tween of the same variable,

what do you think about a stoptween() action?

Graydon

Profi

  • »Graydon« ist der Autor dieses Themas

Beiträge: 614

Wohnort: Texas

Beruf: Industrial gas turbine services.

  • Nachricht senden

3

Donnerstag, 19. Februar 2009, 22:10

Zitat

a tween can currently only be stopped through a other tween of the same variable
OK... but if my move action is just...

Quellcode

1
2
3
<action name="move">
tween(plugin[button].x,500,distance(500,5),linear);
</action>


...then any stop / break used did stop the single tween.

I also just tried the following:

Quellcode

1
2
onover="tween(plugin[thumb].x,500,distance(495,5),linear);"
onout="breakall();"



Quellcode

1
2
3
onover="tween(plugin[thumb].x,500,distance(495,5),linear);"
onout="stopall();"
 


... and the single tween stopped.

But, this acted the same...

Quellcode

1
2
3
4
onover="
tween(plugin[thumb].x,500,distance(495,5),linear);
tween(plugin[thumb].y,500,distance(495,5),linear);"
onout="stopall();"


Since I currently only really need to stop a single tween activity... I have a method that appears to work.

But, a stoptween() action could be handy for something in the future...

Maybe a stopaction() action that disrupted the action at it's current state... i.e.. set any tween values, zooms, view, etc... at the current state would work. But then someone would want a "onstop" or "onstopaction" event capability that could be defined within an action so that they could properly handle the "what-ifs".

The "onstop" would be similar to "oninterrupt"... but with "oninterrupt" set by a mouse click... and "onstop" set by another action.

It's making my head hurt... I'll trust in you to come up with a fabolous solution. *g*

Graydon

Graydon

Profi

  • »Graydon« ist der Autor dieses Themas

Beiträge: 614

Wohnort: Texas

Beruf: Industrial gas turbine services.

  • Nachricht senden

4

Freitag, 20. Februar 2009, 05:56

OK, I was playing around some more and I really will need to be able to stop multiple tweens at a single time.

A stoptween would work for my situation (versus the other ideas I put out there earlier)... you wouldn't happen to have that buried in the valentine's special, would you?

5

Freitag, 20. Februar 2009, 14:55

Hi,

you're right - with breakall() and stopall() - the tweens are also stopped

the difference between breakall and stopall is:

- on both all tweens and actions are stopped
- on breakall - the "done action" (=last parameter in a tween call) is executed after stopping

I have added now a stoptween() action, I will release it soon

best regards,
Klaus