New messages 0
Total messages 428
New messages 0
Total messages 428| Subject RE: flash movie | ||||
|
Author:
ngwooter Date: 08-06-2005 10:19 |
||||
|
Well if your using Flash mx 2004 it has a loader component and pBar for that but if you wanna make your own its really not that hard. i will try to explain the easiet way
draw a rectangle right click convert to symbol name it bar and give it a instance in properties called bar then create a dynamic text box go back into properties and give that text box a var called loadtxt now select both the box and bar and convert that into a symbol called progressbar now double click it and go inside the symbol you just created create a layer above the layers of the text and bar and label that layer Actions give it two frames ok first frame this code goes on it //first frame of mc progressbar _root.stop(); //defineing PercentLoaded PercentLoaded = _root.getBytesLoaded() / _root.getBytesTotal() * 100; ///below is for your text box to display the percent loaded loadtxt = Math.round(PercentLoaded*100)+"%"; //Now this will move the the bar _x sideways depending on the percent loaded if (PercentLoaded != 100) { setProperty(bar, _xscale, PercentLoaded); } else { _root.gotoAndStop(2); } ok now on second frame just creating a loop place the code below gotoAndPlay(1); now you have a progress bar exit out the clip and place it on your first frame of your main timeline it will not go past the first frame until movie is fully loaded. now the component way of doing it is about is simple except its a bit diffrent because yea it gets the bytes and you dont have to code that but you have to add listeners and code extra just to remove the stupid thing from view after its loaded also it adds extra kb to your movie cause the thing is way to bulky for its job but yea it looks pretty and you can set styles but i still use it hehe but i still hate it. hope that helps |
||||
| Subject | Author | Date | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||