View Full Version : Call different movie based on resolution
justANewbie
07-24-2004, 08:11 AM
Hi,
Can someone tell me if a small detection Flash movie can call another larger flash movie to take it's place depending on viewers screen resolution detected with action script. This may have been answered somewhat by the post below "Loading/Unloading Query". But being a newbie at flash I am not sure.
I'm working on a site where I want to load a different page width header movie based on screen resolution. Something a bit like this :-
if screen size =< 800 little movie replaces itself with 800 movie
if screen size = 1024 little movie replaces itself with 1024 movie
if screen size > 1024 little movie replaces itself with biggest movie
If this is possible can someone point me in the direction of a tutorial or some script.
Hope I am not asking to much :)
Cheers
greg
Oz
justANewbie
07-26-2004, 03:39 AM
OK ...... have been doing a bit of searching and have come across this, am I on the right track?
Create a Detector movie with this script in the first frame of a layer called actions. Then attach an action script something like this to it :
this.createEmptyMovieClip("blank_mc", 10);
with (blank_mc){
_x=1;
_y=1;
}
loadMovie("800.swf", blank_mc);
If I am on the right track I still need to detect the screen res and put in the screen res detecting code (don’t even know if action script can detect this yet) that will impliment this sort of thing :
if screen size =< 800 blank movie replaces itself with 800 movie
etc
etc
Am I on the right track or living up to my tag :o
greg
justANewbie
07-26-2004, 04:14 AM
OK, how about something like this ......... haven't tried it yet!
if(System.capabilities.screenResolution.x <= 800){
this.createEmptyMovieClip("blank_mc", 10);
with (blank_mc){
_x=0;
_y=0;
}
loadMovie("800.swf", blank_mc);
}
else if (System.capabilities.screenResolution.x == 1024){
this.createEmptyMovieClip("blank_mc", 10);
with (blank_mc){
_x=0;
_y=0;
}
loadMovie("1024.swf", blank_mc);
}
else {
this.createEmptyMovieClip("blank_mc", 10);
with (blank_mc){
_x=0;
_y=0;
}
loadMovie("Biggest.swf", blank_mc);
}
I see a potential problem with this concept though, if it works at all, and that is that all larger movies maybe clipped to the stage size of the first and smallest movie! I suspect it won't change the stage size dynamically.
greg
justANewbie
07-27-2004, 06:19 AM
Can't get the above to work :( ....... so trying this now.
This seems to process the first if and loads "800.swf" into the original ResDetect.swf movie but won't detect any higher when I test at different resolutions and can't dynamically change the stage size either or doesn't get that far to see. I tried making the 800.swf 1024px in width just as a test, it loads it but clips it to 800!
if (System.capabilities.screenResolution.x <= 800){
loadMovieNum("800.swf",5)
Stage.scaleMode = "exactFit"
}
else if (System.capabilities.screenResolution.x == 1024){
loadMovieNum("1024.swf",5)
Stage.scaleMode = "exactFit"
}
else if (System.capabilities.screenResolution.x == 1152){
loadMovieNum("1152.swf",5)
Stage.scaleMode = "exactFit"
}
justANewbie
07-28-2004, 01:22 PM
Have given up on trying to do it just with flash.
Have worked out how to load one of several different width flash movies, dynamically, depending on viewers screen resolution, using javascript.
Thank you to the person who sent the private message.
Bye :)
greg
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.