PDA

View Full Version : Basic actionscript problem



MrPinkPanther
12-11-2008, 03:54 PM
I havent done any actionscript in ages so I wrote some last night for something Im building. It all worked apart from the easiest bit. Even now when I'm not tired I can't see where I'm going wrong.

I have a movieclip and I only want it to drag if Bar = 1 but even when I define Bar as 2 before the if statement it still moves.




onClipEvent(load){
Bar = 2;
if(Bar = 1){
startDrag(this);
}
}


It always drags even if bar = 2, any ideas?

L?KE
13-11-2008, 04:26 PM
Change

if(Bar = 1)
to
if(Bar == 1)

Perhaps?

MrPinkPanther
13-11-2008, 05:32 PM
Change

if(Bar = 1)
to
if(Bar == 1)

Perhaps?
Yeh thanks, I noticed it about an hour after I posted the thread. I knew it would be something stupid. +REP :)

Want to hide these adverts? Register an account for free!