[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Flash and onresize don't play well together

Posted on 2001-08-08
10
Medium Priority
?
166 Views
Last Modified: 2012-08-14
I've got a Web page I'm building with a Flash "applet" and a little dynamic HTML both. IE, not surprisingly, takes these together just fine. But Netscape 4 (4.78, to be exact) doesn't like them together.

Whenever I put the Flash applet in the page, resizing the browser window fails to fire the window.onresize event (I've used an alert() to confirm this). If I take the applet out, the onresize event fires correctly and the DHTML layout is recalculated.

Has anyone else encountered this, and perhaps know of any workarounds?
0
Comment
Question by:mblase
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 

Expert Comment

by:setien
ID: 6365265
I haven't encountered but, it doesn't surprise me. Netscape 4 is so full of little quirks and bugs like that.

If you are in desperate need, you use setInterval() and a function that checks the windows dimensions every 5 milliseconds or so to simulate the behaviour.

If you think that's an ok solution, I can do the code for you.
0
 

Expert Comment

by:setien
ID: 6365387
I tested this in netscape 4.7 and IE 5.5, and it worked like a charm.
If you want it to react to resize faster, then change the value 1000 to something less in the line
setInterval(testResized, 1000);

Hope that works for you :)

---


<html>
<head>

<SCRIPT language="JavaScript">

window.onresize = function() {
     alert("I resized");
     }
     
if(navigator.appName.indexOf("Microsoft") == -1) {
     testResized.innerWidth = window.innerWidth;
     testResized.innerHeight = window.innerHeight;
     setInterval(testResized, 1000);
}

function testResized() {
if(window.innerWidth != testResized.innerWidth || window.innerHeight != testResized.innerHeight) {
     testResized.innerWidth = window.innerWidth;
     testResized.innerHeight = window.innerHeight;
     window.onresize();
     }
}

</SCRIPT>

</head>
<body>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="50" height="50">
  <param name="movie" value="test.swf">
  <param name=quality value=high>
  <embed src="test.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="50" height="50">
  </embed>
</object>
</body>

</html>
0
 
LVL 2

Author Comment

by:mblase
ID: 6366013
I'm afraid that didn't work at all. I finally did hit upon the one solution that did make a difference, however: block the page from being cached. I used     &lt;meta http-equiv="Expires" content=""&gt; to do the trick.


When that happens, any of the myriad "netscape resize bug" fixes out there will load the new page from the internet rather than the browser cache, which was causing my problems.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Expert Comment

by:setien
ID: 6366089
What do you mean it didn't work at all? Did it return errors?
It did excactly what you asked for : It worked around the fact that netscape doesn't fire the onresize event.

If you want an answer to something other than that, I believe you should ask it in a different way. What you initially asked for had nothing to do with page reloading.

I believe I provided a valid solution to your question, and thus should be rewarded with the points.

Regards,
Brian
0
 
LVL 2

Author Comment

by:mblase
ID: 6367766
I mean that it didn't work at all; it didn't fix the resize problem on my machine. The DHTML still didn't recalculate, and I had to try a different solution.

I'm sorry you feel slighted, but that's exactly what happened.
0
 

Expert Comment

by:setien
ID: 6367788
Ah - it's the event itself you are missing, not the onresize function.

You can reload the page on resize, if that's a viable option, and that will work.

I haven't tested the code below, but it should solve your problem.

---

<html>
<head>

<SCRIPT language="JavaScript">

window.onresize = function() {
    window.document.location.reload();
    }
   
if(navigator.appName.indexOf("Microsoft") == -1) {
    testResized.innerWidth = window.innerWidth;
    testResized.innerHeight = window.innerHeight;
    setInterval(testResized, 1000);
}

function testResized() {
if(window.innerWidth != testResized.innerWidth || window.innerHeight != testResized.innerHeight) {
    testResized.innerWidth = window.innerWidth;
    testResized.innerHeight = window.innerHeight;
    window.onresize();
    }
}

</SCRIPT>

</head>
<body>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="50" height="50">
 <param name="movie" value="test.swf">
 <param name=quality value=high>
 <embed src="test.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="50"
height="50">
 </embed>
</object>
</body>

</html>
0
 
LVL 2

Author Comment

by:mblase
ID: 6368234
Thanks, but I already said that I've solved the problem myself.
0
 
LVL 12

Expert Comment

by:ahosang
ID: 7956030
This question has been abandoned. I will make a recommendation to the moderators on its resolution in a week or two. I appreciate any comments that would help me to make a recommendation.
 
In the absence of responses, I may recommend DELETE unless it is clear to me that it has value as a PAQ. Silence = you don't care
ahosang
EE cleanup volunteer
0
 
LVL 12

Expert Comment

by:ahosang
ID: 7998915
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

ahosang
EE Cleanup Volunteer
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 8077711
Per recommendation, points refunded and question closed.

Netminder
EE Admin
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question