Solved

Preloader Dynamic Text ActionScript Question...

Posted on 2004-09-13
6
248 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
  • 4
  • 2
6 Comments
 
LVL 10

Accepted Solution

by:
muso120999 earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 10

Expert Comment

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

Author Comment

by:tashley
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
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 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…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

744 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

16 Experts available now in Live!

Get 1:1 Help Now