Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drag and drop levels

Status
Not open for further replies.

janet24

Technical User
Jul 22, 2003
161
US
I have a drag and drop flash file that works fine. It contains questions and answers. You drag the correct answer in the correct place and it sticks.

When I bring the same movie into a level of another movie it will drag but won't stop where it's supposed to. In other words it's stops working.

The code has a few buttons and they look like this.

b_readiness.onPress = function() {
this.startDrag();
};
b_readiness.onRelease = function() {
this.stopDrag();
if (this._droptarget == "/d_readiness") {
this._x = 173;
this._y = 165.5;

} else {
this._x = 65;
this._y = 232.5;
}
};

Thanks in advance.
 
The culprit is this line:
[tt]
if (this._droptarget == "/d_readiness")
[/tt]
"/d_readiness" is an absolute path means "_level0.d_readiness". Now your _level0 is not your movie but the hosting movie, therefore it won't work.

"_droptarget" is Flash 4; I wouldn't use it but do it like this:
[tt]
if (this.hitTest(d_readiness))
[/tt]
(And stop using absolute path if I were you.)

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top