A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Point me in the right direction or tutorial

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    2

    Point me in the right direction or tutorial

    Just picture a basic normal site that runs the same movie over and over agian,

    I have a button - no problems there

    When you click the button I want display some text that wasnt there before.

    Obviously I can do it by sending it to a new frame but I dont want the movie to stop playing in the background or to start over.

    I am not sure what i should be researching here to make that happen.

  2. #2
    Junior Member
    Join Date
    Feb 2012
    Posts
    2
    Sorry I said text - but there will be an image that shows up as well.

  3. #3
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Have you heard of movieclips? You should learn of them, do a quick google search
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  4. #4
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    I actually found one of my earlier tutorials covering Movieclips, so here you go.

    ----------------------------------------

    - MOVIECLIPS -

    Movieclips are very powerful objects with their own timeline. Much like the timeline with Frames on the Main Stage, you can make a movieclip on a Frame, with its own Frames and stuff. You can for instance go to a different frame inside a movieclip, while the Frame on the Main Stage is still the same!

    To create a movieclip, simply draw a Shape or anything you want, let's say for instance, a rectangle, select it, press F8, choose MovieClip, and press OK, to convert it to a movieclip. Double-click it to enter it, and you'll see another Timeline with Frames, currently there'd only be 1 Frame. Try clicking on Frame 2 on the timeline of this movieclip, and press F7 to make a blank keyframe there. In there, draw a Circle or something else. Now, click on Frame 1, press F9 to open Actions Panel, and type:

    Actionscript Code:
    stop();

    and do the same with Frame 2. You see, since Movieclips have their own timeline, if no stop(); is put on a frame there, they'll forever play in a loop, because when you reach the last Frame of a Timeline, if you haven't put a stop(); code on the last frame, it will start playing from Frame 1 again! Now, move to Frame 1 by clicking on it, select the drawn shape, press F8, choose Button, and press OK to convert it to a button. Click on this button, press F9 to open actions panel, and type this code:

    Actionscript Code:
    on(rollOut){
        gotoAndStop(2);
    }

    Now, when you roll out after touching the button, it will go to and stop on Frame 2 of the movieclip, and since this button is inside the movieclip, it will affect its timeline, and no the Main Stage's timeline, so it will go to and stop on Frame 2 of the movieclip, while remain on the same frame on the Main Stage - test your movie!

    Next, get out of the movieclip by either double-clicking anywhere you haven't drawn something, where there is no object, or press on Scene 1 above the Timeline to return to the Main Stage.

    Movieclips can have names to refer to them, to enter their timeline. To make an Instance name for a movieclip, as it's called, click on your movieclip, press CTRL+F3 to open Properties Panel, and in the textfield labeled Instance Name, type in something unique like, my_movieclip (name have to start with a letter or underscore). Now, our movieclip is given the reference name, my_movieclip, which we can refer to, to do stuff with it. Make a button the Main Stage, next to the movieclip, and use this code on it:

    Actionscript Code:
    on(release){
        my_movieclip.gotoAndStop(2);
    }

    Now, by referring to our movieclip, and then using gotoAndStop(); we tell Flash to go to Frame 2 of the Movieclip's timeline, so by referring to a movieclip's instance name, we enter its Timeline! Clicking the newly created button will result in the movieclip going to Frame 2 of its own Timeline!

    ----------------------------------------

    Hope this helps
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

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