Comments (8)
Added from the SWFFix version 0.3 public alpha discussion [
http://www.swffix.org/devblog/?p=12#comments ] and probably related:
===
# Ted Godwin Says:
September 12th, 2007 at 11:30 am
I am having an issue with IE7 (using Windows XP) which can be viewed here:
http://www.thermosites.com/ball/ball2.html
This displays a simple red circle in the middle of the screen… until the page
is
refreshed. After reload, the circle is continusously placed in the top left
corner
(again, only an issue with IE7).
The default javascript code provided by Flash works (ball1.html). Honestly
I’d rather
use your object as it makes more sense. Event listeners in the AS3 code can be
used
to resolve this issue, but I wanted to point this out.
Thanks for your work. It’s a valuable tool for the entire Flash community.
===
Bobby Says:
September 13th, 2007 at 4:23 am
The default code provided by Flash has its alignment set, while this isn’t
done in
the SWFFix version. This will probably solve your issue.
===
# Ted Godwin Says:
September 27th, 2007 at 12:21 pm
I tried setting the alignment in SWFFix but there is still a glitch with IE7.
Once
again: it only appears after the page is refreshed. See for yourself at:
http://www.thermosites.com/ball/ball2.html
This is supposed to display a red cirle in the middle of the screen. I tested
this
under IE7, Safari, Opera, Firefox and Netscape. IE7 is the only one that does
not
refresh correctly. Once again this does not happen with Flash’s default code
(ball1.htm).
The flash file is a blank document with the following code:
//**** BEGIN FLASH9 AS3 CODE ****
//Define stage sizing and scaling
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
//Draw a red circle.
graphics.beginFill(0xFF0000);
graphics.drawCircle(stage.stageWidth/2, stage.stageHeight/2, 100);
graphics.endFill();
stop();
//**** END FLASH9 AS3 CODE ****
Copy this into the first keyframe, compile, embed with SWFFix and you will see
what I
am talking about.
===
# Ted Godwin Says:
September 27th, 2007 at 4:48 pm
Something about IE7 causes the stage to trigger Event.RESIZE within AS3 upon
loading.
This is not apparent in any of the other browsers nor does this happen with the
default javascript supplied by Flash. Dare I jump in and explore the JavaScript
code?
===
# Bobby Says:
September 28th, 2007 at 4:15 am
@Ted: Please be our guest :-)
Please note that with static publishing (method 1) in IE6+ and Opera9+ a SWF
will be
replaced by itself as soon as the window onload event fires, this to avoid the
click
to activate content. With dynamic publishing (method 2) a SWF just replaces
alternative HTML content, so probably the resize won’t occur here.
Original comment by bobbyvandersluis
on 4 Oct 2007 at 9:32
- Changed state: Accepted
from swfobject.
Original comment by bobbyvandersluis
on 4 Oct 2007 at 9:32
from swfobject.
I looked into the issue and found the following:
- With IE6 or 7 and the static publishing method, or with Adobe's dynamic embed
method, the stage size is available both on first load and on reload (or if you
browse on and surf back e.g. via the browser back button)
- With IE6 or 7 and the dynamic publishing method, or with UFO, the stage size
is
available on first load, however is 0 on reload (or if you browse on and surf
back
e.g. via the browser back button)
The interesting bit, which was already noted by Ted, is that obviously the Flash
player team already previously encountered this issue, because the Flash player
itself triggers the stage.resize event (and keeps on triggering it) until it
receives
its current value.
My opinion is that it is a feature that comes with how Internet Explorer
displays web
pages and manages its cache. The only way to prevent this is to add to listen
for a
resize event and center your assets accordingly (this will most developers do
anyway,
because people can resize their browser window), e.g.:
stage.addEventListener(Event.RESIZE, resizeHandler);
function resizeHandler(event:Event):void {
// center stuff
}
This issue is not caused by SWFObject, however publishing with SWFObject is
affected
by it. I will probably make a technote of it in a later stage.
Original comment by bobbyvandersluis
on 9 Oct 2007 at 3:54
- Changed state: WontFix
from swfobject.
Original comment by bobbyvandersluis
on 16 Oct 2007 at 1:48
- Added labels: Type-Other
- Removed labels: Type-Defect
from swfobject.
Original comment by bobbyvandersluis
on 16 Oct 2007 at 1:49
- Changed state: Verified
from swfobject.
This is also a problem even for dynamically sized flash components where window
resizing doesn't affect the size of the flash object but its size is variable
from
page to page within a website. After a lot of trial and error I have found
that this
strategy works well, I hope it will help someone else.
public function Object(){
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeHandler);
this.start();
}
public function start(){
if(stage.stageWidth > 0 && stage.stageHeight > 0){
//add objects to stage etc.
}
}
public function resizeHandler(event:Event):void {
if(stage.stageWidth > 0 && stage.stageHeight > 0){
this.start();
}
}
The first call to start() will work for firefox, etc. and the resizeHandler
will call
it for ie7 after the stage size has been initialized. I have no idea why
resizeHandler does not keep getting called after it has worked once, but I
swear that
this works for me - while every other method I tried to ensure that start()
would be
called only once did not. My guess is that the resize event stops getting
called as
soon as a real value for stageWidth and stageHeight is set.
Original comment by [email protected]
on 29 Jan 2008 at 4:28
from swfobject.
Does anyone have a workaround for this based in AS2. I'm now encountering this
problem with a website I just launched live so I need to fix this a.s.a.p..
Original comment by [email protected]
on 15 Aug 2009 at 3:57
from swfobject.
The way I did it...
If the swf sita in a webpage, if its not dinamically resizable, pass width and
height
of object with 2 flashvars.
If its dinamically resizable, use a javascript that intercepts resizing, then
sends a
ExternalInterface call to the swf with the new dimensions.
it works
love
Original comment by [email protected]
on 17 Jan 2010 at 11:37
from swfobject.
Related Issues (20)
- SWFObject 2.2 not working in IE10 windows7 32bit
- rtmp live streaming not playing when paused
- Broken in IE 11 HOT 3
- Embedding google drive videos with swf object
- problem with IE 11. HOT 3
- IE11 issues with 2.2 and 2.3a even with issues671 modify HOT 2
- Preloader only shows up in Firefox, Chrome and Safari….not in IE
- swfobject.embedSWF function is coding & to &
- IE11 plugin detection fails HOT 2
- who is MIT-Licensor of SWFObject ? HOT 3
- script acccess not working in ie11 HOT 1
- Flash Display Font Issue
- fmyblog
- i can use for PHPBB forum ?
- On Mac Safari, when older version of flash is disallowed and user does not upgrade, swfobject detects flash as enabled HOT 1
- Patch for /trunk/swfobject/src/swfobject.js
- swfobject.embedSWF() fails when using IE compatibility mode HOT 1
- callDomLoadFunctions() hangs when called after dom ready
- Version of Flash Player plugin isn't detected in Google Chrome 39.0.2171.99 (Official Build)
- Recommended Updates for IE11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swfobject.