Hello I have built my full site in Flash but one thing that I notice is that if I make a mistake and forget to upload one of the swf files the site just hang until I upload the file. So I decided to draw up a File not Found Page in flash too. How would I write the Actionscript for this. My Loader is "this.container" Made this Code Up... [code]if (_global.error) { trace("Loading failed!"); this.container.loadMovie ("404.swf"); } else { trace("Loading Passed"); } this.container.onComplete = function(success) { if (success) { trace("Page Loaded"); } else { _global.error = true; } }; [/code] This One To [code] this.container.onLoad = function(success) { if (success) { trace("Page Loaded"); } else { _global.error = true; } }; [/code] Can some one help me with this?
onloaderror () but how do I add a listener to the loader. The loader is a Movieclip on the stage with an instance of "container"
I tried that. it works but the loader is not place on the stage in the correct place. Even if I place it in the correct place I have another problem . all my movie clips have a loader script _level0.container.loadMovie(_level0.currMovie+".swf"); allowing the loaded movie to be able to play a transitional effect before it goto the next loaded movie
there's no difference in positioning a swf loaded using loadMovie() and using the moviecliploader class: you still reference the target movieclip to control the loaded swf. and there's difference in using your transitional effect: again, instead of using loadMovie() use loadClip, the moviecliploader class etc.
Ok, So how do I set a X and Y settings to move the movieclip in the proper place. i tried mc_loader.move (0, 314, noevent);
Why are you using the .move method. Just to clarify.... Is mc_loader a movieclip or a Loader component?
[q] also if I use the code provided by Adobe it works but how do I set a X and Y settings to move the movieclip in the proper place. [/q] HERE: function onLoadInit(mc:MovieClip) { trace("onLoadInit: " + mc); mc._x=100; mc._y=100; }
mcloader is the varialbe name adobe assigned to the blank movieclip.
My earlier post was based on what you had before you edited... I was confused by your use of the move method which is more common with components and is not something that is relevant for a MovieClip or a MovieClipLoader. I was guessing (perhaps incorrectly) that you found it in the reference for the Loader component which is something different. Anyways... did you try the adobe code (which you say was working for you) with adjusting the _x and _y properties in the onLoadInit function as per my last post?
: this.onLoadInit=function(mc:MovieClip) { trace("onLoadInit: " + mc); } this.onLoadError=function(mc:MovieClip, errorCode:String, [httpStatus:Number]){ // } var container:MovieClip = createEmptyMovieClip("container", getNextHighestDepth()); var mcLoader:MovieClipLoader = new MovieClipLoader(); mcLoader.addListener(this); mcLoader.loadClip("sites.swf", container); container._x=0; container._y=314;
@kglad : I see now. I had thought it was something to do with repositioning based on different content. But its just the position of the original holder clip. @samuels2921 : please ignore my posts, sorry.
COde I used that solved my problems... var container:MovieClip = createEmptyMovieClip("container", getNextHighestDepth()); var mcLoader:MovieClipLoader = new MovieClipLoader(); mcLoader.addListener(this); function onLoadError(mc:MovieClip, errorCode:String, httpStatus:Number) { trace(">> loadListener.onLoadError()"); trace(">> =========================="); trace(">> errorCode: "+errorCode); trace(">> httpStatus: "+httpStatus); _root.currMovie = "404"; _root.mcLoader.loadClip(_root.currMovie+".swf", _root.container); } function onLoadInit(mc:MovieClip) { trace("onLoadInit: "+mc); mc._x = -16; mc._y = 432; }
Don't see what you're looking for? Try a search.
|