Adobe Dreamweaver Forums



Last 10 THreads :         Re: 2.1 GB TIF size limit (Last Post : Bart_Kelsey@adobeforums.com - Replies : 0 - Views : 1 )           »          Strip EXIF camera data from PSD files? (Last Post : Ho - Replies : 3 - Views : 8 )           »          delete all channels previously created by "save selection" (Last Post : Paul_R@adobeforums.com - Replies : 4 - Views : 5 )           »          flash drawing (Last Post : ponarangan - Replies : 0 - Views : 1 )           »          Flash IDE randomly creating Symbols (Last Post : OLTLfan - Replies : 2 - Views : 4 )           »          Can I make a 4 state CSS Sprite nav bar. (Last Post : Dooza - Replies : 9 - Views : 10 )           »          JavaScript to enable submit button (Last Post : Dooza - Replies : 8 - Views : 9 )           »          Webhelp Instead of HTML Help for Desktop Applications? (Last Post : Peter Grainge - Replies : 1 - Views : 2 )           »          Help With a earth spinn flash site (Last Post : Balambur - Replies : 0 - Views : 1 )           »          pause imported swf when Captivate movie is paused (Last Post : j-wa - Replies : 0 - Views : 1 )           »         


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..



 



User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flash > Site Design
 
Tags:



Reply
  #1 (permalink)  
Old 11-19-2008, 07:24 PM
DanNewcomer
 
Posts: n/a
Diggs:
Default 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



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-20-2008, 05:25 AM
Sketchsta
 
Posts: n/a
Diggs:
Default 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.

Reply With Quote
  #3 (permalink)  
Old 11-20-2008, 02:25 PM
DanNewcomer
 
Posts: n/a
Diggs:
Default 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

Reply With Quote


  #4 (permalink)  
Old 11-20-2008, 02:54 PM
Sketchsta
 
Posts: n/a
Diggs:
Default 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
}

Reply With Quote
  #5 (permalink)  
Old 11-21-2008, 10:34 PM
DanNewcomer
 
Posts: n/a
Diggs:
Default 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

Reply With Quote
  #6 (permalink)  
Old 11-22-2008, 12:35 AM
Sketchsta
 
Posts: n/a
Diggs:
Default 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");

Reply With Quote


  #7 (permalink)  
Old 11-22-2008, 12:44 AM
Sketchsta
 
Posts: n/a
Diggs:
Default 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.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 09:29 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk