A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: movie clip as button, AS problem

  1. #1
    Senior Member
    Join Date
    Feb 2002
    Location
    Sydney - Australia
    Posts
    167

    movie clip as button, AS problem

    hi I'm having a problem scripting a movie clip as a button here's the code

    yellowbtn_mc.onPress = function() {
    yellowbtn_mc.onPress.gotoAndStop(3);
    };

    I have this in a keyframe above the mc buttons
    it says there's no errors in the code but it's not working, and sugestions

    Cheers
    Ru
    Creativity is more important than knowledge - Albert Einstein

  2. #2
    Senior Member stoc's Avatar
    Join Date
    Nov 2001
    Location
    Romania, Arad
    Posts
    428
    this is correct code :

    code:

    yellowbtn_mc.onPress = function() {
    this.gotoAndStop(3);
    };




    or :

    code:

    yellowbtn_mc.onPress = function() {
    yellowbtn_mc.gotoAndStop(3);
    };


    Stoc Digital Studio - Web Applications Development
    http://www.stoc-studio.ro

  3. #3
    Senior Member
    Join Date
    Feb 2002
    Location
    Sydney - Australia
    Posts
    167
    alas that does not work, this is very confusing
    Creativity is more important than knowledge - Albert Einstein

  4. #4
    Insomniac felicks's Avatar
    Join Date
    Oct 2002
    Location
    South London
    Posts
    213
    why not simply put this code on the button:

    on (release) {
    gotoAndStop(3);
    }
    Sleep is for people without imagination.

  5. #5
    Senior Member stoc's Avatar
    Join Date
    Nov 2001
    Location
    Romania, Arad
    Posts
    428
    Originally posted by Visions of them
    alas that does not work, this is very confusing
    impossible ...
    probably you forgot to give to that mc instance ... instance name : "yellowbtn_mc"
    Stoc Digital Studio - Web Applications Development
    http://www.stoc-studio.ro

  6. #6
    Senior Member stoc's Avatar
    Join Date
    Nov 2001
    Location
    Romania, Arad
    Posts
    428
    ...
    Attached Files Attached Files
    Stoc Digital Studio - Web Applications Development
    http://www.stoc-studio.ro

  7. #7
    Senior Member
    Join Date
    Feb 2002
    Location
    Sydney - Australia
    Posts
    167
    Originally posted by stoc
    this is correct code :

    code:

    yellowbtn_mc.onPress = function() {
    this.gotoAndStop(3);
    };




    or :

    code:

    yellowbtn_mc.onPress = function() {
    yellowbtn_mc.gotoAndStop(3);
    };


    it's o.k I found removing yelowbtn_mc and just having Goto and stop did the trick thanks for your help

    felicks I'm using mc's as buttons so I can add effects to them, ineed them to zoom, as they are artwork samples, and it's when people click on them will hopefully load up the artwork..thats the next fun bit..I have to say i hate coding, too many pitfalls I'm a designer at hart, and trying not to let the code dictate my design

    Thanks for all your help
    Last edited by Visions of them; 09-29-2003 at 11:06 AM.
    Creativity is more important than knowledge - Albert Einstein

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