[Tweener] AS 3 If/Else issues with Tweener
Gerry Creighton
gerry at thespikeranch.com
Tue Nov 11 07:15:05 PST 2008
Well if you are using AS3 then the eventListeners are written
incorrectly. Unless you are firing a
dispatchEvent somewhere else that is "mouseUp" the eventListener
should look like this...
blue.blue_BTN.addEventListener(MouseEvent.MOUSE_UP,function()
{ Tweener.addTween(blue, {x:638, time:1});
-Gerry
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
The Spike Ranch
Web Design and Development
http://www.thespikeranch.com
ph: 609.748.7973
c: 609.703.3372
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
On Nov 11, 2008, at 10:08 AM, Nathan Thompson wrote:
> Hi all... Apologies up front.
>
> New to email lists and Tweener and AS3 so am probably going to be a
> royal pain in the proverbial... Please let me know if this is not
> the way to do things.
>
> I have the following AS
>
> if (blue.x==166) {
> blue.blue_BTN.addEventListener ('mouseUp', function() {
> Tweener.addTween(blue, {x:638, time:1});
> trace('this is 638')
> });
> }
>
> else if (blue.x==638) {
> blue.blue_BTN.addEventListener ('mouseUp', function() {
> Tweener.addTween(blue, {x:166, time:0.5});
> trace('this is 166')
> });
> }
>
>
>
> What I am trying to do is click blue_BTN and it change position
> (this works). When that is done I want to be able to click on it
> again and restore its position (this doesn’t work).
>
> Is it an if/else thing or is there a tween function I am not
> implementing.
>
> Thanks in advance if anyone can point me in the right direction.
>
> Nathan
>
>
> --
>
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20081111/4bf4b985/attachment.htm>
More information about the Tweener
mailing list