External swf question...

Hey all
I found this code for loading external swfs and playing them in succession.
It works when I use the external swfs that come with the code, but not when I try to use any other external swfs.
I can't figure out why - does anything seem obvious (the clip swfs are here http://www.flashandmath.com/intermediate/externalclips/clip0.swf http://www.flashandmath.com/intermediate/externalclips/clip1.swf http://www.flashandmath.com/intermediate/externalclips/clip2.swf ):
// Array of external clips to use. Variable index refers to next clip to be displayed.
var clips:Array = ["clip0.swf", "clip1.swf", "clip2.swf"];
var index:int = 0;
// Stuff to load swf files
var thisLoader:Loader = new Loader();
thisLoader.contentLoaderInfo.addEventListener(Event.INIT, doneLoading);
//loader.contentLoaderInfo.addEventListener(Event.COMPLETE, dataOnLoad);
var thisMC:MovieClip = new MovieClip();
stage.addChild(thisMC);            // Add empty MC initially so the nextClip function can be generic
// Removes old MC and gets the next one, waiting until when it has initialized beore adding it to the stage
function nextClip():void {
    thisLoader.load(new URLRequest(clips[index]));
// Tell AS that the loaded file is a movie clip and add it to the stage.
function doneLoading(e:Event):void {
stage.removeChild(thisMC);
thisMC = MovieClip(thisLoader.content);
thisLoader.unload();
thisMC.addEventListener(Event.ENTER_FRAME, runOnce);
stage.addChild(thisMC);
thisMC.gotoAndPlay(1);
// When thisMC has finished, play the next clip.
function runOnce(e:Event):void {
if (thisMC.currentFrame == thisMC.totalFrames) {
thisMC.removeEventListener(Event.ENTER_FRAME, runOnce);
index = (index + 1)%(clips.length);
nextClip();
// Call the nextClip function initially to get the ball rolling
nextClip();
Thanks for taking a look guys.
Shaun

One of the swfs returns:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::AVM1Movie@26f9b3a1 to flash.display.MovieClip.
    at alt2_fla::MainTimeline/doneLoading()
(I'm pretty sure it's an AS3 swf)
The other, which I had just built using AS3, returns:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at fl.rsl::RSLPreloader/loadContent()
    at _001_fla::MainTimeline__Preloader__/frame2()
Error: Error #2099: The loading object is not sufficiently loaded to provide this information.
    at flash.display::LoaderInfo/get width()
    at loader_animation_fla::MainTimeline/frame1()
Error: Error #2099: The loading object is not sufficiently loaded to provide this information.
    at flash.display::LoaderInfo/get width()
    at loader_animation_fla::MainTimeline/frame1()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at fl.rsl::RSLPreloader/loadContent()
    at _001_fla::MainTimeline__Preloader__/frame2()

Similar Messages

  • Question about load external SWF

    Hi people!
    I've been trying to load an external SWF into my app. I need
    to load a Fusion Chart's Gantt Chart, but I didn't achieve.
    Fusion Charts are embed using the attached JavaScript code.
    How can I load this SWF into my app? Should I use ExternalInterface
    to do it?

    You would need to use SWFLoader, Image or Loader to load your
    swf into Flex. To interact with it, you would most likely need to
    use SWFLoader/Loader so you could make calls into the SWF. This is
    somewhat of an advanced topic and a common question, so you should
    be able to find more complete answers if you search the forums for
    these.

  • What is or isn't possible on iOS?  (Not having Loader, loadBytes(), external swfs, etc)

    My basic question is:  "What are the classes which we should not use for iOS using the packager."
    I have been trying for a few days trying to get a simple Flash app to run on the iPad.  A very simple app (with sound!) with just 2 classes works fine (Performance is a whole other issue.  We will get to that).  But if I try anything else, all I get is a white/black screen on the iPad.  So it would be really nice to know what classes, functions, etc we CANNOT use for the Packager.
    I have fairly simple app (not as simple as 2 classes) which loads some art assets via URLRequest/Loader, puts them on the stage.  Fairly common standard practice in AS3.
    I've read about not able to load an external file using the Packager.  So to fix the situation of loading assets, I have looked into the [embed] tag, which seems to work.  I hope the blogger doesn't mind, but this page is an excellent source on what works and doesn't work with the [embed] tag in it's various flavors:  http://www.richardleggett.co.uk/blog/index.php/2010/03/08/flash_builder_and_flash_pro_asse t_workflows.  For example, AS3 in a swf is stripped out from an external swf using [embed].
    The best way to load an external swf file for iOS seems to be using [embed] with "application/octet-stream" and load the swf through ByteArray (Option #4 in the link above).  This works great on the PC.  HOWEVER, on iPad, it fails.  The [embed] tag works on the iPad with the other ways, so my guess is that loadBytes() does not work.  Is this true Adobe/Flash guys?  Can you confirm this?
    My initial question is "why is this not allowed on iOS?".  If it is because of the fact that it uses a Loader, can it be changed so it's not using a Loader to construct a MovieClip?  I have a ByteArray with the raw swf/MovieClip data.  Why can't I construct a MovieClip from it without going through Loader?
    This loadBytes() failure seems to be the only thing preventing me from using the normal pipeline of Flash development in loading external assets.  If there are other ways people have found, please share!
    Now on to performance.  Adobe, can you post some examples/samples of code which runs at decent performance?  Like a "tech demo" of what is possible using the Packager running on iPad/iPhone.  That would be extremely helpful for everyone.  I have done a lot of the optimizing suggestions on various sites and pages ( and by Adobe http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html), but I am not seeing the 30 fps performance that is MORE than possible on iPhone/iPad.  Displaying and moving around Bitmaps (I don't use any vector graphics) should be blazing fast.  Quake runs on iPad without any problems and that code is 10 years old.  Moore's law dictates that drawing Bitmaps using CPU should be faster than a 3D engine written 10 years ago...  I am trying out the new iOS 4.2 which is supposed to be "significantly" better, but I am still stuck on loadBytes().
    So at this point, I am blocked on loadBytes() and my performance for a simple app which draws a few Bitmaps and MovieClips is terrible.  I am hopeful some people out there have figured out some solution (there are lots of clever people out there) and I will stumble on to something.  But being forced to go native Objective-C seems to be my only option at this point.
    In summary, here are the questions I would like to ask the Adobe/Flash group for some more help/information/advise:
    - Why is Loader not allowed on iOS?  Is it a technical limitation of the hardware/os/Flash?  Will it never be supported?  What is the future of this class on iOS?
    - Why is loadBytes() not allowed on iOS?  I have the raw embedded data in memory.  I don't need to make a remote call so security should not be an issue.  Can I create a MovieClip without using Loader?
    - Why is AS3 stripped from the timeline when a Symbol is retrieved using [embed]?  Maybe this is the same reason loadBytes() fails, but if I could use [embed] and get a copy of the Symbol, that is what I need.  (There are issues with the mx.core.MovieClipLoaderAsset/Asset, but it is better than being blocked by loadBytes())
    - What are some apps you guys have written that we can use to compare PC vs iOS?  Again, a "tech demo" or sample code of what you as experts in Packager for iOS have done which runs at decent framerate (30+fps) would be of tremendous help.  If the Adobe/Flash group hasn't gotten the current Packager for iOS to handle more than 50+ 2D Bitmaps on screen running at 30+fps, that would be good to know.  Please let us know what the experts and owners of your software are capable of getting the most throughput using the Packager.  I'd hate to sound a bit fed up/angry, but I think you are wasting a lot of people's time and energy with a piece of software that, to me, seems like it was a bit early to release.  Flash can do some great things.  If it can do it on iOS, even better.  But PROVE it to us that it's possible, before having your customers run into barriers imposed on us by trial and error.
    Thanks.

    I have hardly ever seen a post here from someone at Adobe, so you may need to be patient.
    Read this article, and get its associated demo files, to see some good performing tech demos:
    http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html
    Back to your main point, loaders are working, what isn't working for you is accessing of things in the library of a successfully loaded swf, that have been set to Export for ActionScript. That means that the swf you have loaded has an ActionScript Class, to represent the library symbol. iOS Flash apps are native ARM code, and don't include the virtual machines that a browser plugin has, and so it's not able to interpret ActionScript. That may be why it would fail.
    Now, I can think of at least a couple of reasons why you might want to have external swfs with elements that you want to reuse in the main swf. One would be if you're intending to make a lot of them, like say if you wanted to have an Asteroids game and the ability to use artwork from a set of different swfs. Another reason might be if you want to skin your interface, by taking specific elements from the loaded swf and using them in the main swf. That way you could have artists preparing those swfs for you, and you just include them in your package, and load the one you want.
    There is a way to do either of those things. The second one can be done by having the item as a named symbol on the stage of the loaded swf. With a to-be-loaded swf named "inner.swf", that has a movieclip on its stage named "mc1", this script in the main swf would load that external swf and use its symbol on the main swf's stage, without having to make the inner swf's symbol use ActionScript:
    var req:URLRequest = new URLRequest("inner.swf");
    var ldr:Loader = new Loader();
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,loaded);
    ldr.load(req);
    function loaded(e:Event) {
    var mc:MovieClip = e.target.content as MovieClip;
    var innermc:* = mc.mc1;
    innermc.x = 50;
    innermc.y = 50;
    addChild(innermc);
    For the other case, you can take the item off the stage of the loaded swf and draw it into a bitmapdata, and then make as many bitmaps from that as you like. Here's the above example, only it adds the original movieclip to the main swf stage, and also creates a bitmap that looks the same:
    var req:URLRequest = new URLRequest("inner.swf");
    var ldr:Loader = new Loader();
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,loaded);
    ldr.load(req);
    function loaded(e:Event) {
    var mc:MovieClip = e.target.content as MovieClip;
    var innermc:* = mc.mc1;
    innermc.x = 50;
    innermc.y = 50;
    addChild(innermc);
    var bmd:BitmapData = new BitmapData(innermc.width,innermc.height);
    bmd.draw(innermc);
    var bm:Bitmap = new Bitmap(bmd);
    bm.x = 150;
    bm.y = 150;
    addChild(bm);
    So, the thing to learn is that a native ARM code application does not have an ActionScript interpreter in it, and if you need to do something that normally requires interpreting ActionScript, find another way to do it.

  • How to control timeline sound of external SWF

    Hi All,
    Basic Intro:
    I am new in Action Script and trying to create a video tutorial framwork. In this I have lots of animated SWF files in all the files I have multiple scenes as those are 5min. to 10 min. each and all the files have the relevent background and nurration voice place directly on the TIMELINE frame by frame to match lip syncing animated chreactors.
    My file structure :
    Login.swf with login box is embedded into the Index.html
    After logged in it will load another SWF which is Control panel.swf
    3. Controlpanel.swf has the controls to control the loaded external swf files i.e.: Chapter menu, Play, pause, replay, volume-bar, next and previous buttons.
    By Default Controlpanel.swf will open chapter1.swf as soon as user logged in so no one need to open 1st file.
    Here user can navigate to other chapter swf file through Chapter menu or Next and Previous buttons.
    All files are loading and playing properly, here I am trying to control the animation and Sound both at a same time with Pause, Play and Replay through relevant buttons.
    Problem:
    By pressing “Pause button” animation stops but not the sound. Sound remains playing, and if I replay the swf by “Replay button” than animation restarts but sound also restarts that overlaps already playing audio.
    Question: So could anybody help me finding out how to:
    1. Pause the sound with animation by the same click of Pause button, and
    2. Stop the sound with animation by the same click of Stop button, and
    3. On replay it should stop playing the previously running audio and restart it with the animation like fresh loaded file, it should not sound overlapping.
    Constraints:
    Here I am using the sound file on the same time line of each individual swf file which I cannot add into any single movie clip because all the chapter swf file are having multiple scenes in it.
    For my problem I have already done a lot of browsing online in various forums and didn't find the solution. So here I am sharing the complete information regarding the project and wishing to get some good solution out here but if I missed any helpful information please ask me anytime and please help me to quickly find out the solution.
    Thanks a lot to all of you in advance to help me.

    create one global sound variable
    you can write when you are pressing pause button
    globalsoundvariable.setVolume(0)
    to play
    globalsoundvariable.setVolume(100)

  • FAQ: How do I load an external SWF file into a parent SWF file?

    A ton of Flash users visit Adobe’s we site every month wondering  about how to load an external SWF file from within another SWF.
    Adobe's own TechNote on the subject attempts to answer the basic question, along with some common follow-up questions, including:
    How do I load more than one SWF?
    How do I load a SWF into a specific location in the display list?
    How do I resize the loaded SWF?
    How do I set its X and Y location?
    Here are some additional resources that elaborate on loading content and on working with the display list:
    Sample files for the above TechNote. A set of 3 FLA and 3 corresponding SWF files, including a parent SWF and 2 SWFs that the parent loads.
    Help > AS3 Developer’s Guide > Loading an external SWF file
    Help > AS3 Developer’s Guide > Loading display content dynamically
    Loading multiple external SWFs within a main SWF – CreativeCow.net forums
    Video tutorial: ActionScript 101 – Episode 6: Adding named objects to the Stage. By Doug Winnie. An example of how to add the loaded external asset to the Stage and modify its location or other properties.
    Video tutorial: Preloading in ActionScript 3.0.  By Lee Brimelow. A slightly more complicated example, showing how to  make the parent SWF display information about the progress of loading  the external SWF.
    Tutorial: Loading and unloading SWFs - FlashAndMath.com
    This article provides several examples of how to communicate between a parent SWF file and the loaded SWF:
    SWF to SWF Communcation via ActionScript 3.0 (by kglad)

    quote:
    Originally posted by:
    NedWebs
    You now seem to want to get rid of the swf once it has loaded
    and played itself thru. To do that you would need to have something
    in the swf itself that triggers its removal in its last frame. The
    following might work...
    MovieClip(this.parent).removeChild(this);
    Unfortunately I couldn't get this to work. I placed it on the
    last frame of the SWF to be called - is that right?
    I am not sure I am doing it correctly...

  • Watching for a variable in an external swf

    Hi,
    I'm trying to load an swf game, and then repeatedly run a check to see if the game has ended by accessing one of it's variables.  Reading the forums and searching the web has gotten me this far:
    var myLoader:MovieClipLoader = new MovieClipLoader();
    myLoader.addListener(this);
    myLoader.loadClip("game.swf", 2);
    function onLoadInit(mc:MovieClip)
         trace('testing");
    _root.onEnterFrame = function() {
        trace(_level2.LOCAL);
    "testing" appears on the output window so I know it's being loaded correctly, the game is also playing correctly.  When I run the game in debug mode, it shows that the variable _level2.LOCAL exists and has a value, but the main loop just keeps kicking out "undefined."
    I appreciate any help.

    Ok I figured out that to access it I have to use: _level2._root.LOCAL.
    Now my question is if there is a better way to watch a variable than running a loop.
    Also I was wondering if it's possible to listen for a function call in the external swf.

  • Changing a variable in an external swf

    Hello!
    I am working in Flash cs3 with actionscript 3.0.
    I want to create a swf that will act as my client's control
    panel. What i'm looking for is something with a few textboxes or
    whatever that is able to change those variables in another swf
    permanently.
    Is this possible?
    if so, can you point me to something that will help me out?
    Thanks!
    John iv

    Ok I figured out that to access it I have to use: _level2._root.LOCAL.
    Now my question is if there is a better way to watch a variable than running a loop.
    Also I was wondering if it's possible to listen for a function call in the external swf.

  • External .swf runtime linkage .pngs AS3

    Flash can compress .png files like Photoshop can compress
    .jpg files better than any other tool hands down.
    I have 77 .png files that are 1.8 .megs on my c: drive after
    I imported them and setting the file compression under the "File
    > Publish Settings" to 75% for jpg and published the .swf with
    all the .png on the stage the file size is 350K that's about 20% of
    the original file size of the .pngs downloaded file by file with 77
    separate request.
    I can create linkage in the shared .swf and test the movie
    with code in the shared .swf to add the movieclip holders for each
    .png to the stage but when I load the shared .swf into the main
    .swf Flash acts like it can't create the classes based on the
    linkage I setup or that the MovieClip linkage doesn't exist.
    I tried a test to have the shared .swf with all the .pngs and
    linked movieclips to add the assets to it's own stage and it works
    fine but that means a lot of my code and logic is included in the
    shared .swf that the designers need to add .pngs to. It's
    unfortunate AS3 sucks but I'm just about done with the project if I
    knew what a battle AS3 was going to be I would have stayed with AS2
    my next projet will be AS2 no question non at all. Anyway I setup
    "class" linkage identifier for each .png with a movieclip holder
    for each image. The 20% of the size for the pngs and one request
    vs. 77 separate request makes it worth the extra effort of
    importing the images, creating a holder movieclip with linkage but
    the main .swf that loads the shared .swf with all the assets and
    linkage can't see or create the assets like the shared .swf can
    when I test it.
    We need to have the main .swf get a handle of the linked .png
    assets and place them in the main .swf to load the assets to
    different parts of the main .swf. It's cute that the shared .swf
    can add the linked assets to it's own stage but not too useful.
    Also the way we deploy we cannot roll out a new release/build to
    update the .pngs but we can upload a new .swf to the asset server
    so the .pngs need to be in a separate .swf. I can get the shared
    MovieClip to add the linked assets to it's own stage when testing
    and when loading my problem is the main .swf that loads the shared
    .swf cannot create instances of the classes that are exported for
    runtime sharing using linkage.
    If it is possible I would like to know how the heck you get a
    handle on a linked asset in an externally loaded .swf. Preferably
    without creating my own prototyped insane class consisting of mega
    libraries of external .as files. Just a way to reference MovieClips
    holding pngs that have linkage and are setup for runtime sharing.
    It really shouldn't be this hard it's a simple task in AS2. I'm not
    looking for a coding competition or some wild class to do the job I
    want a few lines of code to create an instance of a class then
    reference to the linkage/MovieClip holding the .png to addChild it
    into a target movieclip.

    I solved it I'm loading 77 embedded assets in an external
    .swf that compresses 77 .png images without loosing quality it
    works great.

  • Loading external SWF's into an SWF Loader as3 style?

    Hi,
    I've recently made the switch from as2 to as3 and am still struggling to get my head around one aspect in particular. I've managed to load one external swf into a blank file via the script
    import LoadDisplayObject;
    var loader:LoadDisplayObject = new LoadDisplayObject("button_01.swf", true);
    loader.addEventListener("displayObjectLoaded", onComplete, false, 0, true);
    addChild(loader);
    function onComplete(evt:Event):void {
         trace("loaded complete received");
         loader.scaleX = loader.scaleY = .75;
    .....however I'm struggling with the script to make a swfs load into a space when one of my 3 buttons is clicked....
    My page currently has three buttons (button_01, button_02 and button_03) and in a local folder three separate swfs with the same names which I wish to load in, when the appropriate button is pressed. 
    I have managed to get them to load in using a tutorial...however they load over the top of each over...far from ideal. From research on the internet I've found a range of different script...but I just can’t find anywhere I can find script to make this work..hence why I have turned to here.
    Any help much appreciated...thanks in advance.

    Hi,
    Just throught I would let you know that I've manged to get this to work this morning. Changed the script slightly and used a different method of:
    var home:MovieClip = this;
    function butt1Click(evt:MouseEvent):void {
        var ldr:Loader = new Loader();
        ldr.load(new URLRequest("button_01.swf"));
        ldr.contentLoaderInfo.addEventListener(Event.INIT, loaded);
    function butt2Click(evt:MouseEvent):void {
        var ldr:Loader = new Loader();
        ldr.load(new URLRequest("button_02.swf"));
        ldr.contentLoaderInfo.addEventListener(Event.INIT, loaded);
    function butt3Click(evt:MouseEvent):void {
        var ldr:Loader = new Loader();
        ldr.load(new URLRequest("button_03.swf"));
        ldr.contentLoaderInfo.addEventListener(Event.INIT, loaded);
    function loaded(evt: Event):void {
        if(contentClip.numChildren > 0){
            contentClip.removeChildAt(0);
        contentClip.addChild(evt.target.content);
    button_01.addEventListener(MouseEvent.MOUSE_UP, butt1Click);
    button_02.addEventListener(MouseEvent.MOUSE_UP, butt2Click);
    button_03.addEventListener(MouseEvent.MOUSE_UP, butt3Click);
    seems to work well. Only small question is if I want one page to load automatically upon opening...how do I alter the script to do this??? Thanks

  • Remove / unload external swf file(s) from the main flash file and load a new swf file and garbage collection from memory.

    I can't seem to remove / unload the external swf files e.g when the carousel.swf (portfolio) is displayed and I press the about button the about content is overlapping the carousel (portfolio) . How can I remove / unload an external swf file from the main flash file and load a new swf file, while at the same time removing garbage collection from memory?
    This is the error message(s) I am receiving: "TypeError: Error #2007: Parameter child must be non-null.
    at flash.display::DisplayObjectContainer/removeChild()
    at index_fla::MainTimeline/Down3()"
    import nl.demonsters.debugger.MonsterDebugger;
    var d:MonsterDebugger=new MonsterDebugger(this);
    stage.scaleMode=StageScaleMode.NO_SCALE;
    stage.align=StageAlign.TOP_LEFT;
    stage.addEventListener(Event.RESIZE, resizeHandler);
    // loader is the loader for portfolio page swf
    var loader:Loader;
    var loader2:Loader;
    var loader3:Loader;
    var loader1:Loader;
    //  resize content
    function resizeHandler(event:Event):void {
        // resizes portfolio page to center
    loader.x = (stage.stageWidth - loader.width) * .5;
    loader.y = (stage.stageHeight - loader.height) * .5;
    // resizes about page to center
    loader3.x = (stage.stageWidth - 482) * .5 - 260;
    loader3.y = (stage.stageHeight - 492) * .5 - 140;
    /*loader2.x = (stage.stageWidth - 658.65) * .5;
    loader2.y = (stage.stageHeight - 551.45) * .5;*/
    addEventListener(Event.ENTER_FRAME, onEnterFrame,false, 0, true);
    function onEnterFrame(ev:Event):void {
    var requesterb:URLRequest=new URLRequest("carouselLoader.swf");
    loader = null;
    loader = new Loader();
    loader.name ="carousel1"
    //adds gallery.swf to stage at begining of movie
    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader.load(requesterb);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader);
    loader.x = (stage.stageWidth - 739) * .5;
    loader.y = (stage.stageHeight - 500) * .5;
    // stop gallery.swf from duplication over and over again on enter frame
    removeEventListener(Event.ENTER_FRAME, onEnterFrame);
    //PORTFOLIO BUTTON
    //adds eventlistner so that gallery.swf can be loaded
    MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    function Down(event:MouseEvent):void {
    // re adds listener for contact.swf and about.swf
    MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
    MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    //unloads gallery.swf from enter frame if users presses portfolio button in nav
    var requester:URLRequest=new URLRequest("carouselLoader.swf");
        loader = null;
    loader = new Loader();
    loader.name ="carousel"
    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader.load(requester);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader);
    loader.x = (stage.stageWidth - 739) * .5;
    loader.y = (stage.stageHeight - 500) * .5;
    removeChild( getChildByName("about") );
    removeChild( getChildByName("carousel1") );
    // remove eventlistner and prevents duplication of gallery.swf
    MovieClip(root).nav.portfolio.removeEventListener(MouseEvent.MOUSE_DOWN, Down);
    //INFORMATION BUTTON
    //adds eventlistner so that info.swf can be loaded
    MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
    function Down1(event:MouseEvent):void {
    //this re-adds the EventListener for portfolio so that end user can view again if they wish.
    MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    var requester:URLRequest=new URLRequest("contactLoader.swf");
    loader2 = null;
    loader2 = new Loader();
    loader2.name ="contact"
    loader2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader2.load(requester);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader2);
    loader2.x = (stage.stageWidth - 658.65) * .5;
    loader2.y = (stage.stageHeight - 551.45) * .5;
    // remove eventlistner and prevents duplication of info.swf
    MovieClip(root).nav.info.removeEventListener(MouseEvent.MOUSE_DOWN, Down1);
    //ABOUT BUTTON
    //adds eventlistner so that info.swf can be loaded
    MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    function Down3(event:MouseEvent):void {
    //this re-adds the EventListener for portfolio so that end user can view again if they wish.
    MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
    var requester:URLRequest=new URLRequest("aboutLoader.swf");
    loader3 = null;
    loader3 = new Loader();
    loader3.name ="about"
    loader3.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader3.load(requester);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader3);
    loader3.x = (stage.stageWidth - 482) * .5 - 260;
    loader3.y = (stage.stageHeight - 492) * .5 - 140;
    removeChild( getChildByName("carousel") );
    removeChild( getChildByName("carousel1") );
    // remove eventlistner and prevents duplication of info.swf
    MovieClip(root).nav.about.removeEventListener(MouseEvent.MOUSE_DOWN, Down3);
    stop();

    Andrei1,
    Thank you for the helpful advice. I made the changes as you suggested but I am receiving a #1009 error message even though my site is working the way I wan it to work. I would still like to fix the errors so that my site runs and error free. This is the error I am receiving:
    "TypeError: Error #1009: Cannot access a property or method of a null object reference."
    I'm sure this is not the best method to unload loaders and I am guessing this is why I am receiving the following error message.
         loader.unload();
         loader2.unload();
         loader3.unload();
    I also tried creating a function to unload the loader but received the same error message and my portfolio swf was not showing at all.
         function killLoad():void{
         try { loader.close(); loader2.close; loader3.close;} catch (e:*) {}
         loader.unload(); loader2.unload(); loader3.unload();
    I have a question regarding suggestion you made to set Mouse Event to "null". What does this do setting the MouseEvent do exactly?  Also, since I've set the MouseEvent to null do I also have to set the loader to null? e.g.
    ---- Here is my updated code ----
    // variable for external loaders
    var loader:Loader;
    var loader1:Loader;
    var loader2:Loader;
    var loader3:Loader;
    // makes borders resize with browser size
    function resizeHandler(event:Event):void {
    // resizes portfolio page to center
         loader.x = (stage.stageWidth - loader.width) * .5;
         loader.y = (stage.stageHeight - loader.height) * .5;
    // resizes about page to center
         loader3.x = (stage.stageWidth - 482) * .5 - 260;
         loader3.y = (stage.stageHeight - 492) * .5 - 140;
    //adds gallery.swf to stage at begining of moviie
         Down();
    //PORTFOLIO BUTTON
    //adds eventlistner so that gallery.swf can be loaded
         MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    function Down(event:MouseEvent = null):void {
    // re adds listener for contact.swf and about.swf
         MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
         MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    //unloads gallery.swf from enter frame if users presses portfolio button in nav
         var requester:URLRequest=new URLRequest("carouselLoader.swf");
         loader = new Loader();
         loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
         function ioError(event:IOErrorEvent):void {
         trace(event);
         try {
         loader.load(requester);
         } catch (error:SecurityError) {
         trace(error);
         this.addChild(loader);
         loader.x = (stage.stageWidth - 739) * .5;
         loader.y = (stage.stageHeight - 500) * .5;
    // sure this is not the best way to do this - but it is unload external swfs
         loader.unload();
         loader2.unload();
         loader3.unload();
    // remove eventlistner and prevents duplication of gallery.swf
         MovieClip(root).nav.portfolio.removeEventListener(MouseEvent.MOUSE_DOWN, Down);
    //INFORMATION BUTTON
         //adds eventlistner so that info.swf can be loaded
         MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
         function Down1(event:MouseEvent = null):void {
         //this re-adds the EventListener for portfolio so that end user can view again if they wish.
         MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
         MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
         var requester:URLRequest=new URLRequest("contactLoader.swf");
         loader2 = null;
         loader2 = new Loader();
         loader2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);    
         function ioError(event:IOErrorEvent):void {
         trace(event);
         try {
         loader2.load(requester);
    }      catch (error:SecurityError) {
         trace(error);
         addChild(loader2);
         loader2.x = (stage.stageWidth - 658.65) * .5;
         loader2.y = (stage.stageHeight - 551.45) * .5;
    loader.unload();
    loader2.unload();
    loader3.unload();
         // remove eventlistner and prevents duplication of info.swf
         MovieClip(root).nav.info.removeEventListener(MouseEvent.MOUSE_DOWN, Down1);
    //ABOUT BUTTON
         //adds eventlistner so that info.swf can be loaded
         MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
         function Down3(event:MouseEvent = null):void {
         //this re-adds the EventListener for portfolio so that end user can view again if they wish.
         MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
         MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
         var requester:URLRequest=new URLRequest("aboutLoader.swf");
         loader3 = null;
         loader3 = new Loader();
         loader3.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
         function ioError(event:IOErrorEvent):void {
         trace(event);
         try {
         loader3.load(requester);
    }      catch (error:SecurityError) {
         trace(error);
         addChild(loader3);
         loader3.x = (stage.stageWidth - 482) * .5 - 260;
         loader3.y = (stage.stageHeight - 492) * .5 - 140;
         loader.unload();
         loader2.unload();
         loader3.unload();
         // remove eventlistner and prevents duplication of info.swf
         MovieClip(root).nav.about.removeEventListener(MouseEvent.MOUSE_DOWN, Down3);
         stop();

  • Design/gallery website - loading external SWF asset on splash page

    Hello all,
    This forum has been such a help with my website, i've found the answers to hundereds of questions but I've hit a bit of a brick wall and I wonder if anyone can help me.
    I have recently built a website http://www.intivision.co.uk/ using illustrator/flash/flash catalyst. It's still a work in progress and I'm happy with the gallery pages and general functionality but I'm having major issues with my splash/load screen and a few other niggles.
    The animation on the front page is a looping photo gallery i created in flash (as a .SWF) and imported into Catalyst. It is designed to play (and loop) indefinately after 2seconds of loading the title page. Half the time I access the site the animation does not load at all and just shows a blank screen and my logo. It will appear once the page is refreshed. A very bad first impression.
    I have a feeling this is because the SWF is externally loading the asset (which is only 350kb). Is there a solution or a way to imbed this animation so the entire project won't 'play' until this intro is loaded?
    Thanks - Tom
    ps Any other comments would be greatly appreciated

    Thanks for taking your time! Much appreciated.
    I like not complicated :-)  So it is now loading from the start - stretching over the whole timeline. How do I controll the visibility during the "HOME" = that is invisible?
    This is the code I use to load the external swf:
    var Xpos:Number=0;
    var Ypos:Number=0;
    var swf:MovieClip;
    var loader:Loader=new Loader();
    var defaultSWF:URLRequest=new URLRequest("main_movie_241x700.swf");
    loader.load(defaultSWF);
    loader.x=Xpos;
    loader.x=Ypos;
    addChild(loader);

  • Trouble loading an external swf file implemented with AS3

    I am using Adobe Flash CS3
    At first, I tried
    swf_mc.loadMovie("//swf file
    location");
    It gave me
    quote:
    Warning: 1060: Migration issue: The method loadMovie is no
    longer supported.
    USE: var l = new Loader(); addChild(l); l.load(new
    URLRequest("your url"));.
    Well, the given code isn't working at all.
    But since it is a migration error, I thought maybe I can just
    save it into Flash5 format with AS1. Then it worked with most
    external swf files. However, the one I am trying to load is a swf
    file with AS3, so my older version swf can't load it at all.
    Anyone has any ideas about how to load an external AS3 swf
    file?

    AS3 is a completely different beast than AS1 or 2. loadMovie
    was removed from the language.
    The answer to your question is two fold. First, Adobe was
    kind enough to give us the code when it finds a migration issue.
    var _ldr:Loader = new Loader();
    addChild( _ldr );
    _ldr.load( new URLRequest( "your url") );
    Handling progress has also changed. I have a ContentLoader
    package on my site that you're free to use that should familiarize
    you with the new way that things are done in AS3.
    http://sd-dezign.com/blog/?page_id=10

  • Loading an external SWF from an external SWF

    Hello,
    I'm somewhat caught between a rock and a hard spot on a flash
    site project. Here is the situation:
    I have created a parent movie (which loads all external SWFs
    inside of it) that has the menu navigation built into it. However,
    my client wants me to place some more links inside of the external
    SWFs that lead to other pages (external SWFs) of the site. Is this
    at all possible? I was hoping there is a way to tell a button in an
    external SWF to make the parent movie switch between external SWFs.
    Any and ALL help is very much appreciated. Thank you.
    Another question: does this involve using the _parent script?
    Elijah

    Hello,
    Thank you for replying. Here is exactly what I'm needing to
    do:
    We will call the parent file "index.swf". Inside "index.swf"
    I have a "holder" for external swf files to load into when I call
    on them from the main menu buttons on "index.swf". When a customer
    comes to the site, the "index.swf" file initially loads
    "welcome.swf". Inside of "welcome.swf", I have some images that I
    want to make into links to other external swf files.
    My problem is when someone clicks on one of those pictures I
    want the "index.swf" file to open up the corresponding external swf
    file in its "holder", where "welcome.swf" currently resides. Also,
    all of these swf files ("index.swf" included) have stand-alone FLA
    files, none are attached to one another. I have never worked with
    "levels" before, would that be necessary in this case? I have
    attached the code for the external swf loader.
    I hope that gives you a better idea of what I'm trying to
    accomplish.
    Thanks again.
    Elijah
    CODE:

  • Loading an external .swf to a main .swf

    so i fairly new to flash but had a question about
    loading an external .swf into a mian one. So i was jsut wondering
    if anyone had great links to a site that could help or anyone who
    might want to explain it step-by-step. and one question of my own a
    very stupid one infact if i keep the background white on my .sfw
    that i am going to load into my main one will the background still
    be there when it shows up on my website?
    Any help?
    Thanks...

    Start by reading the Live Docs on the loadMovie() method.
    That will get you headed in the right direction.
    As for the background of the loaded SWF (by which I mean the
    background color as specified in the PI for the document), no, that
    is ignored when loading it into another movie. If you need it to
    have a background, create a new layer at the bottom of the timeline
    and draw a rectangle filled with the color you need before
    generating the SWF.
    Hope that helps!

  • The loaded external.swf don't appears on two client connected in VideoCommunication...

    Hi, everybody...
    I have to realize a videocommunication, whit Apache web server and FMS 3. This's ok...
    I have a button that load an external .swf but, when the 2 client are into communication, when I push the button, the external .swf starts only on the local client and not on the other client.
    Can someone help me?
    Thanks.
    Emiliano.

    Hi Csound1, thanks. The email host is 1and1.co.uk, however, i am going to fess up and make myself look like a plonker now -
    the email account in question was set up in Outlook as POP - stupid, stupid, stupid me, wasted an afternoon on this!  I have now changed the Outlook account to IMAP and Mail.app works perfectly - and looks much nicer than Outlook did.  Im in the middle of converting from Windows to a Mac, and still finding my way around the Mac
    The lesson learned, never assume - always double  check!  All my other email addresses with 1and1 are all imap, except this one, and it happened to be the first one I set up in the Mail.app. (bows head in disgrace!)
    Thank you anyway for attempting to help me!
    Cheers

Maybe you are looking for

  • Photosmart c309a- 'The wireless radio is not functioning, contact HP support'

    My Photosmart c309a wont connect wirelessly. Upon running the wireless network test, the report states, and I quote "The wireless radio is not functioning. Contact HP support". The report then states the following: Wireless on                    PASS

  • Macbook Pro Retina over 200F 5-10 fps in games (after SMC/PRAM Reset)

    I have struggled with this for too long now. I have read every single thread I can find about the issue and tried both complete reinstalled of Bootcamp, SMC reset, PRAM Reset, EFI updates, etc. When I first got the Macbook, I could run our game devel

  • 4215 Java error: When connecting from IPS event viewer

    Hello- I received a java error when trying to connect to my 4215 with Cisco IPS event viewer. It is as follows: IOException in open Subscription(): java.security.cert.CertificateExpiredException: NotAfter: Sunday March 29 Is the web server running on

  • Repeat to create multi-column table

    I'm trying to use a spry:repeat directive to create a two-column table. What I would like to have generated as a result of the repeat is something like the following: <table> <tr> <td>row[0] data</td> <td>row[1] data</td> <tr> <tr> <td>row[2] data</t

  • Photoshop Says I'm on 'trial', but I bought the program?

    Earlier this year, I purchased a copy of Photoshop cs6 direct from Adobe online. Downloaded it, installed it, and ran smooth as glass. A few months later, I decided to download a trial of After Effects to play with, knowing I wouldn't buy it in the e