Controlling loaded swf from main timeline

Hello,
I'm working on loading external swf files for ios. I am able to load the swf files and set them to visible or invisible in different frames. I am having trouble controlling the loaded swf files from the main timeline. Specifically, I would like to have a button on the main timeline, that when clicked will move a loaded swf to frame 1.
Here is a code that loads one swf file:
var myLoader1:Loader;
var loaderContext1:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
if(myLoader1 == null)
          myLoader1 = new Loader();
          addChild(myLoader1);
myLoader1.load(new URLRequest("folder/file1.swf"),loaderContext1);
myLoader1.visible = true;
backbutton.addEventListener(MouseEvent.MOUSE_DOWN, backbutton1);
function backbutton1(myEvent:MouseEvent):void {???????????? myLoader1.gotoAndStop(1);}  (this line does not work)
(Once I load file1.swf, within the file1.swf I click a forward button to move to different frames. My question is: how do I code the 'backbutton' on the main timeline so that it causes the loaded file1.swf to go to frame 1?)
Thank you for your help.

sure.
if the movieclip on the loaded swf's main timeline has reference mc, you would use:
MovieClip(myLoader.content).mc.gotoAndStop(1);
p.s.  you might find the following helpful,  http://kb2.adobe.com/community/publishing/918/cpsid_91887.html

