To access the elements of the scene, via a SWF file that is loaded inside the scene

-J' I A.fla.

-A.fla includes buttons, video clips and also B.swf is loaded in A.fla with a CHARGER

-I want to access the elements in A.fla, from codes actionscript inside B.fla to change these video clips and buttons based on the actions going on in B.swf

for example, lets say there is an X button in A.fla and there is a button there B.fla, B.swf is loaded into A.fla, and I want the key Y to delete X when you click the button.

General question: to access the elements in a stage, via a file SWF loaded in this stage.

This is a way silly to explain: there is this pregnant mom, a child is loaded inside him, now, I want the codes inside the child, access to MOM

elements, such as lets say, I want the code of the child can make the eyes of MOM flashing faster. logically there is something inside something else, but I want to have access to the bigger picture of what is loaded. I hope I can get my point across.

I repeat what I replied to your other psoting for this same question and adding just a little bit more...

If you load a swf into another using the Loader class, then the charger itself is the parent of the loaded swf file, so MovieClip (parent.parent) could help you target the timeline that the charger was born.

The way to have a loaded file to speak to a parent file is through the sending of events that the parent assigns headphones for after the file has been loaded.  Here is a link to an announcement that could help explain how to implement this.

http://forums.Adobe.com/thread/470135?tstart=120

And here's a quick example...

Example:

Add something to raise the event in the child:

dispatchEvent (new Event ("eventTriggered"));

In your SWF to loading/parent, listen for the complete event on the Loader.contentLoaderInfo.  In the complete event handler, add a listener for the event on the loaded swf file.

triggered when external swf loading event handler
function loaderCompleteHandler(event:Event) {}
(event.currentTarget.content as MovieClip) .addEventListener ("eventTriggered", eventHandler);
}

function eventHandler(event:Event):void {}
trace ("event sent in loaded swf");
}

So in your A.swf, you should have the other event and functions of event handler that would take care of control buttons.   Event listeners could be assigned to the B.swf after that that it has loaded.  In your B.swf you just have it dispatches an event and the A.swf manage self adjustments you need taken care of.  This allows the two files to be independent of each other on a functional level.

Regarding the buttons that you want to disable, you can either use the removeEventListener() method to remove the listeners you have assigned, or you can set the mouseEnabled property to false, or you can set the visible property to false.

Tags: Adobe Animate

