AS3 air project.. nested button in a movie clip .. trying to use a class script

I have been tring to have a button in a nested movie clip move the timeline along using a class script attached to the nested movie. I can get the buttons to work on the main timeline with another similar class script, but when I have a button within a nested movie and attach similar code to the movie, it doesn't seem to want to work. This is the class code attached to the nested clip.... I guess can an active listener be called if the button isn't yet being visible yet, and should this be done on the Main class script page for the main timeline? Any help would be great!! Thanks
package  {
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    public class Animation extends MovieClip {
        public function Animation() {
            gotoAndStop(1);
            negBackground_btn.addEventListener(MouseEvent.MOUSE_UP, buttonPressedNegBackground);
        private function buttonPressedNegBackground(e:MouseEvent):void {
            negBackground_btn.visible = false;
            gotoAndStop("negChar");

Hi,
Your question is bit confusing, try to explain it. According to what I unsrestand you should use the particular movieClip name with the code to make it happen properly.
Like :
(movieClip_Instance).gotoAndStop("negChar");

Similar Messages

  • Simple Button to Control Movie Clip

    Hello,
    I was relatively comfortable with AS 2.0, but am having a
    hard time warming up to 3.0. I feel that this should be something
    simple to find help online with, yet I'm finding it difficult to
    get a simple answer.
    I have a button that is inside a movie clip within another
    movie clip:
    mainMenu_mc > whoBtn_mc > whoButton
    This button appears to work fine controlling a movie clip on
    the same timeline. This is the code so far (on an Actions frame in
    WhoBtn_mc):
    whoButton.addEventListener(
    MouseEvent.CLICK,
    function(evt:MouseEvent):void {
    whoGlow.gotoAndStop("click");
    I have another movie clip on the main timeline that I would
    like to control with this button:
    blackFadeBottom_mc
    What would the code look like for this?
    Any help is appreciated - Thank you.

    Thanks, I was able to place the code on the main timeline and
    get a trace when I clicked on the movie clip instance itself. I
    probably didn't explain what I was trying to do very well, so I
    apologize.
    What I need to do is to control this movie clip that is
    physically placed on the main timeline (fadeBlackBottom) with the
    button that is buried under two other movie clips
    (mainMenu_mc>whoBtn_mc>whoBtn).
    I would like the whoBtn to tell the fadeBlackBottom movie
    clip to (what used to be)
    _root.fadeBlackBottom.gotoAndPlay("play"); This will drop down a
    box that will contain the content of my 'Who' link.
    How can I accomplish this?
    Thanks again,
    Chuck

  • Trying to connect buttons to a movie clip

    Hi all,
    I need step by step instruction on how to attech control buttons to a movie clip.
    I imported the .MOV clip (a 3D rotation) into the library, and I would like to be able to control where the rotation stops, by use of a slider or clicking a button. Can some one please tell me how to do this in an easy way if possible?
    Any help would be greatly appreciated so much.
    Many thanks,

    drag your movieclip to the stage and assign it an instance name, say movMC.  create your button and give it an instance name, say btn.  you can then use:
    btn.onRelease=function(){
    movMC.gotoAndStop(your frame label or number here);

  • Problems coding a button within a movie clip to navigate scenes

    Hello there! I've got another probably noobish question to ask about CS6.
    My goal is very similar to the one mentioned in this previously discussed forum question: http://forums.adobe.com/message/837995#837995 and also in this question http://forums.adobe.com/message/4172919#4172919
    I am attempting to make a button inside a movie clip in my first scene go when clicked to the first frame of my second scene. I named the button's instance menu_button_1 and I believe Scene 1 and Scene 2 are the names of the scenes. (If they should have special names or instance names, I did not see where to type them.) Because of the similarities, I attempted to follow the suggestions on those pages. However I probably did some small thing wrong, (Or heck, maybe a huge thing.) which I what I'd like help with to find.
    stop();
    myButton.addEventListener(MouseEvent.CLICK, clickHandler);
    function clickHandler(evt:MouseEvent):void {
    gotoAndStop(1, "Scene 1");
    This seemed to be what was suggested to enter. I attempted to modify it to work for me as well. This is what I typed for the button's action.
    menu_button_1.addEventListener(MouseEvent.CLICK, clickHandler);
    function clickHandler(evt:MouseEvent):void {
    gotoAndPlay(1, "Scene 2");
    (I removed the stop function because I have music looping in the movie clip that I want to play until the mouse is clicked.) (Also, I picked gotoandplay because I wanted scene 2 to start playing immediately when clicked rather than stopping.)
    I tried variations, including "2" instead of "scene 2" and whatnot. I also tried linking it to differnet places just to see if that would work. It seems like it could link if I only asked for a frame within the movie clip itself, but it couldn't go to any other frames in scene 1 or scene 2. When I attempt, this message is displayed in the output:
    ArgumentError: Error #2108: Scene 2 was not found.
        at flash.display::MovieClip/gotoAndPlay()
        at interactivestgermant_fla::menu_1/clickHandler()
    It seems it cannot find my Scene 2. (It also cannot seem to find Scene 1 when I prompt it to do that.) I'm afraid I'm not sure of what I've entered incorrectly, though I'd imagine it involves how I typed the scene navigation. Should it have an instance name or something? I'd very muchappreciate a push in the right direction. If you need any more info I'll be happy to provide it. Thanks for the help! I very much appreciate it.

    I bet you're absolutely right. However I am not sure how I am misnaming it, as to my ametuer eyes, it seems to be entered properly into the properties box? It does show up as "menu" written in white over the keyframes and also in the properties slot. I can include some images here to help out in correcting me.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-1-395704638   This image shows my movie clip. This seems to be the problem it's having, identifying "menu." Did I do that incorrectly? It looks to be in order.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-2-395704633 This is inside of the movie clip named menu. You can see I did the same to name the button menu_button_1.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-3-395704627   This shows the action I gave to menu_button_1 in which I attempt to have it naviagte to Scene 1 frame 493.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-4-395704623  This shows where I'd like the button to go to. (It is hard to tell if that's frame 493 or 492. I figured that it should be ok either way and if this frame is 492 then it's easily changed once I get the darn thing working in general) (Also, I named the layer "peanuts." I tired entering the name "peanuts" as well but it didn't seem to work either, so I figured "493" is easier since I know that you can go to a specific frame by doing gotoandplay("scene 1" , #) and I'm not sure if it requires any additional stuff to go to a name.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-5-395704687    These are the errors I get. I totally agree with you- It seems very much to be an issue of getting it to recognize the "menu." However I am unsure where I named something wrong. Is this enough info to help you perhaps point out where that is?

  • Button within a movie clip not working

    Hiya,
    I have a movie clip within my swf website that is basically
    an icon that you roll over to produce the menu. The movie clip has
    coding inside it to produce the rollover effect. This is as
    follows:
    stop();
    this.onEnterFrame = function(){
    if(rewind == true){
    prevFrame();
    this.onRollOver = function(){
    rewind = false;
    play();
    this.onRollOut = function(){
    rewind = true;
    Whilst this coding works fine for this movie clip, for some
    reason the buttons within the movie clip that appear as you
    rollover them will not work when pressed. I am trying to get them
    to navigate the main timeline, i.e. coding as follows:
    on (release) {
    _parent.gotoAndPlay("home")
    _parent should be correct, I've tried it without and with
    _parent._parent however still it has no effect. From what I can see
    everything should be working fine.
    Is there some reason why buttons will not work within this
    sort of roll over effect movie clip?
    Thanks for your help.

    you can't assign mouse handlers to a parent movieclip and
    expect a child movieclip to respond to mouse events: the parent
    will intercept those events.
    to remedy, either assign all your mouse handlers on the child
    generation movieclips or use a hitTest() for one of the
    generations.

  • Problems with button inside draggable movie clip

    I am building a click through presentation that has some small text in it. To maintain the design and allow for readability, I have added a zoom feature.
    Here is the structure of the movie,
    Stage - contains pages movie clip and forward/reverse click buttons for changing pages
         pages_mc - contains 24 frames, one page per frame and buttons
    There is a button at the _root level that uses a tweener to scale the pages_mc up to 170%. When this is clicked, it allows the pages to be dragged around the screen so you can look at different sections. When you click the button again, it returns the pages back to their original size stops drag.
    My problem is, on the pages, there are buttons with links to external sites. Once startDrag has been invoked, I cannot touch the buttons inside the movie clip. Is there a way to make these buttons work?
    I need the finished quickly so any assistance is welcome.
    Code below
    magUp_btn.onRelease = function() {
    this._visible = false;
    TweenLite.to(pages_mc, .25, {_x:-250, _y:-193, _xscale:170, _yscale:170});
    TweenLite.to(magUp_mc, .75, {_alpha:0});
    TweenLite.to(magDown_mc, .75, {_alpha:25});
    magDown_btn._visible = true;
    pages_mc.onPress = function(){
    this.startDrag();
    pages_mc.onRelease = function(){
    this.stopDrag();
    pages_mc.onReleaseOutside = function(){
    this.stopDrag();
    pages_mc.useHandCursor = false;
    TweenLite.to(instr_mc, 1, {_alpha:100});
    magDown_btn.onRelease = function() {
    TweenLite.to(pages_mc, .25, {_x:0, _y:0, _xscale:100, _yscale:100});
    TweenLite.to(magUp_mc, .75, {_alpha:25});
    TweenLite.to(magDown_mc, .75, {_alpha:0});
    this._visible = false;
    magUp_btn._visible = true;
    pages_mc.onPress = function(){
    this.stopDrag();
    TweenLite.to(instr_mc, 1, {_alpha:0});
    I don't know how to turn drag off when I zoom out without using the onPress command, but I know that this is probably what is getting in the way of the button working?
    Thanks!

    One option is to make the background of the pages be the draggable parts rather than the movieclips that contain the pages and buttons.  That way, the buttons could be atop the background and not have their access blocked.
    Instead of coding the pages_mc, you would essentially have the background coded for the drag...
    pages_mc.bkgnd.onPress = function(){
        startDrag(this._parent);

  • IMovie HD refuses to import .MOV clips that it used to import.

    I've got an odd problem. Doing a search didn't turn up anything relevant to my situation so I'm gonna try to pick some brains on here.
    My Problem: My version of iMovie(5.0.2) no longer recognizes .mov clips that it used to. Meaning that when I try to import clips using settings that worked previously, I am now confronted with an Error during import message that reads "The file could not be imported: Unknown Error". Two things have changed since I last made a project.
    1.) I have added a microphone that now allows me to record stereo audio. I don't think this is the culprit.
    2.) I updated to 10.6.6 Recently. I think this may be what messed things up.
    After trying to Drag and also import clips through the menu with no success, I tried to import clips that I have used before under the exact same conditions and was greeted with the same error. This is importing using the HDV 720p setting. If I try to import new or old clips using the standard DV (16:9) setting then everything works.
    These same clips are able to be imported into iMovie '09 with no trouble but I am uncomfortable with that interface. Is there anything I can do to continue to work in iMovie HD or would I just be better off with getting used to iMovie 09?
    Thank you for any replies.

    I have Mac 10.6.6 and use iMovie 05 transferring it to iDVD 08. It is getting less easy to do, but usually i make the movie in 05, complete with chapter marking and press the export to DVD.
    The file for the Movie I have made is saved automatically in the Movie folder on my owner/home page. To get it out to iDVD 08 open 08 and select create new project and click save This puts a small file into Documents, However to get your work into the new DVD select import>video and when the screen opens for you to find it go to your movie folder in your owners area and click to open the file. It works, but there is usually a problem somewhere along the line. Usually a different one each time, occasionally it goes like clockwork. It won't work if you try the drop down 'open' option.
    This last time I got so irritated that I've downloaded the last set of film clips to 05 and then transferred them to 08 to compare the results. I still feel that the later versions are less good (?dumbed down) and await to be converted.

  • Attach movie clips to scrollPane using attachMovie

    Hi
    I tried to attach movie clips to scrollPane using attachMovie
    but could not do it
    I tried the following code:
    sp.contentPath="emptyMovieClip"
    sp.content.attachMovie("boxesRow","boxesRow1",1)
    trace(sp.content.boxesRow1)
    Im able to trace the sp.content.boxesRow1 , but not seen in
    the scrollPane
    Can any one suggest me , how can I do this
    Pleaseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
    Thank you very much

    hi,
    The code is correct....
    But, what i want to know is, are using the Identifier name of
    the moviclips ???
    "emptyMovieClip" should be an Ideintifier name for an empty
    clip in the library.
    and "boxesRow" should refer an identifier name of another
    movie clip in the library...(its should also contain some object
    for the visibility check)...

  • I have a Iphone4. Trying to update from 4.3.3 to IOS 5 or 6.  There is no 'Update Software' button under Utilities/General. Tried updating using Itunes but it comes up 'The Iphone software update server cannot be contacted' ????

    I have a Iphone4. Trying to update from 4.3.3 to IOS 5 or 6.  There is no 'Update Software' button under Utilities/General. Tried updating using Itunes but it comes up 'The Iphone software update server cannot be contacted' ????

    iOS 4.3.3 doesnt have the "Update your Software" tab so you will need to go to itunes and back up your iphone then restore your iphone and it will download the latest iphone software (6.1.4) if you dont want 6.1.4 download your current version and hit shift on your keyboard (alt if your on Mac I think) and click restore iphone and find your downloaded software 4.3.3 then download iOS 5 or 6 and do the samething after your phone boots up from restoring it to 4.3.3.

  • Urgent : Flash CC File is corrupted, symbol (movie clip) are empty, use count : 0 . ONE week of work lost, need help!

    Hello,
    I have been working on a Flash File with a lot of animations / symbols etc, and on thursday (during the Adobe Update), when I opened my file, all the symbol (movie clip) are empty, use count : 0.
    The size of the file is still the same though, 35mo.
    I had only this file, I really need help to repair it...
    Please let me know if you have a solution.
    Thank you!

    hi,
    Can you please share the file which got corrupted?
    Was the original file created in older version(CS6 and below) of Flash?
    Were you trying to open the file in Flash CS6?
    Did your original file had symbol names containing | : ; & * , etc.characters or leading/trailing spaces?
    Rgds,
    Mukesh

  • Build AS3 AIR project on Linux for Android and iOS?

    We're about to use a build server for taking some work out of our hands (testing, building etc). The build server is running on Linux and therefore we would like to know if we can build the AS3 (AIR) sourcecode on the Linux environment. We usely create apps for Android and iOS.
    Can anyone give some more information on this? Is it true that the ADT doesn't run on Linux?

    FYI, I updated my blog post.  I found a program called ideviceinstaller (available in the Ubuntu repos ala apt-get install ideviceinstaller or from the website) that allows installation of .ipa files onto iOS devices from Linux.
    Previously that was the only development iteration step that required a Windows VM.  Now in my workflow, a VM is no longer required for iOS development.  (Obviously a Mac is still required to upload to the app store at the end.)
    Also, a bonus, here's a quick command to view UUID's authorized by the provisioning file inside an .ipa file:
    > unzip -c Main.ipa *.mobileprovision | strings | egrep -i string\>[0-9a-f]\{40\}
    <string>d9c2fee807324a18baf5a544ffa2c80f23d3****</string>
    <string>f634a0a95bc2327f6a26cb39cf18a01918cf****</string>
    <string>651e4284467d328e37c18988c981179b5909****</string>
    <string>c11d7eef800632d072da067d9b993624f25b****</string>
    <string>72d85ab26cd525a328d3a71e3fe416c61fd6****</string>

  • Can't get Simple button to Load Movie Clip

    Hi I've looked around for the answer to my question on this
    forum
    but havent found it so here it goes. I am working on this
    company's
    Flash site that was built by an outside studio. I am using
    CS3.
    The url to the site is
    http://www.bubbakeg.com.
    (this link will take you to the main page click the shadow
    graphic
    on the left under Bubba and this will take you to the site I
    am speaking
    of. The site is basically 5 different pages or movie clip.
    What I am
    trying to do is basically change the "Spring Break" middle
    graphic
    (which is a Movie Clip) on the HOME page and add a simple
    button
    that will direct the user to a new page. When I replaced the
    graphic
    with a new Movie clip there was no problem but I have added
    a
    button to load a new page (movie clip) and nothing happens.
    This
    button is in the movie clip of the new graphic which is
    called up
    when the page loads. If i take this button and just put it
    on the
    Main Stage in Scene 1 by itself it works and loads the page
    (movie clip). It does not however when it is embeded in the
    Movie
    Clip. The Flash site is basically 5 different Movie Clips
    loaded into
    an "Empty Clip". This empty clip has a timeline with each of
    the
    clips labeled and with their respective sized placeholders.
    And
    when you click on either the links on the Nav bar or the
    graphic
    for each page it loads that movie clip on the main page. It
    seems
    like the button only wants to work on the main timeline. I
    have
    even replaced the code for the "Contact" button with the code
    for the new button and it worked (opening new page). Here is
    the
    code for the new button that does not work:
    on (release) {
    _root.contentHolder.myHeight = 307;
    _root.contentHolder.newLoc = 9;
    heightAnimation();
    I know the location and height from the above code are
    referring to the placement and sizing of each movie clip
    in the "Empty Clip". As i said before this heightAnimation
    and the resizing of the new clip works fine when the
    button resides in Scene 1 on the Main Timeline but not
    within the new movie clip (graphic Ive created.)
    I will upload the main chunk of the code that resides
    in Scene 1 on the first frame of the "Actions" layer.
    If anyone has any ideas I would appreciate it very much!
    Please let me know if I can provide anymore info.
    Thanks!
    Greg

    change:
    function newLayerBT_CLICK(MouseEvent):void{
    to:
    function newLayerBT_CLICK(e:MouseEvent):void{

  • Buttons in a movie clip don't go to frame Labels

    Hello, I have 1 button inbeded in a movie clip named mcintroclp that is on frame 1 of my main timeline, Frame 2 is labeled port_btn on the main timeline. In the timeline of the movie clip mcintroclp I've put the code:
    stop();
    function buttonClick(event:MouseEvent):void
    gotoAndPlay(event.target.name);
    port_btn.addEventListener(MouseEvent.CLICK,buttonClick);
    The problem is that when the port_btn is pressed the playhead starts from the beginning of the main timeline not at frame 2 with the label port_btn. does anyone know what I am doing wrong, Thanks
    SQ

    what timeline contains your code?  (that's the same timeline that contains those two buttons, correct?):
    The timeline that contains the code is the movie clip named mcintroClip I've put the code on an actions layer on the last frame of the MC timeline. Which is the same timeline that contains the two buttons.
    what timeline contains mcintroClip?
    mcintroClip is on the first frame of the main timeline (whaich has a label home but I dont think that matters)
    what timeline contains intro_mc?
    intro_mc is the instance name for the movie clip mcintroClip on the main timeline. I tried to put that in the code because I don't relly know what I'm doing.
    what timeline has labels that match your button names?
    The main timeline contains the labels that match the button names, at this point frame 2 is labels port_btn
    The only othe code I have is stop(); on frame 1 and 2 of the main timeline.
    Thanks much for all your help on this.

  • Button inside a movie clip

    Ok, i'm new at action script so i have a problem
    I have a sound inside a movie clip (sound_MC) in the main
    timeline, and i have another movie clip with a button inside, and I
    need that button to control that sound movie clip
    on (release) {
    gotoAndStop("off_radio"); // this goes to another frame in
    the movieclip with the button (works fine)
    on (release) {
    _root.gotoAndPlay("stop_loop"); // this goes to another
    frame of the sound MC (doesn't work)
    // i have this in the stop button
    on (release) {
    gotoAndStop("on_radio");
    on (release) {
    _root.gotoAndPlay("start_loop");
    // and this for the play button
    whats the code for that ?
    what should i do?

    i solve the problem !! :-D
    but now i hold like to now how i make a fade out sound
    command when i enter a frame and a fade in when i enter in another
    frame
    here are the examples:
    http://tubo_centeno.web.simplesnet.pt/problem/problem.html
    http://tubo_centeno.web.simplesnet.pt/problem/problem.fla
    can anyone help me?

  • Moving the play head in the main timeline from a button in a movie clip

    I have a movie clip that loads and when it is done playing it has a close button that unloads the movie clip... I want to add code to this button that moves the play head to frame 20 of my main timline using actionScript 3.0

    Tried that but dose not work think its because I am loading the movie this way...
    Play button "playFinal"
    function lastQuestion(event:MouseEvent):void{
         var Info:final1 = new(final1);
         this.stage.addChild(Info);
         Info.x=511
         Info.y=340; }
    So I tried using the Name "Info"
    //example......    MovieClip(Info.root).gotoAndStop(20);
    And I tried the name of the clip in the library "final1"
    //example......    MovieClip(final1.root).gotoAndStop(20);
    Is it because im loading it with actions script instead of having it on the timeline?

Maybe you are looking for

  • Info Set

    Hi All, I am having a production problem with infoset, where in we have a join on Sales Order Header & Item data and Material ODS. Now when we execute the query on this infoset, it gives duplicate records for some of the sales order, the reason for t

  • Need sample to build one XML doc from 2 ViewObject writeXML

    I just discovered the ViewObject methods readXML and writeXML methods... really neat!. I want to package the output from a master writeXML along with its detail writeXML ViewObject into one big XML string to be sent through a queue to another compone

  • Color Manage - Yes or No?

    First, I'm a color management geek and fan. Almost all of my work in the past was under my total control, so I was able to select my own commercial printer. I only worked with commercial printers who had a firm grasp on color management, had current

  • Ever transfer a Boot camp partition from one Mac to another?

    My iMac has a working Windows 7 running on Boot Camp partition. I want to move it -- system and all, every last bit -- to my MacBook Pro. I installed Win 7 on the MacBook Pro and Windows said it would not authorize the system cause I installed it too

  • Synchronising music across multiple devices

    I have a Powerbook G4 (my main music storage device), a MacBook Air, and an iPhone 4, all of which are connected over an Airport Extreme/Express wireless network. How can I "sync" my music files across these devices? I have about 50GB of music on the