Solved

preloader issue:  why doesn't my loadText dynamic text display

Posted on 2006-07-16
6
185 Views
Last Modified: 2010-04-03
any ideas why a loadin swf, that loads into an empty movie clip, won't obey the same code?

have modified it to that below - content_container is the empty clip at  _root level

bytes_loaded = Math.round(_root.content_container.getBytesLoaded());
bytes_total = Math.round(_root.content_container.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.content_container.loadBar._width = getPercent*100;
_root.content_container.loadText.text = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
     _root.content_container.gotoAndPlay(3);
}

thanks
aidan
0
Comment
Question by:aidan09
  • 3
  • 3
6 Comments
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 17117619
Hi,

you have used absolute reference to _root here...
when this swf will be loading inside another swf then _root written in this swf will refer to the _root of _parent swf

a workaround to this is just add following code just above your code:

-----------------------
this._lockroot = true;
-----------------------
above code will lock the swf root in itself and all reference to _root written in this swf will forced to refer to only this root.

Rgds
Aneesh
0
 

Author Comment

by:aidan09
ID: 17118597
doesnt seem to work
the loadBar seems to work ok, but I still don't seem to get the dynamic field working
/??
0
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 17119182
I suggest please upload your source files I will fix it and send back to you

you can use yousendit.com to upload your Files

Rgds
Aneesh
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:aidan09
ID: 17123171
thanks Aneesh

have uploaded the files for you.

Aidan
0
 
LVL 34

Accepted Solution

by:
Aneesh Chopra earned 500 total points
ID: 17123361
updated code of "lodge7.fla" first frame
-------------
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
this.loadText.text = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
      this.gotoAndPlay(3);
}
---------------------

copy the same code on first frame of "home.fla"


Rgds
Aneesh
0
 

Author Comment

by:aidan09
ID: 17140321
thanks aneesh!
much appreciated!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Google Chrome - Where is "Enable Resource Tracking" 2 11,072
Flash movie or gif/animation? 3 846
Updating Flash Player with GPO 3 339
Flash Converter 8 106
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now