A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Drag & Drop...Then goto next scene.

  1. #1

    resolved


    Hi...

    I wanna drag an object...when drop/release...i want to
    goto scene 2.

    I just cant remember the way to do this ?
    Here is my actions....("/dyna") is the dragable movieclip.
    Everything works exept the (goto next scene)..so whats wrong ?
    ___________________________________
    on (press) {
    startDrag ("/dyna");
    }
    on (release) {
    gotoAndPlay ("Scene 2", 1);
    stopDrag ();
    }
    ___________________________________

  2. #2
    Senior Member Leo Lima's Avatar
    Join Date
    Jul 2000
    Location
    São Paulo, Brazil
    Posts
    745
    Try having a framelabel at the beggining of the next scene.
    then gotoAndPlay("startofscene2").

    Regards,
    Leo Lima

  3. #3

    resolved


    Hi Leo Lima....

    Thanx for helpin out, I just tryed the "lable" thing in
    ur suggestion....but no luck.



    Any other suggestions ?????


    Thanx.

    Tor


  4. #4

    resolved


    Hi.....

    Does anybody else know how to do this ?

    Please help me


    Tor

  5. #5

    resolved



    Is it at all possible ???


    help?


    Tor

  6. #6
    Junior Member
    Join Date
    Aug 2000
    Posts
    12

    hehe =)

    This is my code =)

    on (press) {
    startDrag ("/dyna");
    }
    on (release) {
    tellTarget ("_root") {
    gotoAndStop ("scene2");
    stopDrag ();
    }
    }


    So the thing is u have to do is to go back to your root and do a blank keyframe (i have put a label on it called "scene2")

    On the label u can tell go to scene 2 and play =)

    That s it =)

    Cya.

  7. #7

    Hi pixel_in_motion.....

    Thanx for responding..

    excuse my lack of actionscript nowhow....but i dont
    uderstand this part:

    tellTarget ("_root") {

    "go back to your root "

    ??? wel.....i guess i need a step by step guide.

    Tor


  8. #8
    Senior Member
    Join Date
    Oct 2000
    Posts
    144

    _root is the main timeline-you could also try / or ../

    / or ../ _root or _meta

  9. #9
    Junior Member
    Join Date
    Aug 2000
    Posts
    12

    ok

    easy =)

    Imagine u are on a hard drive

    a schema:
    ________________
    ________________

    +ROOT
    - scene 01
    - scene 02
    - movie clip dyna
    -button (in the movie clip)
    ________________
    ________________

    Sorry I ll have to say :

    U have to go back to your scene01 and do a blank keyframe (i have put a label on it called "scene2")

    SO:

    u tell the button to go to scene02 but scene02 is not in the same "directory" . so u "tell target" and like the target is scene01 u just have to tell to go bak to "_root" this way u can command action on the scene01 =)

    Hope u understand my way of thinking...

    sorry for the lack of explanations but english is not my native language =/

    Cya =)



  10. #10

    resolved Thanx



    Hi pixel_in_motion...

    Thanx ... i'm gonna try that

    Hi geiver....Thanx for ur respond as well


    Tor

  11. #11
    Junior Member
    Join Date
    Dec 2000
    Posts
    6

    Drag and Drop and Action!? but where?

    Pixel-in-motion!
    I tried that your script and did it work!
    you cannot imagine how happy i was...
    but i have further problem.
    Action happens everwhere when i release the mouse.
    I guess i have to set property? but how?
    Do i have to give then an exact number of x and y position?
    Since i am a kind of biginner,
    I really appreciate if you or anybody can explain to me with simple words....

    Thank you in advance!

  12. #12
    Senior Member
    Join Date
    Oct 2000
    Posts
    144

    yes

    yes you need to constrain it to coordinates or anytime you push, but I didn't really look at the script. Is it set on clip event in flash 5 or is this in the main timeline or on a button in a movieclip?

  13. #13
    Junior Member
    Join Date
    Aug 2000
    Posts
    12

    ..

    Hey leo

    Of course it happens anywhere...

    U have to define a hit test if u want to drop the movie clip on a specific zone and then play the action u want. So if pos_x of movie clip = pos_x of the hit zone then go to and play blablabla if pos_x different than pos_x of hit then go to frame 1 or all u want.

    The best way is to make a button with only a hitzone (no shape in the other states of the button only the hit one) like that u can view ur testzone on the movie while creating it, but can t see it when u render the movie =)and like that u can scale ur hitzone (that is the way to do a puzzle and adjust the difficulty : more tiny hitzone = more hard puzzle)

    Hope this give you some tips on how to do that and open u some new ideas .

    Damn 07H35 AM here just wake up hope my english is not that bad in the mornin lol =)

    Cya.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center