Also for javascript troubleshooting, I tend to use alert statements after I
define variables to make sure they are showing what I expect. Another
option is to do something with document.write or setting the innerHTML of a
div called "debug" so you can always see what's going on.
i.e. define a function called logError(message)
logError either changes the innerHTML of a new div you create called "debug"
(or whatever you want to call it)
i.e.
document.getElementById("debug").innerHTML = message;
and then you just call logError() everytime you want to see the value of
something. i.e. message = document.getElementById("pageTitle").innerHTML
alerts are easier, but because they stop execution of any other script until
you hit "OK", sometimes that's not acceptable or changes the conditions that
you are trying to test for.
Hope this helps,
Vincent
On Wed, Jul 22, 2009 at 12:31 PM, Vincent Polite <
[email protected]> wrote:
> Do you have a publicly accessible link? Taken at face value passing a
> string literal into the flashvars the way you are isn't going to make
> SWFObject choke in any way. The snippet you've provided seems correct, so I
> actually expect the issue to be something on your SWF's side. Suppose you
> put in a nonsense variable that has nothing to do with your parentXML value
> (presuming that your movie can load without parentXML specified)... does
> this also break SWF?
>
> i.e. flashvars.nonsense = "foo";
>
> This seems odd and certainly nothing that I've encountered before. I pass
> strings to SWFObject Flash movies via flashvars all the time.
>
> Vincent
>
>
> On Wed, Jul 22, 2009 at 11:14 AM, Chris <[email protected]> wrote:
>
>>
>>
>> Thanks for your help (Kyle & Vincent)
>>
>> I'll look into JSON for converting the objects into "portable string
>> notation." However swfobject still breaks (doesn't embed the flash) as
>> soon as I attempt .innerHTML or .value. For example, the code below
>> still breaks swfobject:
>>
>> var parent1 = document.getElementById('pageTitle').innerHTML;
>>
>> var flashvars = {};
>> flashvars.parentXML = "String Literal";
>> var params = {};
>> var attributes = {};
>>
>> swfobject.embedSWF("flash/pageTitle.swf", "pageTitle", "510", "150",
>> "9.0.0", "expressInstall.swf", flashvars, params, attributes);
>>
>> Same goes with:
>> var parent1 = document.getElementById('pageTitle').value;
>>
>> I don't know what exactly my getElementByID('pageTitle') is grabbing.
>> I'm used to doing traces inside of Flash. I'm rather lost when it
>> comes to figuring out what the javascript is doing with what I tell
>> it. All I know is what the actual html in question is:
>>
>> <div id="pageTitle"><h2>About Our Partnership & Services</h2></div>
>> >>
>>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SWFObject" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/swfobject?hl=en
-~----------~----~----~----~------~----~------~--~---