Solved

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

Posted on 2006-07-16
6
229 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
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.

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
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.

752 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