MovieClip as button animate on MOUSE_OVER

Hello,
Obviously I'm an AS3 newbie and I appreciate your help so
here goes...
I have a SCENE with 4 MOVIECLIPS near the bottom of the scene
that when moused over I want them to scroll/animate upwards to
reveal the full view of the movieclip which has a message on it.
Very similar to www.sunchips.com. Please look at this and you'll
know exactly what I'm trying to do.
In the main timeline I have the 4 movieclip properties set as
BUTTON with instance names on each mc. The attached code is for the
first button/mc. I want the mc to scroll up when you mouse over it
then scroll down when you mouse out. Thanks for your time!
Here is the AS code that is on the last frame of the SCENE
where it stops the intro animation.
I get this error message when I test the movie:
1061: Call to a possibly undefined method gotoAndPlay through
a reference with static type flash.display:SimpleButton.
=================================

If they are movieclips, identify them as movieclips in the
properties panel. Buttons do not have a gotoAndPlay method.

Similar Messages

  • How do I make a Flash button animate after clicking?

    I think the title is self explanatory... anyway, I wanna make my buttons do a cool animation (like roll away or explode) but until AFTER they're clicked, anybody got a simple explanation? I'm using CS3 btw, thanks!

    Within the movieclip, along its timeline, you create whatever different animations you intend for the different interactions.  Then you assign code to the movieclip for those interactions that tell it to go to the sections of the timeline associated with each interaction.  You could also do it using movieclips within the movieclip, controlling which are visible/playing at any time.
    So in the movieclip you create an animation for what happens when you rollover the movieclip.  And you assign rollover code to the movieclip to tell it to run that animation (gotoAndPlay(etc)).

  • MovieClip versus Button

    The setup: A 6-tab navigation with a simple animation where
    the tab rises and falls. Each tab is a separate movie clip that
    uses a "null" Button (read: square graphic with alpha set to 0) as
    a hit area contained within each timeline.
    The Issue: When the AS is on the main timeline (i.e.,
    mcTab1.onRollOver...), the animation will "jitter" when the cursor
    passes over it slowly. But when the AS is moved directly on to the
    movieclip's null button instance (i.e. on(rollover)..), there is no
    jitter?
    While the latter fixes the jitter, I'm wondering why there is
    this disparity. As a personal "best practice" I keep my AS on the
    main timeline in its own layer for ease of debugging and code
    maintenance. I've nothing against putting AS on instances, but it
    can make for some slow troubleshooting on some of my larger
    projects. If I have to make an exception to putting AS on Button
    instances, I can live with that, but I don't understand why this
    would even be an issue to begin with.
    Any thoughts?

    Code placement would have no effect - aside from maybe your
    scope changing.
    The only time I've ever seen a button 'jitter' is when the
    button moves
    causing the onRollOut event to happen before it should.
    Dpending on the code
    and button, rollOver's and rollOut's can be continously
    generated causing a
    jitter. Put some trace statements in your code to see if this
    is the
    problem.
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • MovieClips as Buttons! Need help here!

    Hi I have made several movieclips and added "on"-events for
    them on the main timeline. These events tells it to play something
    INSIDE the movieclips (i have been labeling keyframes inside the
    MC). So far no problems.
    I'm using Flash Pro 8 btw..
    The problem occurrs between the onRollOver and the
    onRollOut.( Or between the "_over" and "_out" labels inside the
    MC.)
    If I move the mouse to fast over my button, it doesnt
    automatically jump to the "_out"-label inside my MC.
    (before the playhead inside the mc gets to the stop(); were
    the _out label is, too).
    Sorry, my english sucks. I'm completely stuck and my flash
    web page needs to be handed in wery soon. I would appreciate your
    help!
    Here is a link to an example file with my problem, so that
    you can take a look at it yourself!:
    http://home.no.net/mlaffa2/2006/example.swf
    http://home.no.net/mlaffa2/2006/example.fla
    And this is the thing I'm working on, with the problem times
    100:
    http://home.no.net/mlaffa2/2006/
    http://home.no.net/mlaffa2/2006/jep.fla

    Try moving your "_out" label one frame to the right so it is
    after the frame
    with the stop().

  • Flash CC: Load MovieClip using button

    Im here because im really stuck, and i need to finish my job quiclky.
    I never used FLash CC, I always used Flash 8... So much easy to load clips etc.
    Well, Here is the .FLA in Flash CC format so u guys can give me a little hand (please).http://www.sendspace.com/file/u6mh4p
    The thing that i want to do is: When i make click on button History (first button on the left side) "Not the logo" i Want to load MovieClip called History (stopped one).
    I really appreciate any help.
    Thanks in advance RushWHQ

    assign your button an instance name (done same way in cc as flash 8 - eg, history_btn) and assign your library movieclip a class (right click the library symbol >click properties>tick export for actionscript>enter a class name in the class field - eg, HistoryClass).  then in the actions panel, use:
    var history_instance:HistoryClass;
    history_btn.addEventListener(MouseEvent.CLICK,f);
    function f(e:MouseEvent):void{
    history_instance=new HistoryClass();
    addChild(history_instance);

  • MovieClips in buttons

    Hey,
    It's been a while since I used Flash and I'm having a
    problem with buttons that animate in their various hit stages.
    I've defined a movie clip for each of the three states (Up,
    Over and Down) with the intention of making each clip play
    once whenever the button enters that state, so far so good.
    Unfortunately though the hit state movie clip only seems to
    play while the mouse button is held down, where as I'm sure
    in prior versions of Flash this wasn't the case (it used to
    play once through the hit state animation then return back to
    the Up/Over state.)
    I've also tried giving the movie clip within the hit state a
    name and using an on(release) handler on the button itself
    to play it, but no luck..
    Is there any way of making it revert back to this old
    behaviour, or do I need to create a single movie clip that does
    all the work of managing the various states with a ghost
    button overlaid to catch user input?
    The desired output of this is to create a button that glows
    when the mouse rolls over it, then explodes and re-forms
    when clicked (in case there's a more efficient way of
    accomplishing this.)
    Cheers,
    Mike
    P.s. Using Flash MX (6.0)

    Hi Thanks for quick reply,
    If you have a look in the attached file i have button btnChallange i am trying to add event to it but i don't know its giving error
    ReferenceError: Error #1065: Variable btnChallange is not defined.
        at FB_index_fla::MainTimeline/FB_index_fla::frame81()
    Please its am morning here if you reply this message i will be very thankful to you

  • Controlling movieclip through button

    Dear all,
    I'm experiencing some problems with what I would have thought
    to be relatively simple in Flash 8.0. I would like to control a
    movieclip through a button.
    I have found some tutorials on the web but I couldn't manage
    to get anything working completely. As I understand you add a
    button and a movieclip and name both instances. The actionscript
    for the button should be something like:
    on (release) {
    butterfly-mc.stop();
    This seems to work, but when I add a second button which
    should start again, using butterfly-mc.start();, it just won't
    start again.
    I'm thinking this might be some kind of scoping problem
    (defining some local actions directly on the movieclip seems to
    work fine) and the .stop() might be stopping the complete animation
    but this is a long shot and I don't know how I could verify or
    overcome this.
    This is my first project in Flash so any hints would be very
    welcome!
    Best,
    Joris

    @adobe: if i put the button instance in a another container
    (example: _root.somemc.mybutton) the code runs in normal context
    and "this" returns really "the instance i have clicked"... -
    is it a Bug or i'm a Idiot ;)
    @Joris:
    put your instance's to stage - give them the Names you want
    and write your code somewhere on the main timeline as follow (for
    the button):
    mybutton.onRelease = function():Void{
    this._parent.butterflymc.stop();
    "mybutton" is the instanceName of your Button
    and everthing will be ok ;)...
    Sorry for my bad english... i hope someone can understand my
    question.

  • Movieclip controll - buttons

    Hi forum!
    This is my first post here and I have a question..
    I'm creating a menu in Flash, it will consist of 4 seperate categories - home, portfolio, contact and links. All these menu items or categories are buttons that triggers a movieclip that plays and makes new information to the meny.
    For exampel: Press contact, the movieclip starts and stops - the contact informations shows. And if you press contact again, the movieclip starts from the stop-position and then stops again.
    Hope you got it!
    But when I press, for example portfolio, after already pressing contact, the portfolio items is shown over the contact information.
    How do I make the showing movieclip to play when I press another button? Just like I discribed..
    Here's the file - http://www.swfcabin.com/open/1297146943
    Hope that you understand my issue, I will try to upload the flash-file that I'm having problem with soon.
    Danny

    Well I want contact to play backwards if you press the portfolio button..
    The mc_contact movieclip is a motion tween over 21 frames, on the 10th is stops, and is shown next to the menu. And if you press the contact button again, the movieclip starts from the 10th frame and then plays to the end and stops at frame 1.
    And the mc_portfolio is built the same way.
    Let me put it this way:
    When you press the button contact in the menu, the mc_contact plays from a on (release) {mc_contact.play();} - code. The portfolio button and its movieclip is built just like this, but with another content.
    If you press the contact button, the movieclip starts, and then stops and shows its content.
    If you then let the movieclip stay active and press the portfolio button, i want the mc_contact movieclip to play to the end and stop at frame 1, and later on the mc_portfolio to start and stop at its 10th frame, so the content is shown.
    Will be gratefull if I'll get the right answer on this!
    D

  • Only half of movieclip animated button is showing up in firefox

    Pretty much says it in the title... for some reason, only a portion of the button is showing up.  Works fine in IE, but not in safari or firefox.  Any help would be appreciated!

    Post a link, there is no way for use to know otherwise.... could be any number of things.
    Adninjastrator

  • When the forward button animates in it looks glitchy. It is sort of greyed out. What can I do?

    The forward button appears the wrong color when using gestures to go back. It appears correctly when I actually point and click the back button to make it appear.

    I've added a picture of it showing up correctly vs incorrectly.

  • MovieClip over buttons

    Hi all,
    I have a simple flash app that has a serise of pages with
    back,next buttons. There is also a help button. When the user
    clicks 'help' I have a full page movie clip with the help details
    that is made visible (it is initially set as _visible=false). The
    problem I am having, is that the next/back buttons below (that are
    now masked), still work!! If you move your cursor over where they
    would be, the finger icon appears and clicking does actually movr
    the page on or back - even though you can't see it!
    Is there something I can do to stop this - or is ther a
    better way of showing the help page?
    Cheers
    Tim

    One way is to temporarily disable all those buttons when you
    make the movie clip visible. and then re-enbale them when you make
    the MC invisible. If you have no buttons in the MC that you need to
    interact with, you can make the MC a button which will prevent
    anything underneath it from being accesible.
    full_page_mc_whatevermyinstancenameis.onRollOver = function()
    this.useHandCursor = false;
    If it were me, I would probably go with what is behind door
    #1. Store all the names of the buttons in an array and then run
    through a for loop to enable them or disable them as needed.
    Another option is to have two full page MCs. One below the
    one you really want to see. Make the one below a button and use the
    script above so that it becomes a button but doesn't make the hand
    cursor pop up and then you can still have buttons in the top MC.
    Make both of those large MCs visible and invisible at the same
    time.

  • Stage check for MovieClips or buttons

    I want to check if the stage is loaded with stuff. If it is,
    remove it and load my new stuff. If it isn't load my stuff.

    Here's some code I started playing with after seeing your
    posting... You might want to play with a little more and see what
    you can do to make use of it... for starters just place it on frame
    1 of the timeline and start piling objects in there of different
    types and see what you get.
    I had one more line in it after the var object:... line, but
    it wouldn't play in strict mode... it tells you what's being
    removed when you run it out of the strict mode...
    trace(object.constructor);
    Maybe someone knows how to get that info the right way in
    strict mode.

  • How do I make buttons within a movieclip play from a specific frame in scene 1?

    Hi guys
    I have a movie clip on the main timeline. This movieclip has buttons that I want to play different frames in scene 1.
    At the moment, this is the code I'm using in scene 1.
    learnclouds_mc.anna_btn.addEventListener(MouseEvent.CLICK, clickanna);
    function clickanna(evtObj:MouseEvent){
    gotoAndStop("annasstory", "Scene 1");
    I'm getting the error below but have no idea what I should be doing.
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at Work_Life_Flash_Stage_1_fla::MainTimeline/frame4()
        at flash.display::MovieClip/gotoAndStop()
        at Work_Life_Flash_Stage_1_fla::MainTimeline/golearnclouds()
    i hope somebody can help me!

    If you only have the one scene, you do not need to include the scene argument in the goto method call.
    The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....
    - is not in the display list
    - doesn't have an instance name (or the instance name is mispelled)
    - does not exist in the frame where that code is trying to talk to it
    - is animated into place but is not assigned instance names in every keyframe for it
    - is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).
    If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

  • AS3 loading external swf files with buttons from inside a movieclip

    In my main .swf I have labels on the timeline, navs for those btns are on the first frame of the AS layer and each button sends the playhead to a different frame.
    On one frame called fr1 there is an mc called mc_1 that appears on stage when the playhead stops there. Inside mc_1 are a set of navigation buttons that need to call external .swfs.
    Do I add event listeners on the last frame of mc_1 for each button?
    how do I call the loaders for the swfs on the buttons since the swfs will load on the main timeline NOT the mc_1 timeline?
    So label on main timeline called fr1 will load external1 swf , on fr10 external 2.swf will load and so on.
    any help?

    The code for that button's event listener needs to be placed wherever it has direct access to the button.  Not necessarily on the same timeline, but in a place where both the button and the code are present at the same time.
    The code could be placed at the frame in the main timeline where the movieclip with the button(s) is, targeting the buttons via the movieclip (mc.button.addEvemtListener...) , unless the buttons are somewhere down the timeline of that movieclip.
    If they are down the timeline of that movieclip, then you would need to have the event listener also inside the movieclip, down its timeline where the buttons are finally settled in... being sure to assign instance names to the buttons at every keyframe.

  • Goto next frame in a movieclip from main timeline button

    So what I have is a button (named Next) on the main timeline. I have a movie clip on that frame (on the main timeline) and the movie clip has 3 frames that I want to be able to cycle through using the "Next" button that is on the main timeline. How can I go about doing this?
    Thank you,

    Thanks kglad! Works like a charm. :-)
    I had already named the instance of the movieclip and button so I just needed to change the code to match and it's working great.
    One other issue I've come up with now is that when it goes to the 3rd frame of the movieclip and I click next, it doesn't do anything. shouldn't it go back to frame 1 of the movieclip?

Maybe you are looking for