Loading external swf files in a swf - Error#1009

I have been having trouble using a swf file within a swf file.   The external swf files all work as expected.  However when used within another swf file I get the standard TypeError #1009 for some of my swfs.   The external swf files are mainly actionscript 3 files.  A typical swf file will have an object (or objects) in the library which has an export for ActionScipt property enabled and an addEventListener(Event.ENTERFRAME, somefunction).   About four years ago when I had to do some work with AS2 I seemed to get around a similar issue with the _lockroot method but this is no longer part of AS3. I have searched various forums and note that I am not the only one with this issue but did not find any relevant solutions.   If anyone could give me any ideas on how to get around this it would be appreciated.
Regards
Norman

Hi,
I have added a download to rapidshare and its link is:
Download link: http://rapidshare.com/files/380202712/ExtSwfs.zip
The main file Training01.fla has been set up with links to download several swf's.   The links that do not work properly are those labelled :  Module6 and Module 8.   The first Module 6 connects to a function that is a variation of how I was trying to load external swfs using Application Domain, while Module 8 is a link to a swf that uses and external class.  Module 8 is supposed to load with rotating stars, while Module 6 loads the same file as the link called Module 1.   As soon as I use the two links Module 6 or Module 8 the whole lot ceases to work properly.  I did also follow through the examples on the Adobe site.  The examples for Module 6 and Module 8 are tutorials I have used from the Internet as part of my training from the site FlashMyMind.com but they replicate the type of work we have been doing with respect to using ActionScript3.
Re my background, at this stage I am self-taught using tutorials on the web and whatever books I can lay my hands on here.  There is no structured training available where I live as there is insufficient demand and no books available on Flash or ActionScript at the local book stores or libraries so the books are ones I have ordered via the Internet.  The one I am currently using apart from Adobe Classroom in a Book Flash CS4 is O'Reilly's Learning ActionScript 3.0 a Beginners Guide.
The other problem I have been trying to solve and still researching is why one loses sound in the flash player when playing flv files, if the user has selected or restarted a video (or videos) many times eg 25 to 30 times as we create video training files and serve them to the user within the flash environment using Flash Player 9 and IE6.
Regards
Norman

