Solved

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

Posted on 2006-07-16
6
199 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
YouTube Link 10 353
Adobe Flash Player not supported on my Tablet 7 713
Flash Slides/Presnetation 4 71
What process can I use to achieve this? 5 114
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…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

911 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

22 Experts available now in Live!

Get 1:1 Help Now