| Mission Statement |
DreamWeaverForum.infois an online Community of web developers joining together to better their field, share problems and solutions as well as promoting their cause. We strive to bring you the best information, tools, downloads and news to support your work and companys efforts working in web development. With our favorite tool "Dreamweaver" and the tools and information we bring you, You should be in a great postion to better your skills and show the world your work. Come back often, Stay late we have many new things coming your way. Wish you all the best in 2009
information.. |
|
|
|
|
|
|
 |
 |
|
|
|
 |

11-19-2008, 07:24 PM
|
|
|
Please help me build a Pre-loader!
Hello,
I built a site which uses the Flash Loader component to load in imagery, the
actionscript is AS2, and I am using a tween-class (mcTween2) to animate. This
is the site so far: http://www.dnworkinprogress.com/polise.html
I have been searching different methods to pre-load the imagery and cannot
find a method that can work with the loader component and that also allows me
to customize the pre-loader.
If anyone can take a look and point me in the right direction, I am gratefully
indebted.
Thank You,
Dan Newcomer
|

11-20-2008, 05:25 AM
|
|
|
Re: Please help me build a Pre-loader!
Hi Dan
I am not a big user of components, but I don't think it would be hard to add a
pre-loader to its content.
Pick one of the pre-loading code that you have found, and create a Listener
object, then attach that listener to the component.
Give that a try and see how it goes.
I'm am just taking a guess here, so if no luck, let me know and we'll see
where to go from there.
|

11-20-2008, 02:25 PM
|
|
|
Re: Please help me build a Pre-loader!
Hi,
Thank you for the quick response and help, I will attempt the Listener object
and see where it takes me. Will the Listener object tell me that the content
of the external imagery is actually loading or connecting in my site?
Also, another thought I had, would it be possible to export my action script
in order to make things run smoother?
Once again Thank You
Dan
|

11-20-2008, 02:54 PM
|
|
|
Re: Please help me build a Pre-loader!
Yes you can export your actionscript into a external .as file. But I dont know
what you mean by "making things run smoother"
A listener is a object you create so that you can make things happen on
certain events. You can make the listener trigger commands and/or functions
when something happens.
In your case, the loading of external content. So you will have something like
this:
listener.onLoadProgress = function(){
//do something while its loading
}
|

11-21-2008, 10:34 PM
|
|
|
Re: Please help me build a Pre-loader!
Hello Again,
Another quick question, would it be more beneficial for me to somehow
substitute the loader component that has loaded my imagery with the
MovieClipLoader.loadClip() method which would give me more flexibility when it
come to the preloader.
I am under the impression that I built the site wrong from the start by
relying on the loader component which restricts me in designing the preloader.
I have not had the chance to attempt the listener yet..
Thanks,
Dan
|

11-22-2008, 12:35 AM
|
|
|
Re: Please help me build a Pre-loader!
Hi Dan
You can build your own Loader with per-load capability.
in this example, we are using a button to load an external swf:
first, create a empty movieclip on the stage where you want your external
content to be displayed, and give it an instance name of "container" without
the quotes.
then add this code on a frame.
(by the way, this code is acutally quite short. it looks long because of all
the comments i added to explain what is happening)
//theMCL is the Movie clip loader
//theListener listens to how much is downloaded
var theMCL:MovieClipLoader = new MovieClipLoader();
var theListener:Object = new Object();
//here you add the listener to the movie clip loader
theMCL.addListener(theListener);
//here you have the pre-loading equation to get a percentage.
theListener.onLoadProgress = function(mc:MovieClip, bytesLoaded:Number,
bytesTotal:Number) {
var loaded:Number = Math.round((bytesLoaded/bytesTotal) * 100);
//here you tell your loading animation to move to the specified frame in the
timeline.
progressBar.gotoAndStop(loaded);
}
//this is to make the progress bar visible and invisible on start and finish.
theListener.onLoadInit = function (mc:MovieClip) {
progressBar._visible = false;
// tell movie to start when loading is finished
mc.play();
}
theListener.onLoadStart = function (mc:MovieClip) {
progressBar._visible = true;
// tell movie to stop while loading
mc.stop();
}
//specify where the external clip is, and the name.
//leave it to open in container.
theMCL.loadClip("external.swf","container");
|

11-22-2008, 12:44 AM
|
|
|
Re: Please help me build a Pre-loader!
you further insert this code into a function, then call this function as many
times as you want from different levels in your movie.
eg..
function loadExternalSWF(who, where){
//code goes here
//last line of code will be changed to this:
theMCL.loadClip(who, where);
}
then call the function like so:
loadExternalSWF("external.swf", container);
you simply enter the name of the file you want to load as a string "inside
quotes", and then specify where you want to load it into. you can have any
number of holders, just specify the movieclip instance name.
hope this helps.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|