|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
newbie preloader question.
Hello all,
I'm following a tutorial here: http://www.absolutecross.com/tutorials/flash/preloader/ and the code for the preloading is as follows; loadedbytes=getBytesLoaded(); totalbytes=getBytesTotal(); loadedkbytes=Math.ceil (loadedbytes/1000); totalkbytes=Math.ceil(totalbytes/1000); if (loadedbytes == totalbytes) { nextScene (); } frame = int(loadedbytes/(totalbytes/100)); tellTarget (_root.loader) { gotoAndStop (_root.frame); } now i pretty much understand it all, except for the last two lines: tellTarget (_root.loader) { gotoAndStop (_root.frame); what is this doing? is it necessary? my understanding is that the telltarget command is to be phased out, but i would still like to understand what the purpose of these last two lines are. thanksNadvance. |
|
#2
|
|||
|
|||
|
furthermore, im getting pissed off that when i try to test my preloader, it only shows up the first time, as once its loaded into my internet cache files i guess, its no longer displayed. how do you guys test your preloaders without it zipping by?
thanks |
|
#3
|
|||
|
|||
|
ok, i know im talking to myself, but should the line
frame = int(loadedbytes/(totalbytes/100)); be frame = int(loadedbytes/(totalbytes*100)); help!!! |
|
#4
|
|||
|
|||
|
I have to say I was entertained by your repeated posts. I'm feeling a bit lazy and don't feel like coding php right now so I'm playing around in the forums...
Anyways, a few replies to follow a few posts: Tell target question: It is deprecated (being phased out, it won't be in later versions). Flash has now adapted an object-oriented way of addressing movie clips/objects/etc. If you wanted to take away the Tell Target, you could simply put: _root.loader.goToAndStop(_root.frame); (I know that will work in MX and should work in 5...let me know if it's not working for you) Your caching problem: In IE, go to 'Tools' -> 'Internet Options' And on the first tab there should be a section labeled 'Temporary Internet Files', click 'Settings' under that section, and select 'Every Visit to the Page' for 'Checking for Newer Versions'. If you aren't using IE, then post the browser and I'll type more then. I'm getting a bit lazy again. And the line you were asking about, it's correct in the original version. It's 'normalizing' the frames between 0 and 100. I haven't looked at the tutorial but I'm assuming it's a status bar that tweens from empty to full in 100 frames? That's why he's dividing by 100. It can be a bit hard to understand all at once so don't worry about it! Keep playing around in flash, it's a wonderful program! (though annoying at times )Peace, panhead490 |
|
#5
|
|||
|
|||
|
hey dude, thanks for your time in responding ot my questions, its totally appreciated.
peace |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > newbie preloader question. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|