Unfortunately as I mentioned in the first post, AS3 RESIZE EVENT is not triggered in my situation. Besides I cannot use NO SCALE since it conflicts with my JavaScript part of code.
But I’ve found another solution. I uses JavaScript in order to detect real browser width and send that data into flash (via AS3 EXTERNAL INTERFACE) every time browser is resized:
JavaScript part:
var browser_width;
window.onresize = send_browser_width; // detect browser resizing
function send_browser_width(){
browser_width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; // check browser width
document.getElementById(“SWF_object”).browser_resized_call(browser_width.toString()); // send browser width into flash
// the above line of code may vary according to browser version and swf embedding method - it must be checked which browser is used before sending data into flash. So it may be also:
document.embeds[“SWF_object”].browser_resized_call(browser_width.toString());
// or
document.embeds.SWF_object.browser_resized_call(browser_width.toString());
// or
window[“SWF_object”].browser_resized_call(browser_width.toString());
// or
window.SWF_object.browser_resized_call(browser_width.toString());
// or
window.document[“SWF_object”].browser_resized_call(browser_width.toString());
// or
window.document.SWF_object.browser_resized_call(browser_width.toString());
// or
document.SWF_object.browser_resized_call(browser_width.toString());
}
NOTE:
(swf embedding parameter: allowScriptAcces must be set to ‘always’)
AS3 part:
var view:View3D = new View3D();
var view_proportions:Number = 1200/600; // custom proportions (width/height) of the view3D - can be 6/2, 600/200 and so on…
ExternalInterface.addCallback(“browser_resized_call”, browser_resized);
// this function is called by JavaScript every time browser is resized
function browser_resized(browser_width:String):void {
view.width = Number(browser_width);
view.height = Number(browser_width) / view_proportions;
}
NOTE:
Additionally, view3D resizing must be triggered (for the first time) after finishing to prepare scene3D (just before adding view3D to DisplayList):
ExternalInterface.call(“send_browser_width”); // call JavaScript function (function that normally is triggered by browser resizing)
Since EXTERNAL INTERFACE works fine in most new browsers, I think I will stick with this solution.
As you can see on the attached JPGs, this time everything works fine.
Thanks for your posts and advice “Mu Duck”.
Regards