Solved

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

Posted on 2006-07-16
6
238 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
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 select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

626 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