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 wOOdy-Soft 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, change a variable, please help

Status
Not open for further replies.

antonyx

Technical User
Jan 19, 2005
204
GB
ok, i have a burger, and a fatman, and a separate mouth. on frame two of the fatman movie he gets fatter, i can drag the burger into the fatmans 'mouth'from the main scene and the burger disappears and the man gets fatter.(goes to frame 2 of fatman)
i also have a score variable declared in frame one actions.. score = 250

ActionScript for my button:

on (press) {
startDrag(this, true);
}
on (release) {
score -= 10;
tellTarget ("_root.burger") {
_visible = false;
}
stopDrag();
if (this._droptarget == "/mouth") {
_root.fatman.gotoAndStop(2);
}

}


i want score to go down by 10 when the burger is dropped but the score does not change. why not?
 
I might be mistaken, my you might need to do this:

Code:
on (press) {
        startDrag(this, true);
}
on (release) {
        score -= 10;
        tellTarget ("_root.burger") {
                _visible = false;
        }
        stopDrag();
        if (eval(this._droptarget) == _root.mouth) {
                _root.fatman.gotoAndStop(2);
        }
        
}

I think your droptarget format might have been wrong. Tell me if this works!

_____________________

"Apache Server is Apache server on Linux. Apache server is 'A Patchy' Server on Windows."

Flash101 :)
- Flash Resource Site
 
nah, the man still gets fat but the score dont go down...
 
does nobody out there have an answer for this..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top