external swf (?)
- Started
- Last post
- 29 Responses
- blackspade
quick question;
Working on this Virtual Tour,
http://webdev1.otago.ac.nz/Virtu…The campus map has Hotspot buttons. Each of which needs to link to an external swf file on click, that loads within the original map framework above.
Currently I have this script on each button hotspot;
on (release) {
_root.mc.loadMovie ("downstairs_isb.swf");..But when I check this on a dial-up (or outside of my work) it takes forever to load the swf's
Am I going the wrong way about this ? ..what happens when you try to click an area on the map? (only some are active)
thanks for any help in advance
=)
- JazX0
you're probably going about the right way man, but the dial-up is taking a while.
- Anarchitect0
use a dummy textfield to display the percentage loaded for each section.
then you'll know if it's working properly.
- blackspade0
the preloader is working tho,
its the actual time it takes between clicking the hotspot, and anything to happen
theres like a 5-10 second delay
then the preloader works fine and it loads the swf, I just dont get the stalling :(
- blackspade0
when you guys click one of the areas on the map, does anything happen ?
thanks!
- Anarchitect0
it maybe from your server. the bigger the swf, the bigger the delay.
- blackspade0
yea that may be it,
each external swf is only like 50k tho
- blackspade0
so you would use this;
on (release) {
_root.mc.loadMovie ("downstairs_isb.swf ");..to call an external swf from a button?, just to clarify.
- Anarchitect0
never use a button. make movieclip and use a onPress event [button MC].
mcbutton.onPress = function(){
this._parent.mc.loadMovie ("downstairs_isb.swf ");
}that way you can centralize your code in one layer only.
I use this._parent. becuase playing with _root can be tricky when using external swf that also call _root. use hierarchical 'calling'. _parent._parent....
you can even make root=_parent._parent and then use that variable
- blackspade0
thanks
- airey0
maybe it's worth your while to preload all the xternal swf's at the start of the main swf?
- blackspade0
hmmm probably
but them I have 12- 13 external's @ 50 - 60 k each, = 600k+ preload
too much ? its gotta be dial-up friendly
- airey0
you don't actually have to make the preloader load the 100% before showing content.
you could preload in the background the whole site (load into mc's rather than levels) and choose a particular kilobyte point to run from. while it's running and people have some initial content to view, the rest are loading (in very little time).
basically the average user wouldn't even know it was going on in the background.
- lvl_130
hey airey, would you mind posting an example by any chance? that is one thing i have never really done before (or figured out for that matter : \
- blackspade0
sounds fantastic in theory, but im afraid my Flash skills are 'plod along and learn as I go'
how hard is that sort of thing to implement ?
- airey0
it's pretty easy (i can do it and i blow so you guys won't have any probs!)
useful links (look through the installed flash help pages also, not to bad) - some of these may not be great, i mainly use actionscript.org, ultrashock and a few others:
http://www.nunomira.com/tutorial…
http://www.bokelberg.de/actionsc…
http://www.actionscript.org/tuto…
- Beech0
I have noticed a similar delay on the external swf files on my site. I didn't realise there would be a difference between buttons and an mc acting like a button as Anarchitect suggested.
i was planning to make them load in the background like airy suggested, basically by having instances of them in the main timeline with their own pre-loader.
Is that what your are suggesting airy?
- lvl_130
thanks airey. i'll check it out
- airey0
beech: yep.
i'm going to use that no-btn thing from now also, snds like it should speed things up although for blackspade's issue it's probably the actually server speed rather than the method flash uses? maybe?
- blackspade0
yes I think it is a server issue, its just running of a test shared folder on my machine
Ive changed the buttons to MC's, pretty farkin easy really
chur, i'll chek those links 2
thanks airey ;)
- Beech0
yeah, me too. Also when I test my site locally there is no delay at all (no downloading either but the delay seems occurs b4 the percentage bar even starts so thats not what i'm worried about)
Maybe unfitforprint or another flash guru on here can explain why :)