A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Action script help

  1. #1
    Junior Member
    Join Date
    Jan 2005
    Posts
    19

    Action script help

    ok, I have a button and I want it to, when clicked, make a movie clip move to frame 2.

    i know that it should be something like:

    on(release){
    tellTarget ("scope") { gotoAndPlay (2); }

    with "scope" being the name of the movieclip but of course this isn't quite right (it never is, is it).

    could anyone help?

    thanks in advance
    Last edited by leoZ; 02-13-2006 at 11:26 AM.
    meh.

  2. #2
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    Howdy, it should be

    on(release){
    _root.scope.gotoAndPlay(2);
    }

  3. #3
    Junior Member
    Join Date
    Jan 2005
    Posts
    19
    hmm should be but isn't according to flash. the word "scope" is written in black in the actions box and I'm fairly sure it's not meant to be if that's any help...
    meh.

  4. #4
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    Seeing as it's a movie clip it will not have a color. Only Flash own words get the colors like _root, gotoAndPlay, on, function and a lot more.Are you getting an error with the code?

  5. #5
    Junior Member
    Join Date
    Jan 2005
    Posts
    19
    I'm not getting any errors, but it isn't going to frame 2 of the movie clip scope either :|
    meh.

  6. #6
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    Have you tried butting the code on the main timeline. It would look like this
    your buttonName.onPress=function(){
    _root.scope.gotoAndPlay(2);
    }

  7. #7
    Junior Member
    Join Date
    Jan 2005
    Posts
    19
    tried it just now, and again: no actionscript errors, but it doesn't do it.

    meh.

  8. #8
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    I think you may be getting the term scope mixed up with a movie clip instance.

    Is the mc actually called scope ? You should use the instance name you've given it and replace the word scope for that.

    So for example, your instance ( By that I mean the mc you've got on the stage, you've opened the properties and called it "viralInfection" ) will be called via

    _root.viralInfection.gotoAndPlay(2);

    Of course if I've totally misunderstood, sorry

    Squize.

  9. #9
    Junior Member
    Join Date
    Jan 2005
    Posts
    19
    *smacks head*

    Sorry for ever doubting you walsher. I forgot you had to give things instance names.

    Ta squize.
    meh.

  10. #10
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    Awesome, glad you figured it out. It always seems to be the smaller things that mess ya up.

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