Solved

Preloader Dynamic Text ActionScript Question...

Posted on 2004-09-13
6
255 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
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 goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

696 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