A Flash Developer Resource Site

Results 1 to 19 of 19

Thread: Follow Mouse Navigation

  1. #1
    Member
    Join Date
    Oct 2005
    Posts
    35

    Follow Mouse Navigation

    Hello All,

    I am a newbie to Flash after doing a Short Course at the Central St Martin's college in London.

    I have learnt alot of the basics with this course, and am now trying to develop what I have learnt.

    I learnt how to have an image follow the mouse, now what I am trying to do is when the image reaches the mouse make it clickable so a menu pops open...alot like this on the xmen website: http://www.x-menthelaststand.com/movie/# (you need to enter the site to see the navigation)

    If you look at the "navigation ball" you can click on it and it will open and close various boxes for menus.

    What I am still trying to learn is how things link on the timeline, how things merge such as movie clips and buttons...

    Also I would really like to learn more about the actionscript with flash, is that something that will come in time or can i find tutorials on here?

    Many Thanks

    Nina

  2. #2
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Can't help with that navigation, but in the Movies link above, there are thousands of free fla files to download and see how they were made. Check it out.

  3. #3
    Member
    Join Date
    Oct 2005
    Posts
    35
    Ok I'll check it out. Thanks.

  4. #4
    -_-
    Join Date
    Oct 2005
    Location
    US
    Posts
    1,694
    Well, you just have to make the mc follow the mouse, and inside the mc theres another mc, and inside that a button and animation. Just make it so when the button is clicked, it plays the animation, or menu popping up.

  5. #5
    Senior Member Pazil's Avatar
    Join Date
    Sep 2006
    Location
    Ontario, Canada
    Posts
    913
    A thing I may suggest for learning actionscript: Take someones finished (SIMPLE) code, then just study it, see what does what...that is how I learned how to actionscript. Don't read the stuff they have in the tutorials, cause you'll never get it (I never did...maybe that's cause I'm only 13...). Just study lots of codes. Here's a simple code you could start with for movement, and randomness...I tried explaining as much as I could in the actionscript on the movieclips:
    Last edited by Pazil; 11-15-2008 at 09:01 PM.
    WIP-ZOMBIES

    I love vegetarians! More meat for the rest of us!

  6. #6
    Member
    Join Date
    Oct 2005
    Posts
    35
    Quote Originally Posted by Adobemedia
    Well, you just have to make the mc follow the mouse, and inside the mc theres another mc, and inside that a button and animation. Just make it so when the button is clicked, it plays the animation, or menu popping up.

    That is exactly what I was trying to do, but what do I write in the actionscript so that when u press the button the movieclip plays?

    I am still trying to get to grips with what goes where on the scenes and in the individual movie clips and buttons...

    Nina

  7. #7
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Everything you want to target needs an instance name. Nested movie clips inside other movie clips all need instance names, right back to root. When they have names, then you can target them from anywhere inside the movie with "Absolute" targeting, that looks like this;

    on(release){
    _root.mc1.mc2.mc3.gotoAndPlay(4);
    }

    This would target mc3 which is inside mc2, which is inside mc1, which is on the main timeline, _root. There is a Target Icon on the top bar of the Actions Panel that will help you find the path to any object that has an instance name. Try using it.

  8. #8
    Member
    Join Date
    Oct 2005
    Posts
    35
    ahhh ok...i get it now...how do i make it an instance root?

  9. #9
    Member
    Join Date
    Oct 2005
    Posts
    35
    its ok, i found it! lol

  10. #10
    Member
    Join Date
    Oct 2005
    Posts
    35
    how do i add the instance name though? I only seem to be able to do it when it is in the scene page?

    It asks what it wants to be an instance of? I am assuming the movieclip will need to be an instance of the button?

  11. #11
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    No, click the button or movie clip, where ever it may be, inside another clip or on the root timeline, click it once to select it. Then look at the far left end of the Properties panel for a little text box with greyed out text that says, <Instance Name>. Click in there and type in the new instance name. No spaces, can't start with a number, don't use special characters like &, *, % and so on. Make it short and sweet, like mc1, or blueMc.

  12. #12
    Member
    Join Date
    Oct 2005
    Posts
    35
    ok i think i am having trouble with the instance thing...

    I am building a website in flash, and I am trying to have a point where a button plays a movie clip which is a animation of a box appearing, which will then have images you can flick through on it. and then it will fold away again on command...

    at the moment, i have created the motion of the box appearing, but I cant get the button to start it off...

    how can i get the button to make it appear and another button to fold it away?

    Nina

  13. #13
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    When a button an a movie clip you want it to control are on the main timeline, they have to both be there in say, frame 1 and the movie clip has to have an instance name. In other words, the instance name is like say, an image name, if you don't know the name, you can't find it. Without an instance name, flashplayer can't find the movie clip to tell it what to do. If the button is on frame 1 and the movie clip doesn't come onto the timeline til frame 2 or later, it won't work, cause the instance of the movie clip isn't there yet.

    The easiest way to make a movie clip be on the stage but invisible is to have nothing in frame 1 but a stop(); Then at any time, the button can tell the movie clip to play(), which will send the clip along it's timeline past frame 1, where you see the content of it.

  14. #14
    Member
    Join Date
    Oct 2005
    Posts
    35
    i understand that as I have done that with the main pages: for example:

    on (release) {
    gotoAndStop(10);
    }

    but I am now using a new layer for the movieclip - can you show me an example of actionscript that will make a button turn on a movieclip and play?

    Nina

  15. #15
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Look at this.
    Attached Files Attached Files

  16. #16
    Member
    Join Date
    Oct 2005
    Posts
    35
    oh my god thank u so much!!!

    simple yet so affective!!!!!

    THANK YOU THANK YOU !!! THANK YOU!!!

  17. #17
    Member
    Join Date
    Oct 2005
    Posts
    35
    now why didnt i think of that!? lol

  18. #18
    Member
    Join Date
    Oct 2005
    Posts
    35
    now because of that i have kind of got the following mouse navigation working!?

  19. #19
    Member
    Join Date
    Oct 2005
    Posts
    35
    using the method you gave me am i able to do that with a mc and a btn on seperate time lines?

    for example i have a button within a mc which needs to play a mc on the main scene.

    the mc can not be on the main scene as that is built in with a btn which follows the mouse on the scene!?

    would you like to see the fla!?

    I am also trying to write a script so that when you press the ball again the mc disappears...

    you will get what i mean when you see the fla...basically i have a ball following the mouse, when u click on that a navigation (4 boxes) appears. when you click on the top left one (the only button) it should slide on a long box from the left.

    can u please view and then advice...

    many thanks for all your help!

    Nina
    Attached Files Attached Files

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