all groups > flash actionscript > december 2005 >
You're in the

flash actionscript

group:

OpenURL problems with preload


OpenURL problems with preload majkinetor
12/10/2005 4:55:27 PM
flash actionscript: I use this code to preload main.swf which is in main.html

mcl.addListener(mcl_listener);
mcl.loadClip("Main.swf",99);

mcl_listener.onLoadComplete = function (target:MovieClip){
getURL('main.html', _self);
}

But main.html doesn't load in same window but in new one. I tried all other
target kewords with same effect.
This is the flash:
www.r-moth.com

Re: OpenURL problems with preload kglad
12/10/2005 5:51:57 PM
if mcl is a moviecliploader, then mcl.loadClip("Main.swf",99); will load
Main.swf into _level99.

getURL('main.html',_self);

will load into a new window.

i'm not sure what you want to do. but it probably doesn't make sense to have
both of those statements and your 2nd statement should be
getURL('main.html',"_self");
Re: OpenURL problems with preload majkinetor
12/11/2005 11:20:13 AM
2 KGlad

I am using this method to put main.swf into the cache, so when I load
main.html via getURL, only the html is loaded since swf is already in the
cache. So, I use MovieClipLoader to load swf in some arbitrary level and after
the loading is finished I load html page that contains the swf.

If there is some better approach to this, let me know. I must do it this way,
because first page on my site must be html and second which contains main swf
for the site must also be in the html (that is, I can't use preloader that is
inside my main swf, on first frame)

So it makes sense to have both of those statements (loadClip, getURL) because
first one will return percentage information and second one will load html,
once loader finished.
Re: OpenURL problems with preload kglad
12/11/2005 3:22:43 PM
try:

mcl.addListener(mcl_listener);
mcl.loadClip("Main.swf",99);

mcl_listener.onLoadComplete = function (target:MovieClip){
getURL('main.html', "_self");
}

p.s. why's the 2nd page have to be a html page?


Re: OpenURL problems with preload majkinetor
12/11/2005 4:13:10 PM
Yes you are right, I missed "" somhow. I previously solved the problem by
putting the absolute path to main.html but this is cleaner.

I need second html because I need to align flash and shrink it to 80%. I guess
this whole thing can be done via some JavaScript in one page but that could
generate html and those few div tags for alignment, but, at the beginning, I
didn't want to depend on JavaScript. I forgot I have to check Flash version.
AddThis Social Bookmark Button