I've just started with SWFObject. Basically I need it to use SWFAddress, to deeplink with url queries.
Getting a page up and running has been no problem, but testing/tracing is. How can I get the debugger in Flex Builder to listen to a debug swf embedded in html using SWFObject, rather than its own Flex Builder generated page?
This is not a SWFObject question per se. So I apologize if I'm diluting your focus. But maybe this will be a common problem?
This text is replaced by the Flash movie. </div> <script type="text/javascript"> var so = new SWFObject("Shell.swf", "Shell", "800", "600", "9", "#999999"); so.addVariable("indices", getQueryParamValue("indices")); so.write("flashcontent"); </script>
No indication that SWFObject is working, I think because of all the javascript errors:
Severity and Description Path Resource Location Creation Time Id Fatal error - The string "--" is not permitted within comments. Pet_Theory/bin Shell-debug_SO_insert.html line 13 1167440547157 33676 Fatal error - The string "--" is not permitted within comments. Pet_Theory/bin Shell-debug.html line 12 1167437451066 33590 Fatal error - Open quote is expected for attribute "id" associated with an element type "object". Pet_Theory/bin history.htm line 11 1167438526923 33601 Error - The content of element type "head" is incomplete, it must match "((script|style|meta|link|object|isindex)*,((title,(script|style|meta|link|object|isindex)*,(base,(script|style|meta|link|object|isindex)*)?)|(base,(script|style|meta|link|object|isindex)*,(title,(script|style|meta|link|object|isindex)*))))". Pet_Theory/bin history.htm line 8 1167438526922 33600 Error - Attribute "type" is required and must be specified for element type "style". Pet_Theory/bin Shell-debug_SO_insert.html line 8 1167440547157 33675 Error - Attribute "type" is required and must be specified for element type "style". Pet_Theory/bin Shell-debug.html line 7 1167437451066 33589 Error - Attribute "type" is required and must be specified for element type "script". Pet_Theory/bin Shell-debug_SO_insert.html line 6 1167440547156 33674 Error - Attribute "type" is required and must be specified for element type "script". Pet_Theory/bin Shell-debug.html line 6 1167437451014 33588
Hmm, knowing even less Javascript than HTML, I'm totally winging it, and it didn't work. Here's the original page. minus the commented out player-detection part:
you need to provide a div to place the swf into... like in your first example:
<div id="flashcontent">
This text is replaced by the Flash movie. </div> <script type="text/javascript"> var so = new SWFObject("Shell.swf", "Shell", "800", "600", "9", "#999999"); so.addVariable("indices", getQueryParamValue("indices")); so.write("flashcontent"); </script>
I'm not sure how flex handles tracing in the browser, though... are there other elements on the page that the swf needs to talk to in order to handle the traces?