home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 1762
Discussions: 188,404, Posts: 2,243,610, Members: 232,631
Old August 23rd, 2004, 06:46 AM   Digg it!   #1 (permalink)
Perfetc Member
 
VHockey86's Avatar
 
Join Date: Jan 2003
Location: Maryland Suburbia
Posts: 4,327
flash actionscript question

Anyone have some experiance with Actionscript in Flash?
I'm not much of a programmer unfortunately so my abilities are kind of limited here
Basically I am making a really simply preloader for about a 1 meg flash video (just to let those on dialup know its actualy loading something...).

Ne ways, its a super basic non graphical one (I couldnt figure out how to make the progressbar componet included in flash mx 2004 do anything...)

Basically its just a dynamic text box that has text loaded into it by action script
Code:
onClipEvent (enterFrame) {
	var bytes = _root.getBytesTotal();
	var bytes_loaded = _root.getBytesLoaded();
	if (bytes_loaded == bytes) {
		_root.gotoAndPlay(2);
		this.kirupatxt = "movie loaded";
	} else {
		_root.gotoAndStop(1);
		this.kirupatxt = "loading (" + bytes_loaded + "/" + bytes +")";
		
	}
}
"kirupatxt" is the name of the dynamic text box that was converted into a movie clip

The above script is from some tutorial I found online

Ne ways, I modified it very slightly so that it would display the percent as well
Code:
onClipEvent (enterFrame) {
	var bytes = _root.getBytesTotal();
	var bytes_loaded = _root.getBytesLoaded();
	var progress = bytes_loaded / bytes * 100
	if (bytes_loaded == bytes) {
		_root.gotoAndPlay(2);
		this.kirupatxt = "movie loaded";
	} else {
		_root.gotoAndStop(1);
		this.kirupatxt = "loading (" + bytes_loaded + " Bytes" + "/" + bytes + " Bytes" + ")" + "\r" + "Progress: " + progress + "%";
		
	}
}
It works... but it shows the percentage as what I would call a "long" integer format (I think tahts what it was called in visual basic, only programing experiance ive ever had - about 2 years ago so i forgot most of that lol).

Just wondering how I can control the number of decimal places it displays, or if its easier, just to display it as whole numbers rather than any decimals.

Thx,
Vhockey86

VHockey86 is offline   Reply With Quote
Old August 23rd, 2004, 09:30 PM     #2 (permalink)
Perfetc Member
 
VHockey86's Avatar
 
Join Date: Jan 2003
Location: Maryland Suburbia
Posts: 4,327
bump for the evening crowd

VHockey86 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
help? - how do you make a "download files" button from a flash movie? stride-noble Multimedia and Audio 0 June 14th, 2004 04:55 PM
Flash Game Sir Robert Webmastering and Programming 17 September 13th, 2003 11:49 PM
Changing Actionscript in Flash MX poopeyhed2 Graphic Design and Digital Photography 24 January 23rd, 2003 05:20 PM
FLASH - do you like it? Do you work with it? edwelly Webmastering and Programming 14 November 4th, 2002 08:45 PM
diff between flash and shockwave?? Chooco Graphic Design and Digital Photography 8 March 14th, 2002 03:40 PM

Most Active Discussions
Is It Just Me? (2906)
Unarmed man on his stomach shot by .. (6)
Misery Loves Company... (2144)
New Build ( Finally ) (7)
CPU wont boot (7)
Building a gaming computer advice (5)
I think I just killed my computer w.. (24)
RCA 52Inch HDTV wont turn on (5)
Folderchat Weekday thread (444)
Recent Discussions
Please help! multiple problems! (4)
How to transfer music from iPod.. (0)
How to Free Convert FLV to DVD .. (0)
RCA 52Inch HDTV wont turn on (5)
New Build ( Finally ) (7)
Common Spyware Solutions (97)
How do you move a hard-drive to.. (4)
Laptop proccesor to desktop mob.. (1)
What is the best external enclo.. (0)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 03:53 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28