As3 button inside imported swf

Hi all,
I have a site where an .swf is loaded into frame 11 of the main timeline using newLoader().
In this .swf there is an titlebuttons_mc with seven buttons in, images_mc etc.
How do i navigate back to, background_mc, frame 40, which is on frame 1 of the main timeline.
Thanks for any help
s1976h

if the code for the buttons is on the external swf's main timeline, you would use:
titlebuttons_mc.buttonwhatever.addEventListener(MouseEvent.CLICK,f):
function f(e:MouseEvent){
MovieClip(e.currentTarget.parent.parent).background_mc.gotoAndStop(40);
if the code for the buttons is on the timeline of titlebuttons_mc's timeline, you would use:
buttonwhatever.addEventListener(MouseEvent.CLICK,f);
function f(e:MouseEvent){
MovieClip(parent.parent.parent).background_mc.gotoAndStop(40);

Similar Messages

  • [ ? ] Targetting function inside imported SWF

    Hi,
    Is it possible to target function that's inside imported (or
    Loaded) swf
    file?
    I want to load external swf file into my fla project file,
    and then with a
    press of a button (for example) trigger a function that's
    inside that
    imported (or Loaded) swf file?
    Thanks in advance!
    Roman

    not one that's imported, but yes to one that's loaded. you
    just need to use the correct path to the function:
    after loading is complete, you can access the main timeline
    of the loaded swf by referencing the target movieclip of your load
    method.

  • I need some help with importing SWF's

    Hi guys, my problem is kind of hard to explain, but i'll do
    my best.
    Im working on a flash site which is set up like this:
    index.swf ( contains the template, buttons, and
    movieClipLoaders spread out along the time line, for importing the
    other pages)
    one of the buttons ( PRODUCTS ) on rollOver has a sub menu
    open with 6 other buttons.
    onRelease products(button) moves to products frame, which
    loads products.swf page.
    now, products.swf also contains movieClipLoaders, ALSO the
    same buttons as the sub menu at the top of the page.
    (products is basically a slide of pictures page)
    i can get the buttons inside products.swf to load the slides
    easy... but i ALSO need the buttons in the sub menu to open the
    correct slides too.
    like:
    sub menu ---=> products.swf ---=> corresponding
    slide.swf
    HERES THE SITE
    this should explain better what im trying to do.. the buttons
    in the sub menu don't do anythng because i dont know what to do..
    to sum it up, if the viewer clicks on PRODUCTS button, it
    loads products.swf, which contains the same buttons as the sub
    menu... but if the user clicks on one of the buttons in the sub
    menu, i need it to open products.swf AND goto the right frame
    (which contains a movieClipLoader) for the corresponding button
    that was clicked..
    I hope this makes sense...
    Thanx in advance for any help.

    You can change the time it takes for the iPod to go back to the lock screen when it is not being used.  Go to settings>General>Auto-Lock to change that time.

  • Embedding Button symbol from swf

    Hi,
    I am embedding a Button Symbol into Flex from from a swf. The Button inside the swf has an up and over state. Now I embed the symbol into an image in Flex. The image is in one of my states.
    All works fine initially  in Flex as far as the up over state. Now the  The problem is when I go back to the base state and then back to the state with the embedded swf symbol.....it initializes still in the over state, until I mouse over then mouse out and now its in the Up state.   What could be the probelm here??
    thanks for taking time to look at this!
    -Mike
    // -- SWF EMBED ---
                [Embed(source="skins/ICD9_ReferenceCodes_v2_3_blue.swf", symbol="back_btn_button")]
                [Bindable]
                public var BadApple:Class;
    // -- SWF EMBED END --
    <mx:State name="search_code">
                <mx:RemoveChild target="{vbox1}"/>
                <mx:SetProperty target="{text1}" name="text" value="Code Search:"/>
                <mx:SetProperty target="{text1}" name="x" value="130"/>
                <mx:SetProperty target="{text1}" name="y" value="136"/>
                <mx:RemoveChild target="{image1}"/>
                <mx:AddChild position="lastChild">
                    <mx:Image  id="image_BackBtn1" x="11" y="74.95" source="{BadApple}"
                              click="OnClickNewSearch(event)"
                              />
                </mx:AddChild>
                <mx:SetProperty target="{image_BackBtn1}" name="y" value="74.95"/>
            </mx:State>

    Alex,
    I'm not  following  you, why do I need a button?.....can create Mouse over and out events like this?:
    var event:MouseEvent = new MouseEvent(MouseEventMouseEvent.MOUSE_OVER.);
    myImage.dispatchEvent(event);
    var even2t:MouseEvent = new MouseEvent(MouseEventMouseEvent.MOUSE_OUT.);
    myImage.dispatchEvent(event2);
    would this work?
    BTW any idea if this is a Bug or known issue that I'm experiencing?
    -Mike

  • Buttons inside moveiclip not accessible

    Hi,
    I am making this website, which contains a load file, which contains a movieclip holder, which holds all the different parts of the website.
    Now within the portfolio.swf, which is within mcholdr, inside load.swf, there are several images, which are buttons. On clicking one image, I have code which dims, i.e. reduces _alpha for all the buttons and disables them. Now when I test portfolio.swf alone, this code works, but when I access portfolio.swf through load.swf, the code is not working.
    The code within each image button inside portfolio.swf is:
    while (i<=29) {
            _root.folioholdermc["img"+i]._alpha = 20;
            _root.folioholdermc["img"+i].enabled = false;
            i++;
    img1 to img20 are the image buttons. They are placed within folioholdermc, which in inside portfolio.swf.
    Structure with portfolio.swf alone : Main timeline ------> folioholdermc -------> img1 to img20
    Now through load.swf is : Main timeline --------> mc_load -----------> portfolio.swf (loaded with MovieClipLoader)
    I tried everything from
    _root.mc_load.folioholdermc[img....
    folioholdermc[img.....
    Nothing works. Is this a path problem??? How do I access these buttons?? I want to use the loop, as there are many buttons, so a simple img1._alpha will not work, as I will have to type this out for each button. How can I get the same effect using the loop??
    Thanks

    If I'm interpretting your posting correctly, it ilikely you have an issue using _root references.  Unless specified otherwise, if you load an swf file that uses _root references, those _root references will target the main file's _root.  To get around this you probably need to implement _lockroot in the files that you are loading.    Look it up in the AS2 help files.  In your case it may be as simple as adding the following to the main timeline of the file(s) you load...
    this._lockroot = true;

  • AS3 Putting Buttons Inside Movie Clip

    I am practicing AS3 (after years of AS2) and am having trouble having a button inside a movie clip talk to another movie clip on the main timeline. Here is the code:
    OneButton.addEventListener(MouseEvent.CLICK, OneButtonClicked);
    function OneButtonClicked(event:MouseEvent):void
    MovieTarget.gotoAndStop(1);
    MovieDescription.gotoAndStop("One");
    TwoButton.addEventListener(MouseEvent.CLICK, TwoButtonClicked);
    function TwoButtonClicked(event:MouseEvent):void
    MovieTarget.gotoAndStop(2);
    MovieDescription.gotoAndStop("Two");
    The code above works, but if I put OneButton and TwoButton inside a movie clip, I know longer can target MovieTarget and MovieDescription. The reason I want to put OneButton and TwoButton inside it's own MC is so I can dim each button after it is clicked by toggling the playhead inside that MC. Help? Thanks!

    Start over from the begining
    press  f8 and chose movieClip then draw your untoggled button call the movie button then create another movie and create your toggled button or greyed out button and call it greyedButton.  Go to main stage add 2 button instances and 2 greyedButton instances( just drag from library).  you have 4 instances on stage.  give call instance names and place one them on top of each other so u can only see 2 buttons on stage.  put the greyed button under the button.
    now with action script
    button1.addEventListener(MouseEvent.CLICK, OneButtonClicked);
    function OneButtonClicked(event:MouseEvent):void
    MovieTarget.gotoAndStop(1);
    MovieDescription.gotoAndStop("One");
    button1.visible = false; //  here the greyed button will show
    button2.addEventListener(MouseEvent.CLICK, TwoButtonClicked);
    function TwoButtonClicked(event:MouseEvent):void
    MovieTarget.gotoAndStop(2);
    MovieDescription.gotoAndStop("Two");
    button1.visible = true; // here button1 will go back to its orignal state
    button2.visible = false // here the greyed button will show

  • Cannot import SWF with document class (AS3)

    When I try to import a SWF-file (published from a FLA-file with a as3 document class) via the mx:SWFLoader into Flash Builder, the imported SWF is not showing up (as3 build a cube from papervision3d). Which way do you have to import such a SWF-file?
    Regards, Sjoerd

    Shitf+Ctrl+Enter:
    Attempting to launch and connect to Player using URL preloader.swf
    [SWF] preloader.swf - 9591 bytes after decompression
    [SWF] big.swf - 1785015 bytes after decompression
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at DocumentlClass()
    Cannot display source code at this location.
    My document class (simplyfied):
    package {
        import flash.display.Sprite;
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.events.MouseEvent;
        import fl.transitions.Tween;
        import fl.transitions.TweenEvent;
        import fl.transitions.easing.*;
        import flash.events.ProgressEvent;
        public class CarouselClass extends MovieClip {
            private vars...
            public function CarouselClass() {
                trace("document class triggered");
                    this.addEventListener(Event.ADDED_TO_STAGE,init);
            private function init(evt:Event):void{
                 texts = new Texts();
                carouselSprite = new Sprite();
                addChild(carouselSprite);
                topContainer = new Sprite();
                carouselSprite.addChild(topContainer);
                hitBar = new HitBar();
                hitBar.x = stage.stageWidth / 2 - hitBar.width /2;
                hitBar.y = 245;
                addChild(hitBar);
                downContent = new DownContent();
                addChild(downContent);
                downContent.y = 325;
                downContent.title_txt.text = "Learning Carousel";
                downContent.description_txt.text = "Click on one of images above to view further details";
                createSections();
            } ... (more functions)

  • Control imported swf/movieclip

    I have one swf importing a number of other swf's to play in turn. I wish to control the imported.swf which is loaded into a movieclip (MainScreen) from the main.swf - in AS2 I used
         MainScreen.sfp=1;
         MainScreen.gotoAndStop("wait");
    which stopped play and sounds in the imported.swf or  MainScreen.gotoAndPlay("go"); which started the imported.swf
    In AS3, I have tried the same thing but get no response, though I can lick on a button in the imported.swf to make it play, I cannot control it via the main.swf - have also tried this.MainScreen.gotoAndStop("wait"); but no change. Am stuck as I do not wish to include buttons on each imported swf.
    Also: Can I copy the contents of one movie clip to another.  I have a series of movieclips mcp1, mcp2... inside another movieclip (mcp). I initially load several external.swf into this movieclip (mcp.mcp1 mcp.mcp2 ...etc) so as to see the progress of each swf loading (maybe 15 or 25 depending) then show one page at a time fulll screen. I have then in the past simply relaoded one imported.swf into the MainScreen movieclip which is quicker having preloaded each swf in a group, but this seams inefficient. Any comments or ideas appreciated.
    Thanks

    Thank you Ned... 12,500 responses odd, you have made more responses than I've had hot lunches.
    I appreciate you comment about removeChild and not unload, and that is what I tried to try.
    stop();
    function fwd_bF(event:Event):void {
          trace("fwd:");
          SoundMixer.stopAll();
    MainScreen.removeChild(ldr);      // MainScreen  is a movieclip
            pgno+=1;
           gotoAndStop("g_g");
          function rev_bF(event:Event):void {
       MainScreen.removeChild(ldr);
               SoundMixer.stopAll();
               trace("rev: "+pgno);
               pgno-=1;
               gotoAndStop("g_g");
    books_b.addEventListener(MouseEvent.CLICK, books_bF);
    home_b.addEventListener(MouseEvent.CLICK, home_bF);
    fwd_b.addEventListener(MouseEvent.CLICK, fwd_bF);
    rev_b.addEventListener(MouseEvent.CLICK, rev_bF);
    ldr.contentLoaderInfo.addEventListener(Event.INIT, dealWithIt);
    MainScreen.addChild(ldr);
    function dealWithIt(evt:Event):void {
          var MainScreen:MovieClip = MovieClip(evt.target.content);
          MainScreen.gotoAndPlay("go");
          play_b.addEventListener(MouseEvent.CLICK, play_bF);
          stop_b.addEventListener(MouseEvent.CLICK, stop_bF);  
          function play_bF(event:Event):void {
                trace("go...");
                MainScreen.gotoAndPlay("go");
          function stop_bF(event:Event):void {
                trace("stop...");
                MainScreen.sfp=1;
                MainScreen.gotoAndStop("wait");
    ldr.load(new URLRequest("swf/"+arm[pgno]+".swf"));  // arm[*] is array containing swf names.
                                                                                          // pgno  :Number keeps track page we’re at
    I have trouble getting the MainScreen to removeChild, it either removes the ability to reload or leaves multiple swf’s loaded into the mc. I’ve tried using MainScreen.removeChild(ldr) and MainScreen.removeChild(evt.target.content) inside the dealwithit function, but it does not like that either.
    I found a loader at Google that brings in multiple files (swf, jpg, mp3 etc) and puts swf’s to an array. Which all sounds applicable to what I require, but being new to AS3 etc it seems to be hidden in packages and cryptography, so I will need to see how I can put it in place. But I think I will still be faced with the same problem of then controlling the various swf’s.

  • Imported swf

    Hi,
    I am hoping someone will be able to help here. I have a
    10-slide presentation in Captivate 3 and the first slide is a flash
    animation I created in Flash CS3. When I test the project using the
    preview option - In Web Browser everything works fine and as
    expected.
    My problems start when I publish my project. I have tried
    swf, exe, with and without preloaders; I add a blank slide in right
    at the start to see if that was the problem again with and without
    a preloader. The imported swf does not play no matter what I do.
    After a while though the click button become active and when I
    click it moves on to the next slide. I just need to work out why my
    first slide does not play correct, as this is a key slide.
    I would appreciate any help in resolving this issue.
    Kind regards

    Hi Dave
    I know you have already found your answer, but I have a
    question and/or comment.
    When you published, were you certain to include the
    additional .SWF among the files on the server? If not, that
    probably explains why it failed. By changing to Flash 6, you caused
    the .SWF to be embedded inside the main Captivate movie, hence no
    additional file to ensure you distribute.
    Cheers... Rick

  • Turning the page in a pdf from inside a swf video

    I am creating interactive PDFs from InDesign. On the first page of the pdf I have a swf video in which I would like to put a link or a button that would move you to page 2 of the pdf. Not another frame of the video or URL, but just the next page of the PDF. Is it possible to do this? And if so, how?

    You don't make it clear what you're using. A "SWF" is a Flash file, and a video is a video. A SWF can load and play a video, but "SWF video" means nothing.
    If you're talking about a SWF file created in Flash, then inside your SWF you will have to fire an ExternalInterface command using ActionScript:
    ExternalInterface.call(“eval”, “pageNum++”);
    If you're talking about a video file embedded in the PDF and using the default playback widget, then you can't do it.

  • Button inside movieclip on stage

    What do I have to do to get the button to work? I view the swf and there is no active button.
    I need the button inside the clip to be active. I can't find the answer. Thank you.

    no i put a button from the library inside the clip to see if i could access a button once movie played and i couldnt see the states of that library version if I viewed the scene I could.
    I was going to create my own button, which I will, but I don't think I will be able to get to it once publised and I'm frustrated.
    I think I have run into this before, it's been a while. Is it an enable thing?

  • Call a function in the shell SWF from a imported SWF

    We have flash set up as a shell to take lesson data from XML
    and display it frame by frame.
    We import SWF files when the XML tells it to to be displayed
    on the frame.
    How can I get the imported SWF file to call a function in the
    shell....
    basically have a button or movie clip in the imported swf
    call the "gotoNextFrame()" function in the shell.

    We found a "bit" easier way if anyone is interested.. we have
    the have an eventlistner added to the loader to assign a event to
    the swf file thats imported:
    flashLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    addEventHandlers);
    then when its completed, it adds event listeners and calls
    our "goNextFrame" function (then clears it when its removed from
    the stage):
    function addEventHandlers(event:Event):void
    var swfMC:MovieClip = event.target.content as MovieClip;
    swfMC.addEventListener("NextFrame", goNextFrame);
    swfMC.addEventListener("PreviousFrame", goPrevFrame);
    swfMC.addEventListener(Event.REMOVED_FROM_STAGE,
    clearEventListeners);
    Then in the swf file thats to be imported, its real simple:
    next_btn.addEventListener(MouseEvent.CLICK, MoveToNextFrame);
    prev_btn.addEventListener(MouseEvent.CLICK,
    MoveToPreviousFrame);
    function MoveToNextFrame(e:MouseEvent):void
    dispatchEvent(new Event("NextFrame"));
    function MoveToPreviousFrame(e:MouseEvent):void
    dispatchEvent(new Event("PreviousFrame"));

  • Resizing imported swf files...

    I have a movie clip that I want to import a swf file into,
    but the swf is larger than the movie clip's area. I tried using a
    resizing code for importing images that I found, but it makes the
    swf very small. Is there a way to control the size of the imported
    swf?

    I did this recently where I had a backdrop clip that I wanted
    to serve as a 'screen' for jpgs I loaded in. I wanted them to
    resize to the full extent of the background clip and maintain their
    aspect ratio. The backdrop clip could have different dimensions at
    different points in time as well... anyhow this should work with
    swfs same as jpegs.
    So I'll explain it in my context as I don't know exactly
    yours (sorry this might sound a bit complicated because of that).
    #1 If your holderclip is called
    imageHolder and it contains a single clip inside at location
    0,0 called
    imageBackdrop
    #2 You create an emptyMovieClip inside imageHolder and use it
    to load your swf into using a Loader with a listener
    #3 you have some code similar to this in your onLoadInit
    event for the Loader (onLoadInit lets you initialise things like
    size location etc before it displays)
    If you can do something like that then I think you should be
    on the right track for what I think you want to do.

  • Import SWF or FLV Jobs

    Hi, I search a way to import FLV-jobs, created with Flash
    CS3.
    Problem: I don't find any way to export a Flash as a FLV-file
    - it takes lot of options, but nut a FLV-suffix.
    Secend Question: Who can I import SWF-files into Captivate?
    The only option I find is "Insert/Animation", which is used for
    animated buttons.
    Thanks a lot for any advice, Wolvo

    Hi Wolvo
    Insert > Animation is what you are looking for. It should
    allow you to insert the following file types:
    * SWF
    * GIF
    * AVI
    * FLA (.FLA is the Flash source file format)
    Seems odd that Flash doesn't have the capability to create
    .FLV format. I'm wondering if you maybe just need some sort of an
    additional file you can install to make it do this.
    Cheers... Rick

  • How to insert AS to fix audio in imported swf ?

    Thanks to Whyves... This previous post seems to have a solution, Im just not sure where i create layers in my Captivate 4 file? As I go into Project > Actions >???
    Cheers
    5. Mar 31, 2010 4:23 PM in response to: Whyves_
    Re: Captivate 4, interaction SWF using XML and the Reviewer tool Problem
    Part 1:
    Found a way to stop the imported SWF audio when a user switches slides. The following AS3 code was inserted into the imported swf:
    My actions layer:
    root.addEventListener(Event.ENTER_FRAME, checkSlideInfo);
    My functions layer:
    function checkSlideInfo(e:Event):void {
        /* if user moves to next or previous slide in Captivate, stops the interaction audio */
        if(root.cpInfoCurrentSlide == 4) {
            null
        } else {
            /* stops audio */
            if (savedChannel!=null) {
                savedChannel.stop();
            /* resets interaction */
            loadContentToBox(contentBox.contentText, instructions);
    So, for those trying to find a way to stop their audio from imported swfs, there's one piece to the puzzle!!! You CAN stop your imported swf audios or animation audios using the above function in AS3!
    BTW, it would be nice if Adobe would create a book on Essentials to Advanced Actions, just a suggestion since it is somewhat of a programming language and it would be nice to have samples and more informative tutorials to use.
    NOTE: The above function calls on other variables and functions are specific to the interaction. The main piece to focus on is the roo.cpInfoCurrentSlide. It had to equal slide 4 in order to allow the interaction swf audio to play. If the user switched, I stopped the savedChannel (named soundChannel variable in AS3) from playing.

    Hello,
    About your suggestion for a book on essentials for advanced actions. Rick Stone has such a book, for Captivate 4 (Goober Guide).  I have been blogging a lot about advanced actions, with links to tutorials published with Adobe Publishing Application. It is not a book, but could perhaps help you if you did not yet visited the blog. The feedback from readers is pretty positive. Here is a link to a post that has a list with the published articles, a lot of other blog posts explain use cases and principles:
    Articles on Advanced Actions
    Lilybiri

Maybe you are looking for

  • Vendor evaluation - main criterion : Delivery ; Sub criterion : On time del

    hi We have following requirement related to Vendor evaluation - main criterion : Delivery ; Sub criterion : On time delivery The requirement is: Deliveries late by 7 days should be considered as on time. pl suggest

  • Nothing was selected  Massage runing F.5E

    Hi All, When I run the F.5E that time system give the massage "Nothing was selected" How to rectify this massage please suggest me. Regards, Seema Edited by: seemacg on Jun 28, 2011 1:48 PM

  • Multi-auth and broadcast traffic

    I was talking with a co-worker about multi-auth host mode and we are wondering how does it handle broadcast traffic. So if we have a switch port set to multi-auth and we are doing dynamic vlan assignment. Say you have an esx host device running 5 vm

  • Please help. iPhoto keeps crashing/loading on start up :(

    I have tried opening my iPhoto today and it just keeps loading/crashing and force quit does not work. I have to turn the Mac book off manually. Please can anyone give me any clue as to how to fix this as I do not want to loose my photos!

  • OfficeJet 4300 all in one printer

    I gave this printer to my girlfriend a while back. She bought new cartridges and couldn't get them in. I tried to get them in and couldn't figure out how to get them in either. All of this makes me feel very stupid. The carriage is on the right side