A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: ack... action script

  1. #1
    Junior Member
    Join Date
    Jul 2000
    Posts
    2
    okay
    this is my 1st post hear so be nice (please ;])

    i have finally decided to have a fiddle at action script

    but i cant get it working
    what i want to do it this

    i have 3 buttons
    and 3 things for the buttons to show when pushed (movies)

    so when you push

    button1 i want a movieclip called 'monty' to be shown in the middle of the 'stage'

    button2 = movieclip called 'music'

    button3 = movieclip called 'toonz'

    so if this is to be what should i do ?
    the movie clips are all the same size & scale(ie x,y)

  2. #2
    Junior Member
    Join Date
    Mar 2000
    Posts
    26
    Hello,

    Welcome! Although I'm not a regular poster, I understand what it feels like when the big bad world of actionscript starts taking over, so don't worry - I'm sure everyone's been in the same boat at some time!

    What you need to do is create your three movie clips with their instance names 'monty', 'music' and 'toonz' and position them in the middle of the stage. When they've got graphics in, it will look like a real mess, but don't worry. Create a blank frame at the beginning of each of the three movie clips and add a 'Stop' action to those frames.

    When you then go back to your main timeline, they will look like little white circles - which can be a little disconcerting.

    Then, in the instance properties of the first button, you can add this code:

    On (Press)
    Begin Tell Target ("/monty")
    Play
    End Tell Target
    End On
    On (Release)
    Begin Tell Target ("/monty")
    Go to and Stop (1)
    End Tell Target
    End On

    This will play the 'monty' movie clip for as long as the user holds down the button (which I think is what you mean when you say 'push'). Then simply repeat that code in the other two buttons, substituting '/monty' for '/music' and then in the last button, '/toonz'

    If you wanted the clips to toggle, upon *clicking* the buttons, then this would be the code for the 'monty' button:

    On (Release)
    Begin Tell Target ("/toonz")
    Go to and Stop (1)
    End Tell Target
    Begin Tell Target ("/music")
    Go to and Stop (1)
    End Tell Target
    Begin Tell Target ("/monty")
    Play
    End Tell Target
    End On

    This stops the other two from playing, and starts the monty clip. Then you would just use the right combinations of the above code for your other clips.

    Hope that was of some help.

    All the best,

    Pat




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