Similar Questions

  • SWF file that points to the FLV file will not play

    Hello

    I think there must be something on the side configuration server that prevents this...

    You have an idea why this phenomenon happens? I have these two files identical cfm that point
    in a swf flash on the site # 1 and # 2. The Flash animation plays in DreamWeaver.
    He played locally on the server to test my pc and he plays on the #2 website but not on the #1 site.

    Any recreated again, check paths even launch SWFs before downloading them and everything worked.
    Once they are on the production server, the swf file does not load the file *.flv external Flash. I checked the permissions of
    files and directory via a DosBox and all look good. Oh and I have the latest version of Flash installed plugin.

    I'm puzzled!

    Thanks Nickels55. Who did the trick.

    Thanks for the feedback-Adobe Community Expert dan mode.

    Dan

  • Difficulties to use the swf file that is hard-coded to display flv files

    Hello

    I created a swf player using the flvplayback component to display flv files. The document in flash is 275 pixels wide by pixels long 130px. I also have my video component (flyPlayBack) set to 275px by 100px to display the playback controls. My flash code this is my simple as follows:

    Fl.video import. *;

    var myflashvars:Object = new Object();

    myflashvars = this.loaderInfo.parameters;

    var fullVideoPath:String = "";

    (point var: string in myflashvars)

    {

    If (point == "filename")

    {

    fullVideoPath is myflashvars [point];.

    }

    }

    videoPlayer.source = fullVideoPath;

    So, using the above it should play the video and made.

    (1) the first question is that I tried to play 2 different videos in my html code.

    < object classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase =' http://download.Macromedia.com/pub/Shockwave/cabs/Flash/Swflash.cab#version=10, 0,0,0 'width = ' 275' height = "130" >
    < param name = "allowFullScreen" value = "true" / >
    < param name = "movie" value = "moviePlayer.swf" / > "
    < param name = 'wmode' value = 'window' / >
    < param name = "scale" value = 'showall' / >
    < param name = "of the flashvars value ='filename = sample_sorenson2.flv" / >
    < embed width = '275 "height ="130"allowFullScreen ="true"type = ' application/x-shockwave-flash' src =' moviePlayer.swf"pluginspage =" http://www.Macromedia.com/go/getflashplayer 'wmode = "window" scale = "showall" flashvars =' filename = sample_sorenson2.flv "/ > "
    < / object >

    Just like above works fine. But I tried to play 2 different videos, the first video image is less than

    image1.JPG

    The second video is less than

    image2.JPG

    I noticed the video formats are different, but not the size of the video player, is - do a thing called elongation? Is it possible to change this by using my simple actionscript code above?

    (2) I also tried the button full screen, but the video takes a part of the screen, as shown below. Sorry for the size of the image.

    image3.JPG

    It is a common occurrence, is it possible to access the buttons of the flyplayback instance using actionscript and overridding the behavior? Any advice on my situation would be very much appreciated. Thank you.

    For me the first two screen captures look like you set bad size l / h/screen. I don't see any scaling of the player at all... only the black bars on the sides because the video did not fill the video player display together.

    And Yes, there are way to display Flash video NetStream, much more powerful and versatile called. You can design your own player and better control the display. I always use NetStream rather than the FLVPlayback instance.

    But if you're having sizing issues presented during the creation of the video... then the drive itself will not necessarily fix it. You need to know the correct display size and the report l / h for each video that you want to display.

    However, you can adjust slightly the size of the screen for each video using some actionscript... as you see here:

    http://www.cataractvideo.com/CV/physicians/cataract_surgery.html

    an example of a larger version (high brandwidth) and a smaller (low bandwidth) version... According to the button you click.

    More about NetStream:

    http://help.Adobe.com/en_US/FlashPlatform/reference/ActionScript/3/Flash/NET/NetStream.htm l

    Here's a good tutorial on building your own video player NetStream:

    http://gotoandlearn.com/

    Scroll all the way down the page "Video Basics.

    Good luck!

    Adninjastrator

  • I can't get a SWF file that works perfectly in browsers runs in the environment Business Catalyst

    My site contains 3 parts. First HTML page which, when opened, plays a video. The link below gives you that.

    http://wrysmilebooks. BusinessCatalyst.com (it takes a few seconds to go)

    When the video ends a SWF file times. The code below should show you what's supposed to happen.

    http://wrysmilebooks. businesscatalyst.com/SWFbutton.html

    The difficulty is that the SWF file will not automatically play from the website within the Business Catalyst. Everything works perfectly when I run the Web page in different browsers with Dreamweaver. Also, if I just double-click the file in the Web site where he is sitting on my computer... the resident browser picks it up and everything.

    I already exchanged a few e-mails with catalyst of enterprise support and the support of InDesign... (The SWF file has been created using InDesign)... .but we do not seem to be getting anywhere. I see by the way go... so... here I am.

    Thank you

    Michael McLaughlin

    Hello

    All references to start with a slash:

    Have you just put all the files in the root?

    URL('Lbrite_15.EOT?#iefix')

    If so ok, (ideally should be in folders for organizing) but all the files in British Colombia must begin with a slash (/) to say BC to read from the root folder.

    Secondly, you have this:

    {window.location = "file:///SWFButton.html"}

    This is defined as if it were running on your local computer, which is not the case on the web.

    If the html file is again in the roo the window.location would...

    "/ SWFButton.html".

  • How can I stop the loading of a swf file that is still ongoing.

    I have three buttons on the stage (btn1, btn2, btn3)

    When I click on the first button swf starts loading

    While the swf file loads if I press the 2nd key

    the first swf won't stop loading and the two rulers begin to play

    But if the first swf is fully charged then everything workes very well.

    so please let me how can know I stop the loading of a file that is still ongoing.

    var _contentSWF:ContentSWF

    var _content

    Btn1.addEventListener (MouseEvent.CLICK, handleClick)

    btn2.addEventListener (MouseEvent.CLICK, handleClick)

    btn3.addEventListener (MouseEvent.CLICK, handleClick)

    function handleClick() {}

    {if(_content!=undefined)}

    _contentSWF.removeContent)

    removeChild (_contentSWF);

    _contentSWF = null;

    }

    _contentSWF = new ContentSWF()

    _content = addChild (contentSWF);

    _contentSWF.init (from path.swf)

    }

    ContentSWF.as

    private var _path:String

    private var swfLoader:Loader

    private var _content

    SerializableAttribute public class ContentSWF extends Sprite {}

    public void init (path) {}

    {if(_content!=null)}

    _content. Content.RemoveEventListener (Event.COMPLETE, completeHandler)

    _content.removeChild (myMc)

    _content = null

    }

    swfLoader = new Loader();

    _path = path

    swfLoader.load (new URLRequest (path));

    swfLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, swfLoaded);

    }

    public void removeContent() {}

    swfLoader.contentLoaderInfo.removeEventListener (Event.COMPLETE, swfLoaded);

    swfLoader.unloadAndStop)

    }

    private void swfLoaded(e:Event) {}

    _content = addChild (mymc)

    }

    }

    Use your charger's close() method.  but don't try and apply only if nothing is currently responsible or, I think, you will trigger an error.

  • SWF files that can evolve with the browser

    I downloaded a file with dreamweaver as a stand-alone window swf and it works fine.  How can I get the SWF to a scale large or small that the user must adapt to their browser window, large and small?  I would get the swf file as well as the browser window.  I posted this in dreamweaver, but I was told that it is a problem of action script.

    I found a simple solution, and I think that's what you're looking for.

    1. in Flash, go to file > publishing settings

    2. click on the HTML tab

    3. where is says Dimensions, select percentage

    4. Although it is probably by default, make sure that the width and height are both set to 100.

    5. click OK, then go to file > publish

    Now your film must evolve with the browser window.

    If you do not have Flash, you can simple work with this sample code below:


       
       
       
       
       
       
    align = "middle" allowScriptAccess = "sameDomain" allowFullScreen = "false" type = "application/x-shockwave-flash".
    pluginspage ="http://www.macromedia.com/go/getflashplayer" / > "

    Notice how the width and height are set to "100%"? That's all you need.

  • How can I keep someone to access my data when they run a local SWF file system file

    I tried to look at cross area, but that seems to work only when a person runs from a network sandbox.

    If someone is running in a local with sandbox network, how can I keep their access to the data on my server. I want it accessible only by the swf file when it is run from my site?

    This might work.  I don't know a lot about technologies server side, but I thought that the HTTP request header has the applicant field so that your server cannot be denied, it is on this basis.  The local sandbox do crossdomain check but I think that your server which can detect in the header.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • Windows Explorer crashes and restarts when you access an element of Panel of others on a computer that is running Windows 7 or Windows Server 2008 R2

    It's my pc problem, what do I do to fix it?

    It says that I have to choose the right fix or otherwise it will be haarm my system, I just need a step by step help and how to choose the right fix for my problem, thank you!... Wait ill the resp0nse, thanks again...

    Hello

    go to this site:

    http://support.Microsoft.com/kb/978433

    and click on "downloads of patch view and application of ', select the platform (x 86 or x 64), and type your e-mail twice and type in the captcha announcement click request hotfix ."

    After 1 minute, you have an email with the link to download an exe file. Use the password is contained in the email to retrieve the update.

    Install the update and restart, now the problem is solved.

    Best regards
    André

    "A programmer is just a tool that converts the caffeine in code" Deputy CLIP - http://www.winvistaside.de/

  • How the get function is available or not on the loaded swf file

    I have 100 swf file in one of my projects. And there is a common feature in some of the SWFs. All these files are loadded in the file main.swf. Here's my Question, "If have the common function is the swf file that is loaded, int how to trigger this funciton of the main.swf.

    Quite simply,.

                if(movieclip.test){
                    movieclip.test();
                }
    

    ('movieclip' is the loaded SWF file and "test()" is the function)

  • referencing the main timeline from a loaded swf file

    I just poked around google as both of these forums, but the only answer I see that was a success, is kglad, and for some reason that its messages are not, I just see ":" and then the guy say thank you! Not uber useful.

    In any case, I'm just trying to understand how to reference an image tag on my main timeline to a swf loaded (through my imageLoader). Does anyone have a link or can tell me what I should look for in? dispatchers of the event?

    to reference the main timeline of the SWF loading from the main timeline of the swf file that is loaded, use:

    MovieClip (this.parent.parent)

  • How to access the functions on my main SWF of my external SWF?

    Hello someone can help me how to access the functions on my main SWF file of a loaded SWF file?

    Forget using parent. Send an event to the place.

    btn3.addEventListener(MouseEvent.CLICK, btnClickHandler);
    function btnClickHandler(e:MouseEvent):void {
         dispatchEvent(new Event("categoryClick");
    }
    

    In your main swf file, listen for the complete event on the Loader.contentLoaderInfo.

    In the complete event handler, add an event listener for the categoryClick (or you have chosen to call it) on the loaded swf file.

    // event handler triggered when external swf is loaded
    function loaderCompleteHandler(event:Event) {
        (event.currentTarget.content as MovieClip).addEventListener("categoryClick", categoryClickHandler);
    }
    
    function categoryClickHandler(event:Event):void {
        trace("category button clicked in loaded swf");
    }
    

    And remember, whenever you use root or parent, God kills a kitten.

  • SWF in a Swf file marking the question

    I created a flash (my project) file that is loaded into another swf (our player) file on our site. When I test the project file on my computer displays correct score at the end of the lab. When it is loaded in our flash player on the site does not display the score. I'm a loser for why this is happening. If someone could give me advice, I would be very grateful.

    Declare the variable

    var numOfCorrect:int = 0;

    Whenever someone click on the correct selection it add the value 1 to the score

    function correct(e:__MouseEvent_):void {}

    numOfCorrect ++;

    }

    I have a text box with name yourScore

    yourScore. text = numOfCorrect + ' out of 5 ";"

    It is very basic code so I have no idea of what does not work. My only guess is there is some kind of conflict, once it is loaded in an external swf. What I would do in this case? Thank you.

    Since you have problems with more than one file with this player, there is something about to place the file in another changing the environment that it is in operation.  Just as one example, if you happen to use references of the scene in your code, which could be a source of the proiblem when you load the file in another file, since there is only a single scene... one defined in the player file

  • Determine the Total number of images in a loaded SWF file

    I used the loader class and the load method to load a swf file that has multiple frames.  Does anyone have a suggestion how to determine the total number of frames in the SWF file script after loading?

    AFTER loading is complete (that is to say, use a listener), you can access the content property of the loader (cast as a movielcip):

    MovieClip (yourloader.content) .totalFrames;

  • How to unload the external .swf file when pass the other section?

    Hello

    The following code provided by Mr. kglad works very well to load an external .swf file on stage. Now, when I click on Contact (button), the file external .swf to disappear completely. How to encode on contact (button) to get by.

    Gallery.addEventListener (MouseEvent.CLICK, GalleryClick);

    function GalleryClick(e:Event):void {}

    If (currentClip! = Gallery_mc) {}

    currentClip.visible = false;

    Gallery_mc. Visible = true;

    currentClip = Gallery_mc ;}

    var loader: Loader = new Loader();

    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, ClipLoaded);

    Loader.Load (new URLRequest ("Gallery.swf"));

    function ClipLoaded(e:Event):void {}

    Gallery_mc. AddChild (Loader);

    Loader.x = 0;

    Loader.y = 120;

    Loader.Width = 1000;

    Loader.Height = 700

    }}

    I tried the following code for Contact_btn unload the Gallery.swf file that launches an error message: 1120: access of undefined property loader.

    Contact.addEventListener (MouseEvent.CLICK, ContactClick);

    function ContactClick(e:Event):void {}

    If (currentClip! = Cotnact_mc) {}

    currentClip.visible = false;

    Cotnact_mc. Visible = true;

    currentClip = Cotnact_mc;

    Gallery_mc.removeChild (loader);}}

    unloadAndStop() is supported by flash player 10 or higher (fp 10 +).

    p.s. Please check the useful/correct, if there is.

  • How to call the SWF in another swf file using xml

    HII,

    I am facing a problem to call a SWF via xml when the loaded xml file it asks another swf file that includes a new xml file. now, if I call this nested swf calling without xml it works but in case of xml, it does not show the result. I confused Mr. how to nested xml file call done in as2/as3. I need some logic. Thanks in advance

    This is the forum of AS3 and your assignment involves AS2 code.  You should repost in the AS2 forum...

    http://forums.Adobe.com/community/Flash/flash_actionscript

    Aside from that, your problem may lie in the following lines...

    _root.createEmptyMovieClip ("sub_container1", 1);
    loadMovie (. attributes.url sub_SWFPath [1], "sub_container1");

    You create the new movieclip, sub_container1, in the _root, but you do not assign the loadMovie to load in the same movieclip (unless you have a _lockroot = true in your sub - swf).  In all cases, you should repost in the AS2 forum to continue troubleshooting.

Maybe you are looking for