> try:
>
> PourWater_btn.onRelease = function () {
> if(this._currentframe==1){ // assuming you only want to
trigger your goto
> statement when _currentframe is 1.
> gotoAndPlay ("PourWater_Fe");
> }
> }
That's a good one. Or delete (or set to null) the onRelease
handler of
PourWater_btn down the line. There are usually a number of
ways to solve
your problems in ActionScript. If you "get" the idea of
classes and
objects, you'll find you have a wealth of information right
at your finger
tips. The _currentframe property kglad mentioned, for example
... it's a
property of the MovieClip class. Check out these classes,
VaporAction! :)
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/
"Luck is the residue of good design."
VaporAction,
> I want ElementFe_mc to fall to a table top when
released...
> didn't think it would be hard to do, well, here's what
I've
> tried...
Okay.
> ElementFe_mc.onRelease = function(): Void {
> this.stopDrag();
> if (ElementFe_mc._y < 412.4) {
> this._y++
> }
> }
Well, here's what you've got. The Button.onRelease or
MovieCip.onRelease event is dispatched when the user releases
the mouse
after having clicked it. This only occurs once, unless the
user clicks and
releases again.
So ... when the user releases, the following occurs:
ElementVe_mc stops
dragging and its MovieClip._y property is incremented by one
pixel (if it
happens to fall beneath 412.4 pixels at the time of the
event).
I susped you want to increase the _y position as often as
necessary,
rather than just once. To accomplish this, you'll have to
continue
incrementing its value over time. You might, for example, set
up a
MovieClip.onEnterFrame event handlers inside this onRelease
handler ...
ElementFe_mc.onRelease = function(): Void {
this.stopDrag();
if (this._y < 412.4) {
this.onEnterFrame = function() {
this._y++;
}
}
}
Of course, you'll want a second if statement in there to
determine when to
delete the onEnterFrame function. Make sense?
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/
"Luck is the residue of good design."