- #1
sid_galt
- 502
- 1
How do you display a trace bar which shows how much of the swf has loaded ?
Thank you
Thank you
_root.onEnterFrame = function(){
p = 100*_root.getBytesLoaded()/_root.getBytesTotal();
_root.mytext.text = p+"% loaded";
if(p>=100){
// finished, do something, like go to frame 5
delete _root.onEnterFrame;
_root.gotoAndPlay(5);
}
}
_root.onEnterFrame = function(){
p = 100*_level0.getBytesLoaded()/_level0.getBytesTotal();
_root.mytext.text = p+"% loaded";
if(p>=100){
// finished, do something, like go to frame 5
delete _level0.onEnterFrame;
_level0.gotoAndPlay(5);
}
}
on(load){
this.mode = "manual";
this.indeterminate = false;
this.minimum = 0;
this.maximum = 100;
this.onEnterFrame = function(){
this.setProgress(_root.getBytesLoaded(), _root.getBytesTotal());
}
}
on(complete){
delete this.onEnterFrame;
trace("complete");
}
You have to be more specific. Is the text file in the same server as the .swf? Or from an external domain? Is data for each country loaded from the same text file, or from different ones? Is this your own server or a web host? There are some restrictions about loading data from other servers, it's not allowed unless you specifically set the site's domain as allowed.The problem is that no data is appearing for the European countries if the web page is loaded from a server even though data is coming for the other countries. The method is the same in both cases.
My flash intro is loading in a few computers but is not loading in the same computers mentioned above. The computers just show a sign of Macromedia Flash Player and that's it.
-Job- said:The point of preloader movies is to let the user know that things are happening. Without a loading bar you might get a blank screen while the first frames are loaded. Also most of the components you use in Flash are set to export on frame 1, this means that frame 1 sometimes is the heaviest frame and so, while it is loading, the user has no idea what is going on with the movie.
Same Server-Job- said:You have to be more specific. Is the text file in the same server as the .swf? Or from an external domain?
Different files for each country-Job- said:Is data for each country loaded from the same text file, or from different ones?
It's a web host. The problem is that most other countries outside of Europe are loading. Although, I have just discovered that a few countries like China are not loading either.-Job- said:Is this your own server or a web host? There are some restrictions about loading data from other servers, it's not allowed unless you specifically set the site's domain as allowed.
Now that I am checking again, the problem is coming with Internet Explorer browsers which have Flash Player 8 installed.-Job- said:What operating System and browser?
No, but since Firefox and Opera are opening everything, I can't see how that could be the reason.-Job- said:Have you ruled out security settings as the cause of this?
<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,0,0" width="550" height="400">
<param name="src" value="intro7.swf" />
<embed src="intro7.swf" pluginspage="[PLAIN]http://www.macromedia.com/shockwave/download/"[/PLAIN] width="550" height="400"></embed>
</object>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="550" height="400" id="intro7" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="intro7.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="intro7.swf" quality="high" bgcolor="#000000" width="550" height="400" name="intro7" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
The computers all have Flash 8. However when the intro is viewed in IE, on right clicking, instead of "About Macromedia Flash Player 8", there is "About Shockwave Player". That is what made me think that there might be a problem in the way the swf file was being called into the html file.-Job- said:Are you 100% sure these PCs have flash 8? If you right click on the movie do you see, in the bottom entry in the menu "About Macromedia Flash Player 8..."?
-Job- said:Can you view other flash 8 movies, from other sites, correctly, or is it that they can't view anything at all?
-Job- said:So it was the HTML. Did you have Flash 8 generate the HTML via "Publish"?
A Trace Bar is a visual representation of the loading progress of an SWF file. It provides a way for developers to track the loading process and identify any potential issues.
Having a Trace Bar allows developers to monitor the loading progress of an SWF file, which can help identify any issues or errors that may occur during the loading process. It also provides a way to measure the performance of the file and make necessary optimizations.
To create a Trace Bar, you will need to use ActionScript code to track the loading progress of the SWF file. This can be done by using the onEnterFrame
event and the getBytesLoaded()
and getBytesTotal()
functions to calculate the percentage of the file that has been loaded. Then, you can use this percentage to update the visual representation of the Trace Bar.
Aside from helping to identify and troubleshoot any issues with the loading process, a Trace Bar can also provide valuable information about the performance of the SWF file. It can help determine if the file is too large or if there are any elements that are causing delays in the loading process.
Yes, there are other methods for tracking the loading progress of an SWF file, such as using the LoaderInfo
class or external libraries. However, a Trace Bar is a simple and effective way to visually monitor the loading progress and is commonly used by developers.