dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: How to check if an swf file is loaded

Threaded View

  1. #1
    Member
    Join Date
    Aug 2008
    Posts
    38

    How to check if an swf file is loaded

    (I don't want to check ProgressEvent.PROGRESS while loading, but, after it's loaded, to check if it's loaded so it won't be reloaded)

    In my preloader I'm loading a file, called 'settings.swf' with this code:
    Code:
    // this code is in preloader
    var request:URLRequest=new URLRequest("settings.swf");
    var _loader:Loader = new Loader();
    _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
    _loader.load(request);
    
    function onLoaded(e:Event):void {
    	var movie:* =LoaderInfo(e.currentTarget).content;
    	Container3.addChild(movie); // Container3 is a MovieClip on MainTimeLine
    }
    The movie is added with a name like 'instance138' or something like this.
    But I can't check if it's loaded with a name like this, randomly created.
    I tried to change it's name with 'movie.name="settings" ' but it gave me an error:
    "Error: Error #2078: The name property of a Timeline-placed object cannot be modified."

    So, how could I check if a movieclip is loaded? (I suppose changing it's name is impossible)
    Last edited by panoss; 05-13-2015 at 11:48 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center