Solved

Preloader Dynamic Text ActionScript Question...

Posted on 2004-09-13
6
253 Views
Last Modified: 2012-08-14
Hello, I have just a simple Flash MX 2004 Preloader file where I have a graphic and dynamic text telling the user the status of the download, I want the dynamic text to float ontop of the graphic as the graphic loads (graphic fills the screen and moves up) here is the actionscript I am using for the file:
<snip>

bytes_loaded = Math.round(getBytesLoaded());
bytes_total = Math.round(getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.loadBar._height = getPercent*100;
_root.loadTextMC.loadText = Math.round(getPercent*100)+"%....Loaded";
_root.loadTextMC._y = _root.loadBar._height
if (bytes_loaded == bytes_total) {
     _root.gotoAndPlay(3);
}
</snip>

 or you can dl the .fla from http://www.rememberrainier.com/vote/PreLoaderSSV3.fla

Any direction or help would be appreciated, all I want is the dynamic text to move up with the loader bar.
0
Comment
Question by:tashley
[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
  • 4
  • 2
6 Comments
 
LVL 10

Accepted Solution

by:
muso120999 earned 500 total points
ID: 12048977
Is this kinda what you are after?

bytes_loaded = Math.round(getBytesLoaded());
bytes_total = Math.round(getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.loadBar._yscale = getPercent*100;
_root.loadTextMC.loadText = Math.round(getPercent*100)+"%....Loaded";
_root.loadTextMC._y = _root.loadBar._y - _root.loadBar._height-20;
if (bytes_loaded == bytes_total) {
      //_root.gotoAndPlay(3);
}
0
 

Author Comment

by:tashley
ID: 12049326
Yes it's exactly what I am looking for, you get the points, one quick question though, if you notice on the file, the dynmic text movement is chopy, is there a way to make it seem more fluid? Sorry for the lame questions I am pretty new to flash.

0
 
LVL 10

Expert Comment

by:muso120999
ID: 12049398
You can change the frame rate (I usually use 25fps) - Modify -> Document....

Also, just for your interest, you can do the same with just 2 frames (frame 2 in this case isn't required) - although the difference is negligable between the two:
stop();
this.onEnterFrame = function() {
      var bytes_loaded = Math.round(getBytesLoaded());
      var bytes_total = Math.round(getBytesTotal());
      var getPercent = bytes_loaded/bytes_total;
      _root.loadBar._yscale = getPercent*100;
      _root.loadTextMC.loadText = Math.round(getPercent*100)+"%....Loaded";
      _root.loadTextMC._y = _root.loadBar._y-_root.loadBar._height-20;
      if (bytes_loaded == bytes_total) {
            delete this.onEnterFrame;
            _root.gotoAndPlay(3);
      }
};
0
Independent Software Vendors: 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!

 
LVL 10

Expert Comment

by:muso120999
ID: 12049440
Is there a reason I got a grade B, by the way!
0
 

Author Comment

by:tashley
ID: 12050126
I though I gave you an A, but I hit an extra enter (2) times and closed my browser due to problems with my newly images machine (after brief outage due to windows conflicts) Is there a way to change it?

0
 
LVL 10

Expert Comment

by:muso120999
ID: 12052012
You can request it at community support.  I'm not unduly worried - just wondered - but it would be nice if you could change it ;-)

http://www.experts-exchange.com/Community_Support/
0

Featured Post

Technology Partners: 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

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…
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…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
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.

740 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