Similar Messages

  • Controlling multiple external swfs from main timeline

    Hi, I've been trying to combine the features of two tutorials I found, one that deals with controlling external swf's from the main timeline and the other that explains how to load and unload multiple external swf's.  I'd like to be able to load and unload multiple external swf's, and control these swf's buttons from the main timeline. 
    I asked this same question on the forum of the site where I found these tutorials, and receive only one reply saying that "it should'nt be hard to do." but they did not elaborate any further.  This left me think that I was missing something very obvious and I've spent too much time now trying to work what it is now.  I understand pretty much how both pieces of code work, but just can't work out how to combine them.
    If someone could explain it to me, I'd much appreciate it.
    Tutorial One code - controlling an external swf from the main timeline.
    var ldr:Loader = new Loader();
    var urlReq:URLRequest = new URLRequest("swfs/balls.swf");
    ldr.load(urlReq);
    function loadHandler (event:Event) {
    var myClip:MovieClip = event.target.content;
    addChild(myClip);
    function myClipOver(event:MouseEvent):void {
    myClip.myBlueBalls.stop();
    function myClipOut(event:MouseEvent):void {
    myClip.myBlueBalls.play();
    // set listeners
    myClip.addEventListener(MouseEvent.ROLL_OVER, myClipOver);
    myClip.addEventListener(MouseEvent.ROLL_OUT, myClipOut);
    // listener
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);
    Tutorial Two code - loading and unloading multiple external swfs.
    var Xpos:Number = 110;
    var Ypos:Number = 180;
    var swf:MovieClip;
    var loader:Loader = new Loader();
    var defaultSWF:URLRequest = new URLRequest("swfs/eyesClosed.swf");
    loader.load(defaultSWF);
    loader.x = Xpos;
    loader.y = Ypos;
    addChild(loader);
    // Btns Universal function
    function btnClick(event:MouseEvent):void {
    removeChild(loader);
    var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
    loader.load(newSWFRequest);
    loader.x = Xpos;
        loader.y = Ypos;
    addChild(loader);
    // Btn listeners
    eyesClosed.addEventListener(MouseEvent.CLICK, btnClick);
    stingray.addEventListener(MouseEvent.CLICK, btnClick);
    demon.addEventListener(MouseEvent.CLICK, btnClick);
    strongman.addEventListener(MouseEvent.CLICK, btnClick);

    I will not be able to help you with whatever relaxatraja provided though it is purported by relaxatraja to be clearly explaining what I was explaining (???).
    Your loadHandler function appears a bit confused.  For the code you show I don't see you assigning any event listeners for the events that will be dispatched in the loaded file.  As I showed earlier, your loadHandler function should be assigning a listener for the event that will be dispatched (modified slightly below). and if you have three different events being dispatched in the loaded file, then you'll do better to have three different listeners.  I show only one below for one of the events you dispatch...
    function loadHandler (event:Event) {
      // assign a listener for the loaded file's goExit function's event
       MovieClip(event.currentTarget.content).addEventListener("close", event1Handler);
    // I can't make sense of what you have here
        removeChild(myClip); // why ?? - it hasn't been added yet as far as I can see - error 2007?
        var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf"); // the event.target is the Loader
        ldr.load(newSWFRequest); // this will load over the file you just finished loading??
        ldr.x = Xpos;
        ldr.y = Ypos;
        addChild(myClip);  // why?? it has nothing in it
    function event1Handler(e:Event):void {
        // do whatever is involved with what the "close" event is supposed to do
        trace("goExit function executed");
    As far as what you have in the loaded file, you appear to be trying to pass the files names as if they were parameters.  The file naming should be done at the receiving side for the event handler function for the event listener.  While you could create a custom event that include parameters that you can pass, that's another level of coding that is better left for a future experience.
    Study the following - understand it before you try to use it.
    Below is a link to some files I made for another posting that demonstrates what I have been explaining.  The neurope file is the main file.  Publish the netherlands file so that you have an swf to load for it, and then run the neurope file.  The file that gets loaded (netherlands) only has a button in it that when clicked dispatches an event for which the main file (neurope) has assigned a listener.  The main file displays a message when the button gets clicked in the loaded file.
    http://www.nedwebs.com/Flash/neurope.zip

  • Control swf from main timeline

    i know i've done this before! i have a swf. 4 labels. a stop
    at frame 1. i embedd this into my main timeline. i have 4 butons in
    an MC in my main project, going to specific labels in my main
    timeline, where i have the following code, attempting to load the
    swf and jump to that label:
    this.container_shell.loadMovie("interact01.swf");
    interact_shellb.gotoAndStop("label1");
    its not working. the swf loads, but i can't jump to the
    label.
    any ideas? appologize for the basic question, i'm a designer,
    not a programmer!

    If you have a question to ask, you should start a new posting and include the code/info pertinent to your problem.  The one you are trying to catch a ride from is flawed and requires some questions to be answered.  Being that the posting is over 4 years old, it is unlikely the original poster is going to be answering any.

  • Control multi symbol on main timeline ???

    0down votefavorite
    Control multi symbol on main timeline for play movie1(symbol1) finish then play movie2(symbol2) finish and loop again on Edge Animation !!!
    My issuse is after movie2 finish movie1 not play again ????
    http://speedy.sh/BdTAx/edgeBanner442.zip
    MY Code
    //======= State ===================//
    //===== CompisitionReady
    sym.$("mv2").hide();
    sym.getSymbol("mv1").play();
    //======= Movie1 ===================//
    //====== Trigger 0 ms
    sym.stop();
    //====== Timeline.compleate
    sym.getComposition().getStage().$("mv1").hide();
    sym.getComposition().getStage().$("mv2").show();
    sym.getComposition().getStage().getSymbol("mv2").play();
    //======= Movie2 ===================//
    //======= Trigger 0 ms
    sym.stop();
    //======= Timeline.compleate
    sym.getComposition().getStage().$("mv2").hide();
    sym.getComposition().getStage().$("mv1").show();
    sym.getComposition().getStage().getSymbol("mv1").play();

    Thank for you help.
    Also If  I want to create my custom  function with paramiter  where   I  can create ??
    //======= Below is normal code generate from edge animation in empty file
    (function($, Edge, compId){
    var Composition = Edge.Composition, Symbol = Edge.Symbol; // aliases for commonly used Edge classes
       //Edge symbol: 'stage'
       (function(symbolName) {
       })("stage");
       //Edge symbol end:'stage'
    })(jQuery, AdobeEdge, "EDGE-401683841");
    ps.  if  I have more movie...I want to creat function to command show& hide Symbol when it not play .
            can you giveme sample ?

  • How to effectively remove a loaded SWF from the stage?

    I can not figure out a proper coding to remove a loded SWF from the stage.
    Here is my set up.
    I have a layout segmented into labeled section. In the section labeled "products" I have a layout consisting of product images acting as buttons which bring a user to another labeled section "prdctsPopUps"
    In the "prdctsPopUps" section I have placed an instance of LoaderMax placed into an mc container. Placing LoaderMax into an mc container automatically resolved an issue of clearing loaded SWFs from stage when I come back to "products" section.
    I specified the variable in the "products" section with the following set up:
    var sourceVar_ProductsPopUps:String;
    function onClickSumix1PopUp(event:MouseEvent):void {
                        sourceVar_ProductsPopUps="prdcts_popups/sumix1-popup_tl.swf";
                        gotoAndPlay("prdctsPopUps");
    So each button has its own "....swf" URL and they all open fine and I can come back to "products" section without any issues.
    However inside the swf (which loads through LoaderMax which is placed into an mc) there are other buttons which bring a user to labeled section "xyz". Which also functions properly. It opens as it is supposed to be and without any previously loaded "...swf" on the stage.
    At the labeled section "xyz" there is a limited set of buttons repeating from section "products" which has to bring a user back to the same set up in the "prdctsPopUps" labeled section and open a corresponding "...swf" .
    However only the last opened "...swf" will appear in that section. Effectively the one which was originally opened from the "prdctsPopUps" section and not the one which was supposed to be opened from the "xyz" section.
    I can not understand why it would work from one labeled section and not from another. I can not figure out on which section which code/function needed to be placed.
    Here is the set up from a button from the "xyz" section whcih supposed to bring a user to the same "prdctsPopUps" section but to load a different "...swf"
    var sourceVar_ProductsPopUps_fromXYZ:String;
    function onClick_floralytePopUp_fromXYZ(event:MouseEvent) :void {
                        sourceVar_ProductsPopUps_fromXYZ="prdcts_popups/floralyte-popup_tl.swf";
                        gotoAndPlay("prdctsPopUps");
    Here is the code set up for the LoaderMax from the "prdctsPopUps" section:
    var loaderProductPopUps:SWFLoader = new SWFLoader(sourceVar_ProductsPopUps,
                                                                                                        estimatedBytes:5000,
                                                                                                        container:holderMovieClip,
                                                                                                        onProgress:progressHandler,
                                                                                                        onComplete:completeHandler,
                                                                                                        centerRegistration:true,
                                                                                                        alpha:1,
                                                                                                        scaleMode:"none",
                                                                                                        width:540,
                                                                                                        height:730,
                                                                                                        crop:true,
                                                                                                        autoPlay:false
    function progressHandler(event:LoaderEvent):void{
              progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;
    function completeHandler(event:LoaderEvent):void{
              var loadedImage:ContentDisplay = event.target.content;
              TweenMax.to(progressBarPopUp_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});
    loaderProductPopUps.load();
    Is there something which needs to be imported, or specific function needs to be specified in a specific labeled section?

    actually, i think you'll need to use something like:
    var loaderProductPopUps:SWFLoader;
    if ((loaderProductPopUps){
    if(loaderProductPopUps.content)){
       loaderProductPopUps.unload();
    loaderProductPopUps= new SWFLoader(sourceVar_ProductsPopUps, //the value of sourceVar_ProductsPopUps allows to load mulitple SWFs from the products page.
                                                                                                         estimatedBytes:5000 ,
                                                                                                         container:holderMov ieClip,// more convinient and easier to manage if to place the LoaderMax into an empty mc (holderMovieClip)
                                                                                                                                                                         // if not will work as well. Then the line container:holderMovieClip, has to be replaced with container:this,
                                                                                                                                                                         // can be any size, can not be scaled as it distorts the content
                                                                                                         onProgress:progress Handler,
                                                                                                         onComplete:complete Handler,
                                                                                                         centerRegistration: true,
                                                                                                         //x:-260, y:-320, //no need for this is if used: centerRegistration:true,
                                                                                                         alpha:1,
                                                                                                         scaleMode:"none",
                                                                                                         //scaleX:0, scaleY:0,
                                                                                                         //vAlign:"top",
                                                                                                         width:540,
                                                                                                         height:730,//scales proportionally but I need to cut off the edges
                                                                                                         crop:true,
                                                                                                         autoPlay:false
    function progressHandler(event:LoaderEvent):void{
              progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;
    function completeHandler(event:LoaderEvent):void{
              var loadedImage:ContentDisplay = event.target.content;
              //TweenMax.to(loadedImage, 1.5, {alpha:1, scaleX:1, scaleY:1});//only need this line if corresponding values are changed in SWF loader constructor
              TweenMax.to(progressBarPopUp_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});
    loaderProductPopUps.load();

  • Controlling movieclip from main timeline & Child

    Hi,
    This code is currently contained within my "mc_1" movieclip. I want to be able to have this code on my main timeline, however no matter what I try I constantly get errors, multiple different versions. I've tried adding mc_1 infront of everything, but that just gives an output error about a Sprite.
    Also, I'm currently using visible to control whether the back image to the textbox should show - What I'd really like to do is control it using a child, but they're movieclips not buttons, so when I try to addChild within the function it errors saying I'm trying to control a movieclip within a simplebutton function.
    import flash.events.MouseEvent;
    stop();
    mc_textbox.visible = false;
    for(var i:uint=1; i<8; i++){
        this["line"+String(i)].addEventListener(MouseEvent.ROLL_OVER, line_in, false, 0, true);
        this["line"+String(i)].addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    function line_in(e:MouseEvent):void // Defineing the function as line_in
        var lineTarget:SimpleButton = SimpleButton(e.currentTarget); // The variable is lineTarget
        switch(lineTarget) // Each case should swap the lineTarget
            case line1: // line 1 is the first button
            line_output.text = "1"; // This text should display
            mc_textbox.visible = true; // The textbox should display
            break; // If this is not the case, break and check next
            case line2:
            line_output.text = "2";
            mc_textbox.visible = true;
            break;
            case line3:
            line_output.text = "3";
            mc_textbox.visible = true;
            break;
            case line4:
            line_output.text = "4";
            mc_textbox.visible = true;
            break;
    /* This case has much more text than the rest, as such the textbox is enlarged for this case only
    and changed in position. The line_output dynamic text field is also moved on the Y axis for this.
    This is reset to default using the line_out function.
            case line5:
            line_output.text = "55";
            line_output.y = 427.65;
            mc_textbox.visible = true;
            mc_textbox.height = 100;
            mc_textbox.y = 417;
            break;
            case line6:
            line_output.text = "6";
            mc_textbox.visible = true;
            break;
            case line7:
            line_output.text = "7";
            mc_textbox.visible = true;
            break;
            default: // If none of the cases are true, this should display
            line_output.text = ""; // line_output should be blank
            mc_textbox.visible = false; // mc_textbox should be invisible by default
    function line_out(e:MouseEvent):void
            line_output.text = "";
            line_output.y = 474.65;
            mc_textbox.visible = false;
            mc_textbox.height = 61.95;
            mc_textbox.y = 454;

    I've resolved the timeline issue. Now my only issue is the Child not working.
    What I'm trying to do:
    addChild(mc_1.mc_textbox) to appear upon rollover of a button. On rolloff, for the child to be removed.
    Add mc_textbox inside mc_1 on rollover, at a specific XY and height. On rolloff, for the child to be removed.
    I have also been told that I should not have a dynamic textbox on the scene and should call that in using AS3 - If you have time, could you inform me how this would be done?
    Thanks alot for the help,
    ERROR:
    TypeError: Error #2007: Parameter child must be non-null.
        at flash.display::DisplayObjectContainer/addChild()
        at Main_new_fla::MainTimeline/line_in()
    TypeError: Error #2007: Parameter child must be non-null.
        at flash.display::DisplayObjectContainer/removeChild()
        at Main_new_fla::MainTimeline/line_out()
    import flash.events.MouseEvent;
    stop();
    for(var i:uint=1; i<8; i++){
        this.mc_1["line"+String(i)].addEventListener(MouseEvent.ROLL_OVER, line_in, false, 0, true);
        this.mc_1["line"+String(i)].addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    function line_in(e:MouseEvent):void // Defineing the function as line_in
        var lineTarget:SimpleButton = SimpleButton(e.currentTarget); // The variable is lineTarget
        switch(lineTarget) // Each case should swap the lineTarget
            case mc_1.line1: // line 1 is the first button
            mc_1.line_output.text = "1"; // This text should display
            addChild(mc_1.mc_textbox); // The textbox should display
            break; // If this is not the case, break and check next
            case mc_1.line2:
            mc_1.line_output.text = "2";
            addChild(mc_1.mc_textbox);
            break;
            case mc_1.line3:
            mc_1.line_output.text = "3";
            addChild(mc_1.mc_textbox);
            break;
            case mc_1.line4:
            mc_1.line_output.text = "4";
            addChild(mc_1.mc_textbox);
            break;
    /* This case has much more text than the rest, as such the textbox is enlarged for this case only
    and changed in position. The line_output dynamic text field is also moved on the Y axis for this.
    This is reset to default using the line_out function.
            case mc_1.line5:
            mc_1.line_output.text = "55";
            mc_1.line_output.y = 427.65;
            addChild(mc_1.mc_textbox);
            mc_1.mc_textbox.height = 100;
            mc_1.mc_textbox.y = 417;
            break;
            case mc_1.line6:
            mc_1.line_output.text = "6";
            addChild(mc_1.mc_textbox);
            break;
            case mc_1.line7:
            mc_1.line_output.text = "7";
            addChild(mc_1.mc_textbox);
            break;
            default: // If none of the cases are true, this should display
            mc_1.line_output.text = ""; // line_output should be blank
            addChild(mc_1.mc_textbox); // mc_textbox should be invisible by default
    // Removes any text that has been displayed from the Dynamic text box, also resetting the sizes to default.
    function line_out(e:MouseEvent):void
            mc_1.line_output.text = "";
            mc_1.line_output.y = 474.65;
            removeChild(mc_1.mc_textbox)
            mc_1.mc_textbox.height = 61.95;
            mc_1.mc_textbox.y = 454;

  • Load swf from a tree

    Could someone show me how to load swf file from a link on a
    tree node? The tree would come from embeded xml.
    Thanks

    I am getting 1034 Type coercion error. I have Googled it this
    error must have hundreds of links. Is it a bug in Flex 3? Here is
    the code. The problem only occurs when I link to a swf.
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical"
    verticalAlign="middle"
    backgroundColor="white">
    <mx:Script>
    <![CDATA[
    import mx.events.ListEvent;
    import mx.managers.*;
    import mx.flash.*;
    import mx.controls.treeClasses.*;
    private var t:Tree;
    private var dataObj:Object;
    private var suffix:String;
    private function tree_itemClick(evt:ListEvent):void {
    var t:Tree = evt.currentTarget as Tree;
    var dataObj:Object = evt.itemRenderer.data;
    if (dataObj.hasOwnProperty("@src")) {
    swfLoader.source = dataObj.@src;
    } else if (t.dataDescriptor.isBranch(t.selectedItem)) {
    swfLoader.source = null;
    panel.status = "";
    private function tree_labelFunc(item:Object):String {
    var suffix:String = "";
    if (tree.dataDescriptor.isBranch(item)) {
    suffix = " (" + item.children().length() + ")";
    return item.@label + suffix;
    private function swfLoader_complete(evt:Event):void {
    panel.status = (swfLoader.bytesTotal/1024).toFixed(2) +
    'KB';
    ]]>
    </mx:Script>
    <mx:XML id="dp" source="data/dp.xml" />
    <mx:HDividedBox width="100%" height="100%">
    <mx:Panel width="200" height="100%">
    <mx:Tree id="tree"
    dataProvider="{dp}"
    labelFunction="tree_labelFunc"
    showRoot="false"
    width="100%"
    height="100%"
    itemClick="tree_itemClick(event);" />
    </mx:Panel>
    <mx:Panel id="panel"
    width="100%"
    height="100%"
    backgroundColor="white">
    <mx:SWFLoader id="swfLoader"
    scaleContent="true"
    width="100%"
    height="100%"
    complete="swfLoader_complete(event);"/>
    <mx:ControlBar>
    <mx:LinkButton label="{swfLoader.source.toString()}"
    />
    </mx:ControlBar>
    </mx:Panel>
    </mx:HDividedBox>
    </mx:Application>

  • Flash 8 xml rotator.swf and main timeline frame looping

    Hi Y'all -
    I have a purchased swf file that randomly rotates images (90
    or them) located in an external xml file. It works fine in it's own
    swf file.
    The author suggested dragging the movie clip to the library
    and to the stage. I did that in frame one, on its own layer of my
    main swf file, followed by empty keyframes for all other frames in
    the main swf. That works too, only showing the rotating logos in
    frame one.
    However, the stop(); actions on each of the other frames are
    ignored, so that going to frame two on the main timeline starts
    with the proper content and then continues on to the next frame and
    the next. Without the rotator, buttons control the action and I
    have no problem.
    This link shows the problem -
    http://uniconexed.org/bigflash/unicon-05-17-08-newlook.swf
    I've tried attaching the swf file and unloading it, using
    "create empty movie clip" (my current attempt outlined in the
    code), and about a half dozen other ways to no avail.
    I think I need to kill "play movie" when someone leaves frame
    one (or enters any other frame) even though not all of the 90
    images have displayed. It could be some depth issue, or lock root,
    I dunno.
    To restate, one of two things happen -
    1) the scene continues to display the files randomly over top
    of the content in the other frames (wrong) but the navigation
    buttons work (correct)
    or
    2) the random images do not display in the other frames
    (correct) but the navigation stops at each frame do not work
    (wrong) - the swf file scrolls through each of the frames, ignoring
    the stop(); at the top of each frame.
    Any help that leads to success would be greatly appreciated.
    Dan

    Hi there,
    Try using...
    unloadClip(myContent);
    instead of
    unloadMovie(myContent);
    unloadClip is the proper method to use when removing content
    created with the MovieClipLoader class

  • Loading SWF from CS5

    Hi,
    I'm porting a plug-in from CS4 to CS5 which has Flex components to it.  There is no mention of any changes in the Flex portion of the API in the porting guide, but yet it's obviously changed.  To make things worse, the sample flexuistroke is missing all the C++ code.
    I made the obvious change from LoadMovie to LoadSWF and while all function calls succeed, the SWF file never shows up in our panel.
    Can anyone tell me either what's changed or provide an example?
    Thanks

    later some debug, I found this:
    buttons on a container MovieClip react slower than buttons on main timeline (all air versions [desktop, android])
    seems (and sounds, to say the truth) to be correct the running path: [mouse events:]
    OVER -> DOWN [and then] UP -> CLICK
    but,
    OVER -> DOWN [and then] UP -> CLICK with buttons in main timeline is fast enough
    OVER -> DOWN [and then] UP -> CLICK with buttons a MovieCLip is not fast enough to be acceptable
    and, in the case:
    OVER -> DOWN [and then] UP -> CLICK with buttons a MovieCLip is AIR for Android is terribly SLOW (can't use buttons?!?!)
    adobe, have I to open a bug report?
    Massimiliano
    nb AIR 2.5.1 (I ask to myself if previous versions of AIR were free from this bug, or if worldwide developers are used to not to use buttons in movieclips when developing for AIR...)

  • Accessing class var from main timeline

    Hi all! Well I've been working on this for a couple of days
    now and just can't seem to get it to work right...... I'm still
    getting my feet wet with as3 and like it more and more everytime I
    use it.... almost.
    Anyways, here's where I'm running into trouble.
    Here's a dumbed down version of my project with all the other
    usless drivel excluded. Basically what I'm trying to do is declare
    a var and give it a value in my class. Then I want to be able to
    display that value on the stage and use it in the main timeline.
    Seems simple enough....
    I need to be able to pass the var from the class to the main
    timeline for use.... Any help on this would be GREATLY appreciated.
    Thanks.

    kglad, worked like a charm in my short test file... however
    in my real world flash file the class takes a short time to
    actually compute the value of the variable. If I fire the trace
    from the main timeline it will display NaN b/c at the moment it
    fires the value of the var doesn't exist b/c it has yet to be
    calculated......
    I don't really know the best way to delay this... would the
    best way be to somehow add an event listener to listen to the var
    to see when it is assigned a value?.... I'm open to suggestions.
    btw, good catch on the assignment of a string value!!
    Thanks!

  • (AS3) Controlling Loaded SWF

    I am trying to control a loaded .swf with the parent .swf. I
    do not know how to call the loaded .swf. I know how to control the
    parent with the child, but not the other way around. any
    suggestions would be great. thanks!

    call on the Loader object where the movie is being held.
    You'll need to typecast like this....
    MovieClip(Loader.contentLoaderInfo.content). My recommendation is
    to store that path to a variable
    var myLoadedMovie:MovieClip = MovieClip(
    varNameOfMyLoader.contentLoaderInfo.content);
    change out the varNameOfMyLoader with the proper variable
    name and you should be able to target the movieclip as you would
    have done in AS2.

  • Unable to load swf from different domain through html wrapper in Chrom

    Hi All,
           I am trying a embed a swf from different domain. My html wrapper was in one domain and swf was in another domain. I have embedded the swf into the html wrapper. When i run the html file it is loading the swf in firefox and working fine. But when i try to run the same html in chrom or IE the swf is aborted. I have crossdomain.xml file in both the servers which is also allowing both the domains. I was not able to figure out the issue. Can anybody help on this.
    regards,
    Jayagopal.

    Are you getting any errors or warnings?

  • Jumping from Main Timeline to a specific frame of a MovieClip

    Hello there!
    I'm a begginer with Flash... and I am attending a course of fundamentals of Flash... so I apologize if my doubt is a too obvious answer to some of you.
    The situation is as follows:
      I'm using Action Script 2.0 --- I'm obligated to in the course I'm attending.
      I have a main timeline that has 3 frames. On the 2nd frame I have a movieclip named mc_nbr. On the 3rd frame I have a button "voltar" that when pressed I want it to "Go and Stop/Play" at frame 3 of the movieclip (that is embedded on frame 2 of the main timeline).
    I used the folowing code for the button btn_voltar:
    on (press)
        _root.mc_nbr.gotoAndStop("3");
    I tried as well with
    on (press)
       this.mc_nbr.gotoAndStop("3");
    None of them works!
    I tried to see wheather the button even works and it does.
    I included a input text box and the stament before the code shown above  like the one that follows:
    feedback.text = "Pressionei o botão!";
    So the part missing (and the important one) is jumping to the movieclip. I can't figure out how to do it !!!
    I uploaded the "project" at http://www.megaupload.com/?d=A6M581US
    Could anyone, please help me.
    Thank You for your feedback.

    Ron ron,
    Thank you for your help... but either I'm not following You or I'm doing something really wrong.
    I tried what you suggested but it doesn't solve my problem...
    Were we talking about the same button ? (btn_voltar, from the 3rd frame)
    Could you take a look at my file in http://www.megaupload.com/?d=A6M581US   ??

  • How to add button inside move clip and call it from main timeline?

    Hi,
    On the main timeline I  have a movie clip called clock_mc and playBtn
    playBtn is  placed in the center of clock_mc
    When you press playBtn clock_mc starts playing
    playBtn.addEventListener(MouseEvent.CLICK, playClock);
    function playClock(event:MouseEvent):void
        if (event.target == playBtn)
            clock_mc.play();
            playBtn.visible = false;
            trace ("play button was clicked");
    This is working fine for me.
    But I want to add replayBtn to the last frame of clock_mc and set up the function on main Timeline.
    Another words when the clock_mc rich last frame you see replayBtn.
    code example:
    replayBtn.addEventListener(MouseEvent.CLICK, playClock);
        if (event.target == replayBtn)
            clock_mc.play();
            replayBtn.visible = false;
            trace ("replay button was clicked");
    I've tryed to placed the replayBtn on the stage on the main timeline and I've set it up to replayBtn.visible = false;
    And then I add replayBtn.visible = true; to last AS frame of clock_mc but it wont work
    Even when I put the button physically to the last frame of clock_mc it will not work either.
    Please help

    I've solved the problem:-)
    I've set replayBtn.visible = false; on first frame of clock_mc
    and  replayBtn.visible = true; at the last frame
    and than as you sugested I'v add:
    clock_mc.replayBtn.addEventListener(MouseEvent.CLICK, replayClock);
    function replayClock(event:MouseEvent):void
            clock_mc.play();
            trace ("replay button was clicked");
    I couldn't see replayBtn at the firs stage because I have clockTween assosiated with clock:
    clockTween = new Tween(clock_mc, "x", Regular.easeOut, -469,438, .5, true);
    and I had replyBtn in the wrong place so when clock_mc was coming up on the stage replayBtn was on the left side of the stage :/
    Now I have to solve only one thing.
    Maybe you would have any suggestions please.
    I've set up stop(); in a first frame of clock_mc
    that when you see clock_mc sliding in it has to wait for playBtn to be clicked
    because I have two tween:
            clockTween = new Tween(clock_mc, "x", Regular.easeOut, -469,438, .5, true);
            playTween = new Tween(playBtn, "x", Regular.easeOut, -720,514, .5, true);
            playBtn.visible = true;
    so when you click on playBtn:
    function playClock(event:MouseEvent):void
        if (event.target == playBtn)
            clock_mc.play();
            playBtn.visible = false;
            trace ("play button was clicked");
    everythink is working fine except when I clik on replayBtn it play for I sec because there is stop(); on the first frame of clock_mc

  • Controlling loaded SWF inside a child

    Hello to everyone, may this question be too obvious to
    everyone, but I've been googling for hours without any luck.
    Have seen examples but they are not exactly as my scenario...
    Please, I need some help.
    I have loaded a SWF and attached to a MovieClip which exist
    in my current movie using the following code, and now I just want
    to access the loaded SWF to send it orders like play() or
    gotoAndPlay(); I have tried also: container=
    MocieClip(loader.content); instead adding child, but it trhows an
    error

    //this is your minimum code to load a file
    var url:String = "put your url here ";
    var request:URLRequest = new URLRequest(url);
    var loader:Loader = new Loader();
    loader.load(request);
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    loadComplete);
    function loadComplete(event:Event):void {
    addChild(loader.content);
    //you don't need all that code just concentrate on the bit
    you need; when this work then you can start putting the rest

Maybe you are looking for

  • Sheet tab name

    Hi report experts, I have a small problem in Oracle Reports 10.1.2.3.0 and Excel 2007. When I have created a paper layout report and tries to run that rdf-file on my client PC with parameters: * desformat='spreadsheet' * destype=FILE * desname='c:\te

  • Registion completion

    Hi All, I have a question about the completion of the registration. I finished 80%; however  have no clue to finish the rest 20%. Similar questions were asked on the google, seems like I am not alone. Could any one share the experience with me step b

  • How to retrieve the Foreign key information in Oracle

    I want to know how to retrieve the Foreign Key information in Oracle while using SQL Statement? I have use three SQL statement to retrieve such information, but the performance is very bad. The three SQL Statements are: Select constraint_name, r_cons

  • How can I make Adobe Bridge faster?

    I really need to organize my files and goodies I have been collecting these past 10 years.  So I need to use Bridge to easily view .psd and .eps thumbnails.  But Bridge is running SO slow!  It takes a few seconds for every click.  I disabled my cloud

  • Write an algorithm to sort an array of integers

    "Write an algorithm to sort an array of integers" I was asked this at an interview and required to do it in 5 mins. I don't think you can use sort them by putting them in a collection, i think you need to write an algorithm from scartch. Any idea wha