Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 09-05-2008, 04:40 AM   #1
Senior Member
Join Date: Feb 2006
Location: Washington, DC
Posts: 2,812
Send a message via AIM to abeall
Default HTMLLoader.window

I'm really confused about the behavior I'm getting from HTMLLoader.window. Follow the traces:
ActionScript Code:
import flash.html.*; var htmlLoader = HTMLLoader.createRootWindow(); htmlLoader.loadString("<html><script language='Javascript'>function testFunc(){alert('test')}</script><body><p>Hello World</p></body></html>"); htmlLoader.addEventListener("htmlDOMInitialize",htmlDOMInitialize); function htmlDOMInitialize(evt){     trace(htmlLoader.window); // [object DOMWindow]     trace(htmlLoader.window.print); // function print() { [native code] }     trace(htmlLoader.window.window); // [object DOMWindow]     trace(htmlLoader.window.window.print); // function print() { [native code] }     htmlLoader.window.print(); // no error, does nothing     htmlLoader.window.window.print(); // no error, does nothing     htmlLoader.window.testFunc(); // TypeError: Error #1006: testFunc is not a function }

Can anyone explain that mess? What is window.window vs window? Why doesn't print() do anything? Why does testFunc() throw an error -- shouldn't the DOM be initialized?
Aaron Beall | Flash portfolio | Fireworks extensions | Twitter
abeall is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 09:04 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.