Similar Messages

  • How to load swf files within another SWF and still maintain actionscript

    Hi I was wondering how to embed an swf file inside another
    swf file, If i simply import it to the stage or the library it will
    become a symbol but the actionscript interactivity is lost, another
    question is can I have an actionscript 2 file play within an
    actionscript 3 file?
    The actionscript 2 code for embedding is something like this:
    don't mind the _mc titles
    this.cargame_mc.onRelease = function (){
    loadMovie ("Crusty Rusty's.swf", empty_mc)
    empty_mc._xscale=60;
    empty_mc._yscale=55;
    empty_mc._x=210;
    empty_mc._y=140;
    Please Help its for my uni portfolio, i want to use as2, but
    if i do i would lose the 3d possibility of as3, is there any way to
    export an as3 file and then embed in as2, using a program or
    anything? Thanks!I
    I would just like to say thanks in advance because everyone
    on here is so helpful!

    you can load an as2 file into an as3 file (using the loader
    class) and the actionscript will work in both.

  • How to call a .swf file in another .swf file?

    Hi all,
    I am new to flash and ActionScript3.0. Presently, I am using
    flash CS3 and the code I need is in ActionScript 3.0.
    Suppose, I have a .swf file(viz., file1.swf). Now, i am
    developing one more .swf file(viz., file2.swf), in which I need
    to execute file1.swf when a CLICK event is listened on button
    present in second file(i.e., file2.swf).
    In how many ways, we can get this.
    And, please I need code very urgently.
    Help me.

    You use the Loader class to load external content like swf's
    or images. If
    you click the main entry for Loader Class in the AS3 help,
    there's an
    example of loading an external swf.
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Using Flashvars to load external mp3 files

    I am trying to find a very good step by step tutorial on using "Flashvars" to load external mp3 files, I have been searching on google and the many I have found fall short in some way or another. From what I have been able to gather, I have tried using the code in red (commented out), which works, and modify it to use "Flashvars". The code that works, the mp3 file is hard coded, but my goal is to use "Flashvars" which I am attempting to do in the code following the code in red. I am also including the html code. Any help will be greatly appreciated.
    Thanks,
    David
    var soundReq:URLRequest = new URLRequest("mardi_gras2.mp3");
    var sound:Sound = new Sound();
    sound.load(soundReq);
    sound.addEventListener(Event.COMPLETE, onComplete);
    function onComplete(event:Event):void
        sound.play();
    var soundReq:URLRequest = new URLRequest(root.loaderInfo.parameters.audio);
    var sound:Sound = new Sound();
    sound.load(soundReq);
    sound.addEventListener(Event.COMPLETE, onComplete);
    function onComplete(event:Event):void
        sound.play();
    HTML CODE
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="mySoundvars" align="middle">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="false" />
        <param name="movie" value="mySoundvars.swf" />
       <param name="FlashVars" value="audio=mardi_gras2.mp3" />
        <param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />    <embed src="mySoundvars.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="mySoundvars" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" FlashVars="audio=mardi_gras2.mp3" />

    Ok waterlovinguy,
    I went back to my original code, and I got things to work... I think my whole issue was with the HTML CODE. So I decided to use the "SWFObject generator". I had never used it before, frankly I had never heard of it until I started my searches on "Flashvars".
    Thank you very much for all your assistance, PEACE,
    David
    Final Codes below
    var my_var:String = new String();
    my_var = root.loaderInfo.parameters.myflashvar;
    myText.text = my_var;
    var soundReq:URLRequest = new URLRequest(root.loaderInfo.parameters.audio);
    var sound:Sound = new Sound();
    var soundControl:SoundChannel = new SoundChannel;
    sound.load(soundReq);
    play_btn.addEventListener(MouseEvent.CLICK, playSound);
    stop_btn.addEventListener(MouseEvent.CLICK, stopSound);
    function playSound(event:MouseEvent):void
        SoundMixer.stopAll();
        soundControl = sound.play();
    function stopSound(event:MouseEvent):void
        soundControl.stop();
    HTML Code
                    <!>>
                    <!<![endif]>
                        http://www.adobe.com/go/getflashplayer
                        </a>
                    <!>>
                    </object>
                    <!<![endif]>
                </object

  • Can you load external jpg files

    Is there a way to load external .jpg files on the fly or do
    they have to reside in the swf file?

    Hi Persons,
    macrofireball is correct as always, but I'll just add a
    thought to this thread because I suspect "rfull" isn't actually
    asking what he/she
    appears to be asking.
    No photo can ever be displayed "by itself". That is, image
    files are always "opened" in some sort of vehicle. It might be an
    image editor, or it might be a document like a *.DOC or a *.HTM ...
    but
    something must "contain" the image.
    So you can access a photo at any time you wish by putting it
    on a web page, then linking to the web page (for instance). Is
    something like that what you really had in mind?
    Have a good 'un folks!
    .

  • Making xml playlist to play swf files inside one swf

    Hi,
    I have made an swf file and xml playlist.
    I want to include swf filepaths in xml playlist so i would be able to choose from my the list, which file i want to play.
    My list-component reads data from the xml, but i cannot get the swf files open there.
    I will attach my .fla file so you understand what i'm talking about.
    the .fla:
    http://www.mediafire.com/file/m24dz0gmzwz/Untitled-1.fla
    xml file:
    http://www.mediafire.com/file/gdyzzymy5mn/swfList.xml
    would you guys look at my files? i know i can play .flv files but i want to know how to play swf files inside another swf. The swf files should be loaded to  by the xml list.

    Hi
    we want to give some clarifications
    As per our requirement we need to play same swf file ( about
    5 in number) always.
    These swf files are kept in some folder and during run time
    we need to play these swf files inside our Mac / windows
    application using flash player.
    we don't need to play any swf file, but the same swf files
    we need a api / sdk to implement this
    Any help will be very well appreciated
    Sudesh

  • Error in loading the WSDL file. Check the error log for more details

    Hello,
    I am trying to create a Import Adaptive Webservice Model. I am using the WSDL:
    http://www.abysal.com/soap/AbysalEmail.wsdl
    I am getting the below error when I choose WSDL source as UDDI or file (I am not using any logical destination)
    "Error in loading the WSDL file. Check the error log for more details."
    Where can i see the error log? And what is the solution to fix this?
    I am able to create the model if i save the wsdl locally on my machine and choose Local File System or File as the WSDL source. But at runtime this fails as the application tries to read the WSDL for metadata info and it looks into the application server for this file.
    I also tried creating the old webservice model. And it is able to create the model. But I feel I need to use the new model as this one is deprecated.
    Thanks,
    Sachin

    Hi
    For the logs you can search in this directory
    Goto Window->Show view->Other->PDE Runtim->Error Log
    please try this may it would help you out, try to create a model for you Web Service using Web Service Model (DEPRECATED)
    See this link:
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/ep/integration%2bof%2bweb%2bservices%2b-%2bdifferent%2bscenarios

  • Linking SWF file in another SWF file

    Hi All,
       I need to open  a SWF file by clicking a a button in another SWF file(both SWF files are in the same folder). Can I use URL button(in Xcelsius 2008) for getting this done?

    It is possible to use the URL button to open another SWF file.  The SWF file would need to be hosted with an http address.

  • Load external SWF file into another SWF

    Hello all.
    I've tried loading a .swf file externally into another .swf file on my  local drive, and it works. Now, when I try to Simulate Download, the  preloader in the 2nd file doesn't get played and the images in there  take a while to get displayed.
    I need to load a .swf file from a server into the parent .swf file(I'm  working on using a "thin flash file" for added security for the company I  work for - blank file which loads the content from another file on  their server).
    So far, I have:
    try
        var myLoader:Loader = new Loader();
        addChild(myLoader);
        var url:URLRequest = new URLRequest("newBook.swf");
        myLoader.load(url);
    catch (e:Error)
        trace("ruhroh");
    When I replace the "newBook.swf" with the URL of another .swf, there's just a blank page.
    I'm not too sure how to proceed, and I hope you will be able to help me out. I'd greatly appreciate the help.
    Many thanks,
    -Nazgul

    What happens is...when I set the speed to DSL(32.6kbps), the screen is blank and the preloader doesn't show up. It just goes directly to the Main screen. And then, the pages inside don't get loaded properly.
    This only happens when I try to Simulate Download.
    But that's not really the problem. I need to load a .swf file from a server into another .swf file, and just adding the link to the child .swf isn't working.
    Anyway, thanks for your help
    -Nazgul

  • Load SWF file in main SWF with parameters

    Hello everybody,
    I recently got a new flash Application which is a Photo Gallery.
    This App is made of multiple folders (source files), a FLA file, a SWF with its javascript SWFObject and an Html page which instantiate this App with some parameters (size, config file path, ...).
    It needs an XML file to find all the Photos it displays, to do it I need to configure my application in the HTML Page and give it the "xml_path" :
    var so = new SWFObject("index.swf", "gallery", "249", "249", "10", "#111111");
    so.addVariable("xml_path","load/config.xml"); // this line is adding the path to the xml file make sure that it's name is xml_path
    so.addParam("allowfullscreen","true"); 
    so.write("flashcontent");
    By the way, I have a second application, the WebSite, which have to display the Gallery SWF in its "Gallery" page.
    Here is how I do it at the moment (in ActionScript3) :
    var swfRequest:URLRequest = new URLRequest("C:/......../Galerie/index.swf");
    var swfLoader:Loader = new Loader();
    //Charge le SWF Galerie dans le SWF Site
    swfLoader.load(swfRequest, context);
    container1.addChild(swfLoader);
    //Positionne le SWF
    swfLoader.x=10;
    swfLoader.y=120;
    It successfully loads the Gallery application but It shows an error telling me it doesn't find the XML configuration file... In the HTML file I simply had to write the "so.addVariable("xml_path","load/config.xml");" to tell where the XML file is...
    So, my question is : How can I integrate my SWF application giving it some parameters like above, in Action Script 3?
    Thank you ,
    Patrick

    No, nothing with HTML.
    I have 2 SWF applications. One is the Gallery, and the second is my Main Page.
    My Main Page must integrate the Gallery module in one of its page.
    The problem is when I try to integrate it, I think I must give de future loaded SWF some parameters like this :
    (My Main SWF loading in HTML)
    var so = new SWFObject("WebSite.swf", "flashcontent", "520", "700", "10", "#111111");
    so.addParam("allowfullscreen","true");
    so.addParam("allowScriptAccess","always");
    so.addParam("menu","false");
    so.addParam("wmode","opaque");
    so.addParam("bgcolor","#000000");
    so.setAttribute("id","flash");
    so.write("flashcontent");
    It was for the Main App. For my Gallery SWF I had to load it like this (in HTML) :
    var so = new SWFObject("Gallerie.swf", "gallery", "249", "249", "10", "#111111");
    so.addVariable("xml_path","Galerie/config.xml"); // this line is adding the path to the xml file make sure that it's name is xml_path
    so.addParam("allowfullscreen","true"); 
    so.write("flashcontent");
    So at the beginning I had 2 different projects with an HTML page for each.
    Now I wan't to directly integrate the Gallery SWF into the Main SWF. And as you have seen I must give it some parameters such as the "xml_path" and "allowfullscreen". This must be done in ActionScript 3 and I don't know how...
    I think I have to use FlashVars but I don't know how. As I said before, I have tried using the loaderinfo.parameters, but it is in read-only...
    Do you have an idea of how I can make it work ?

  • Emdedding swf file as class throws error while previewing the component

    Dear all,
    I am using Flex SWFLoader to load an animated swf file and added it as a component in xcelsius by add on manager. When i click preview button it throws the folloing error.
    TypeError: Error #2023: Class must inherit from Sprite to link to the root.
    I am embedding swf file by using the following lines of code
    Embed('Animation_1.swf')
    public var Animation:Class;
    Then i tried to create my class by extending Sprite, i got the same error,
    Can you please anyone help me to solve this issue, all i need is the way to emded the swf file as class and using it in xcelsius. The embedded swf class is working fine alone (that is outside to the xcelsius).
    Thanks & Regards,
    Manimaran.
    Edited by: manimaraninfo on Jun 18, 2009 10:47 AM
    Edited by: manimaraninfo on Jun 18, 2009 10:48 AM

    Hi
    To embed a .swf file in xcelsius using SWFLoader, you have to pass the path of that swf file to the source property of SWFLoader.
    By using class concept xcelsius does not get the path of the swf file you have embeded.
    In flex It gets that file because that swf file is present in the same directory as your application.
    Hope this helps
    Regards
    Rush-me

  • How can I control a button from one swf file to another swf file?

    Hi,
    I have a main.swf file. From that file I am accessing the external.swf file which is an external file.
    Now, how can I write code on my main.swf file for the button which is on my external.swf file?
    Activities.MainPanel.close_btn.addEventListener(MouseEvent.CLICK, btnClickClose);
    Activities.MainPanel.close_btn (This buttons is actually on external.swf file, but I want to write code on main.swf file to execute it on external.swf) how can I control one swf button on other swf file?
    Thanks.

    Here's some example code that you should be able to adapt to your needs.
    // create a new loader object instance...
    var loader:Loader = new Loader();
    // make the download request...
    var request:URLRequest = new URLRequest("external.swf");
    // add a complete event listener to the loader
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
    // start the actual loading process...
    loader.load(request);
    // create a new empty movieClip instance, you will put the loaded movie into this movieClip once its loaded
    var externalMovie:MovieClip;
    // this function is called when the download has finished and the file is ready to use...
    function completeHandler(event:Event):void {
       // set the contents of the loaded movie to the new empty movieClip...
               externalMovie = MovieClip(event.target.content);
       // add this new movie to the display list...
       addChild(externalMovie);
    Now you can refer to the loaded movie with the instance name "externalMovie". So if, for instance, you want to address a button in the loaded movie, you could write something like this on the main timeline:
    externalMovie.addEventListener(MouseEvent.CLICK, btnClickClose);
    function btnClickClose(event:MouseEvent):void {

  • Trouble with loading external mp3 files

    I apologize for the length of the post. I hope this is clear
    of what I am trying to explain.
    My problem deals with getting "undefined" when I press a
    button to load an external mp3 files. The following is what my XML
    childNode looks like:
    <option phonetic="Soundless, or A" name="aleph"
    cursive="alephCursive.swf" block="alephBlock.swf"
    audio="char1.mp3"/>
    Every attribute loads the way I've programmed them, except
    for the last one "audio".
    The following is what my actionscript looks like loading in
    these attributes:
    Everything is happening inside the onLoad event for my XML
    file.
    var xmlContent = this.firstChild.firstChild;
    audioContent = new Array();
    for (var i = 0;
    i<this.firstChild.firstChild.childNodes.length; i++) {
    nextEntry = xmlContent.childNodes
    audioContent = [nextEntry.attributes.phonetic,
    nextEntry.attributes.name, nextEntry.attributes.cursive,
    extEntry.attributes.block, nextEntry.attributes.audio];
    The code above simply adds each attribute to the audioContent
    array. Each element traces out correctly.
    The following code is how I am using these attributes:
    for (var i = 0; i<audioLength; i++) {
    audioContainer.attachMovie("container4", "audioItem"+i, i);
    // Create a shortcut reference to the present movie clip
    thisClip = audioContainer["audioItem"+i];
    thisClip.myTxt1.htmlText = audioContent[0];
    thisClip.myTxt2.htmlText = audioContent
    [1];
    thisClip.cursive_mc =
    loadThis(assetPath+audioContent[2], thisClip.cursive_mc);
    thisClip.block_mc = loadThis(assetPath+audioContent
    [3], thisClip.block_mc);
    thisClip.speaker_mc.attachMovie("speaker", "speaker_mc",
    this.getNextHighestDepth());
    thisClip.speaker_mc.speaker_mc.onRollOver = function() {
    this.nextFrame();
    thisClip.speaker_mc.speaker_mc.onRollOut = function() {
    this.prevFrame();
    thisClip.speaker_mc.speaker_mc.onRelease = function() {
    mySnd.loadSound(audioPath+audioContent[4],true);
    Loading the text works inside the htmlText. Using a function
    loadThis to load external swf files works corerctly and even
    attaching a linked movieclip from my library called "speaker" works
    correctly.
    The problem comes from pressing the speaker movieclip that
    the output traces "undefined" instead of the external mp3 file.
    I appreciate any help. Thanks.

    As Ned said the problem might be with the file structure on the server. Other problems may be with spelling. You computer may not be case sensitive to the names of the .swf files that you are loading, but your server might. So, on your computer when you are testing, second.swf is the same as Second.swf, or even second.SWF. But, on the server each of these variations is seen as a different file. Another problem is that when you are loading files from the same computer in testing, those files are close and so they load very quickly from your computer. When the files have to travel from the server, there will likely be a measurable period of time before the file is ready to be shown. This is particularly problematic with video that is embedded into an .swf. The whole file will need to be downloaded and uncompressed before it is available to play. If you stream the video as an external file, you can shorten the wait considerably.

  • Joining several swf files into one swf file

    hello everybody
    i've been dealing this issue for too long and decided to ask for  help - how can I unite 15 swf files which placed in one folder to a one swf file???
    i tried all kindes of merging softwares like "Join (Merge, Combine) Multiple SWF Files Into One Software" and "WinMerge" without success and tried to convert swf to flv (cause i found other merging software for flv files) but again...
    I have CS5 so if i'll have to open Flash for this i will, though i'm trying to avoid that and even then i'm gonna need full instructions.
    All i need is this simple thing so i'll appreciate very much any help
    Thanks & Good Day
    Keren

    Hi Ned
    Again - thank you very much.
    I've got the source files and i'm on the run now.. kind of..
    I did as you recomצended and used a code from one of the AS3 UILoader tutorials , and it seems to work:
    import flash.net.URLRequest;
    import flash.events.ProgressEvent;
    import fl.containers.UILoader;
    var myLoad1 = "fastflipPage.swf";
    var request:URLRequest = new URLRequest(myLoad1);
    loader.scaleContent = false;
    loader.addEventListener(Event.COMPLETE, completeHandler);
    loader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    loader.load(request);
    loader.load(request);
    function progressHandler (event:ProgressEvent):void
    status_txt.text = "Percentage Loaded" +
    Math.round(event.target.percentLoaded);
    function completeHandler (event:Event):void
    status_txt.text = "Loaded Done";
    So... i'm tring to find some answers to my next step : in the code above im loading only one file and i need to load 30 files so they could play one after another. i noticed that i can create many uiloader instances and load several external SWFs in the same scene without writing a script to each one of them... is that right? and if so, how can i do that???
    I'm full of hope to figure this task, meantime will look for more answers
    Thanks in advance
    Keren

  • I need to access/pass variables'(s) of a .swf file into another .swf file.

    Hi all,
    I have basic knowledge of Flash and AS3.0.
    Suppose i have a flash swf file(main.swf). In this main.swf
    file, i loaded another swf file(sub.swf) by writing the following
    code snippet in main.swf file as shown in Attach Code:
    Now, how to acess the data present in main.swf into sub.swf.
    Note: Here data represents values/data stored in
    variables/objects of main.swf file.

    Does this actually work -- assigning variables directly on the loader?  I'm interested in setting flash variables on the loaded SWF, but I get a compilation error when trying something similar:
    Error: Access of possibly undefined property x through a reference with static type flash.display:Loader.
         [exec]
         [exec]             textLdr.x = 50;
    I also tried casting the loader to Object, which compiles but then fails at runtime.
    -Dave

Maybe you are looking for