Groups | Blog | Home
all groups > flash actionscript > august 2006 >

flash actionscript : Overlapping/Target Problem


SLMHILL
8/1/2006 7:18:27 PM
Please tell me what's wrong with my script.....

on (press) {
startDrag("_root.b1", true);
}
on (release) {
stopDrag();
}
ifbOverlap:Boolean = b1.hitTest(bowl2);
setProperty("_root.b1",_x,"182.8");
setProperty("_root.b1",_y,"188.3");
tellTarget("_root.WELLDONE"){
play();
}
}

If the b1 instance is dropped on bowl2, I want it to play the WELLDONE mc.

Errors.........

**Error** Scene=Scene 1, layer=b1, frame=1:Line 7: '(' expected
if bOverlap:Boolean = b1.hitTest(bowl2);

**Error** Scene=Scene 1, layer=b1, frame=1:Line 8: Statement must appear
within on/onClipEvent handler
setProperty("_root.b1",_x,"182.8");

**Error** Scene=Scene 1, layer=b1, frame=1:Line 9: Statement must appear
within on/onClipEvent handler
setProperty("_root.b1",_y,"188.3");

**Error** Scene=Scene 1, layer=b1, frame=1:Line 10: Statement must appear
within on/onClipEvent handler
tellTarget("_root.WELLDONE"){

**Error** Scene=Scene 1, layer=b1, frame=1:Line 13: Unexpected '}' encountered
}

Total ActionScript Errors: 5 Reported Errors: 5

Thanks
Craig Grummitt
8/2/2006 1:16:02 AM
hmm.. would you like the short or the long(thorough) answer?
the short answer is you'll manage to get it to pretty much work if you remove
the curly bracket after stopDrag(); and remove ':Boolean'. however if i was to
give you feedback on this code there are many other comments i would make if
you would like it. If you would, let me know first - what version of Flash you
are using?
AddThis Social Bookmark Button