Archive for the ‘Browser’ Category
ActionScript 3.0: using JavaScript to open new window with fixed size
wanna open a fixed size window from within Flash?
here’s a version that helps you on your way:
function openSizedWindow(e:MouseEvent):void {
var jscommand:String = "window.open('http://www.campjohn.dk/wp/','win','height=200, width=300,toolbar=no,scrollbars=yes');";
var url:URLRequest = new URLRequest("javascript:" + jscommand + " void(0);");
navigateToURL(url, "_self");
}
check it out here:
http://campjohn.dk/AS3/FixedSizeWindow/test.html
test-results OK;
PC: Firefox, Safari, IE – Mac: Firefox
test-results not OK;
Mac: Safari
any ideas of improvement?
problems: Flash in Firefox uses 100% of CPU
have you ever experienced, that a Flash you’ve made works like a charm in every browser, except from when testing on PC using Firefox; there the Flash slowly eats the entire CPU of the computer and finally everything freezes and your computer won’t respond to any action?
well, I have more than once, and recently I decided to do something about it.
here’s the Flash that maybe will kill the Firefox browser on your PC
be sure to keep an eye on the use of the CPU if you click this link and use Firefox.
if the useage of the CPU keeps increasing I recommend closing that tab.
by the way, I’ve found that the link above works without any problem on:
MAC OS 10.4.11 Firefox Version 3.0.6
MAC OS 10.4.11 Camino Version 2006091101 (1.0.3)
MAC OS 10.4.11 Opera Version 9.02
MAC OS 10.4.11 Safari Version 3.2.1 (4525.27.1)
PC Vista Business Google Chrome Version 1.0.154.48
PC Vista Business Opera Version 9.62 build 10467
PC Vista Business Safari Version 3.2.1
PC Vista Business Internet Explorer Version 7.0.6000.16809
PC XP Home Internet Explorer Version 6.0.2900.5512
PC XP Home Firefox Version 3.0.6
but with these setups:
PC Vista Business Firefox Version 3.0.6
PC Vista Business Firefox Version 3.0.7
PC Vista Home Firefox Version 3.0.6
PC XP Professional Firefox Version 3.0.6
PC XP Professional Firefox Version 3.1 beta 3
it consumes the entire CPU of your computer.
so far the link above is tested on 5 different machines, and everytime the problem occurs when using Firefox. and furthermore, I’ve never seen the problem on Mac..
—–
to see the Flash properly on PC and in Firefox I have to make a very simple change to the way the Flash is set up, I have to make sure that the Flash’ wmode is set like this:
wmode: “window”
and NOT like this
wmode: “transparent”
SO, if you had trouble with the first link in this post, try this link instead, this is with wmode set to window and not transparent, hopefully this gives you no problems at all.
here’s the Flash that probably will not kill your Firefox browser
hope this comes in useful :O)
problems: bandwidth profiler bug and Firefox 3 without sound
working on a project, I tried measuring the size of the stage at runtime.
so to test how to do it, I made a new empty flash file, with this actionscript as the only content in the flash file
my flash file was 300 px wide and 290 high, and I was very surpriced when my flash traced this:
stage.stageWidth = 300 stage.stageHeight = 190
what happened with the height?
it made no sense at all.
later I discovered, that when testing my file without having the bandwidth profiler open, it traced this instead:
stage.stageWidth = 300 stage.stageHeight = 290
so crazy.
apparently Flash has a bug that withdraws 100 px from the height, if the flash file is tested with the bandwidth profiler open. I’ve tested both the CS3 version on Mac OS X and Windows Vista.
—–
when downloading the newest version of my favorite browser I was very much looking forward to trying it. but at one point I was truly dissapointed.
unfortunately Firefox 3 is launched with a bug that disables all sound from Flash – in my case Flash Player 9,0,124,0.
i. e. this means that no sound will be heard from any video on youtube.com.
bummer.
but there is a solution:
I opened Firefox 3, clicked Tools, Add-ons, Plugins and then deactivated and then activated the Shockwave Flash plugin.
all sound was back.
another solution should be upgrading to Flash Player 10, but as this still is a beta-version, I suggest the solution above..