setProperty not a function error

24 views
Skip to first unread message

Eric Cooper

unread,
Aug 29, 2015, 11:05:44 AM8/29/15
to myprojectguide
If I hardcode the following into my webpage I have no issue with being able to access the setProperty function:

<object type="application/x-shockwave-flash" data="VideoIO.swf"  id="video3" width="320" height="240" style="display:none">
    <param name="quality" value="high" />
    <param name="bgcolor" value="#000000" />
    <param name="allowFullScreen" value="true" />
    <param name="allowScriptAccess" value="always" />
    <param name="flashVars" value="controls=true" />
</object>


But if I try to dynamically add the same thing, whether it by using swfobject.js or just adding the html to my div with JavaScript, then it doesn't work.  The resulting html in all cases is 100% the same so I'm not sure what the issue is.

The function to add the object is actually being triggered by a broadcast event from another browser (via SignalR)....so the target page is already completely loaded and just sitting there.  When it receives the message, the JavaScript function fires to add the VideoIO object and then it should set the "src" property in order to start receiving the feed.

Like I said, if I have the object hardcoded and just sitting there waiting for the broadcast and set the "src" it works fine.  When I try make the creation of the object be dynamic, though, then it doesn't work.  I'm guessing there's something there's something that happens during the load of the page when it first loads this object that is missing when I try to do it after the fact.

Any ideas on how to make this work would be much appreciated.

Eric Cooper

unread,
Sep 1, 2015, 12:18:16 PM9/1/15
to myprojectguide
Ok sorry, I'm new to flash programming.  I didn't realize that it takes a little bit before the component loads up and is available.  I added code into the onCreationComplete function to set the source property and that has worked.
Reply all
Reply to author
Forward
0 new messages