Additionally, you may opt to use "else if" so that the second expression
isn't evaluated if the first one evaluates true.
...
}
else if(delta<0){
...
James O'Reilly — Consultant
Adobe Certified Flash Expert
http://www.jamesor.com
Design • Code • Train
Patrick Matte | BLITZ wrote:
function onEnterFrame(){
var delta:Number = mc._x - oldX;
if(delta>0){
launching;
}
if(delta<0){
launching2;
}
oldX = mc._x;
}
BLITZ | Patrick Matte - 310-551-0200 x214
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gustavo
Duenas
Sent: Friday, February 16, 2007 10:48 AM
To: Flashcoders mailing list
Subject: [Flashcoders] help
Hi, I need desperately some help...how can I detect if some dragged
object is moving right or left.
Because I need to trigger some event when its moving right and other
when it is moving left.
so far I'm trying to use this, but it appears to be useless.
this is the code inside the object which is dragged.
var xright = this._x+1;
var xleft = this._x-1;
if (this._x==xright){
launching
}
if(this._x==xleft){
launching2
}
regards
Gustavo Duenas
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com