ExternalInterface not working when swf file is embed inside a dynamically cloned DIV element.

ExternalInterface not working when swf file is embed inside a dynamically cloned DIV element.
It seems that flash movie is identifed as 'undefined' inside document.
//a statically placed div
var staticdiv=document.getElementById('PropDiv');
//dynamically placed div with object tag
var dynDiv =staticdiv.cloneNode( true );
var xD=50;
var yD=50;
if(dynDiv)
dynDiv.style.display  = "block";
dynDiv.innerHTML="<object classid=" + "\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"" + "codebase=" +
"\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\"" + "width=" + xD + "height=" + yD +
"id=" + "\"external\"" + "align=" + "\"middle\"" + ">" +
                "<param name=" + "\"allowScriptAccess\"" + "value=" + "\"sameDomain\"" + "/>" +
                "<param name=" + "\"movie\"" + "value=" + "\"external.swf\"" + "/>" +
                "<param name=" + "\"quality\"" + "value=" + "\"high\"" + "/>" +
                "<param name=" + "\"wmode\"" + "value=" + "\"transparent\"" + "/>" +
                "<param name=" + "\"bgcolor\"" + "value=" + "\"#ffffff\"" + "/>" +
                "<embed src=" + "\"external.swf\"" + "quality=" + "\"high\"" + "wmode=" + "\"transparent\"" +"bgcolor=" + "\"#ffffff\""
+ "width=" + xD + "height=" + yD + "name=" + "\"external\"" + "align=" + "\"middle\"" + "allowScriptAccess=" + "\"sameDomain\"" +
"type=" + "\"application/x-shockwave-flash\"" + "pluginspage=" + "\"http://www.macromedia.com/go/getflashplayer\"" + "/>" +
                "</object>";
   dynDiv.style.top=50;
   dynDiv.style.left=100;
document.body.appendChild(dynDiv);
In above situation communication is not establised when a  funtion which is retruning boolean is called from flash using
ExternalInterfcae.call.The return value of this function is getting as false inside flash.But the value is true in javascript.
if (navigator.appName.indexOf("Microsoft") != -1) {
   return window[movieName];
  } else {
   return document[movieName];
window["external"] is returning as 'undefined'.
Please give a  solution to solve this.

Note that you have different file names for the object (images/banner.swf) and the embed (images/banner1.swf)
You also placed the embed in the middle of a param tag and nested all param tags.
Because you didn't include a MIME type and the object doesn't have a classid for an ActiveX control for IE, I'm not sure what Firefox will be using.<br />
The object doesn't have a data attribute to specify the file.<br />
A separate embed is only needed when you specify a classid in the object.
<pre><nowiki><div class="bannercontainer">
<object width="940" height="445" type="application/x-shockwave-flash" data="images/banner.swf" >
<param name="wmode" value="transparent" />
<param name="movie" value="images/banner.swf" />
</object>
</div></nowiki></pre>

Similar Messages

  • GetURL not working when swf is loaded into another swf

    Ok, I need some help for something relatively simple which
    for some reason I've not been able to find any information on at
    all?
    Hopefully it will be something easy to fix.
    Essentially I have the following:
    my main movie "Home.swf"
    another movie "Sub.swf"
    I've loaded "Sub.swf" into "Home.swf" via an empty movieclip.
    Within "Sub.swf" I have some links which when clicked call
    getURL and open a HTML page in the browser.
    But for some reason the getURL isn't working and I believe
    its because the getURL is called from a loaded movie within
    "Home.swf".
    I've tried changing the actionscript to:
    _root.getURL('/mypage.html');
    _parent.getURL('/mypage.html');
    but neither (_root / _parent) seems to work?
    Need help here please.
    Many thanks.
    Kind regards,
    M.

    Hi kglad,
    Yes the button is definitely firing ok.
    In the "Sub.swf" movie, on the second frame of the timeline
    (the first frame is some preloader code) there is the following
    code:
    imgMC.mascara.onPress = function() {
    //trace('mc[activo] = ' + mc[activo]);
    switch(mc[activo])
    case _level0.imgMC.MC0:
    trace('0 - ' + mc[activo])
    break;
    case _level0.imgMC.MC1:
    trace('1 - ' + mc[activo])
    break;
    case _level0.imgMC.MC2:
    trace('2 - ' + mc[activo])
    break;
    case _level0.imgMC.MC3:
    trace('3 - ' + mc[activo])
    break;
    case _level0.imgMC.MC4:
    trace('4 - ' + mc[activo])
    break;
    case _level0.imgMC.MC5:
    trace('5 - ' + mc[activo])
    break;
    If I run this movie in Flash (ctrl-enter) then the trace
    works fine.
    But the trace stops working when I run the main "Home.swf"
    movie in Flash (ctrl-enter) when the "Sub.swf" is loaded into an
    empty movie clip.
    And when I change the trace for a getURL and test in a
    browser it still doesn't work?
    What do you reckon?
    Thanks.
    M.

  • Window.print() not working for swf file in webpage?

    I have used the javascript window.print() function to print a webpage. But when i click a button to invoke this function the swf file stops then the screenshot is taken and then it resumes playing,, thus resulting in a blank page to be printed... What to do??

    Since it is not clear what your intentions are for wanting to print the screen, you could try just using the Print Screen of your keyboard (pc) and then paste the resulting screen capture into an image using Photoshop or Fireworks.

  • Scrowing with touchpad not working when pdf file is opened in one of the the browsers tabs

    When I have a .pdf open from one of the browser's tabs I am not able to scroll with my touch pad in the rest of the browser's tabs. Once I close the tab with the pdf everything is working fine. I using Firefox on my Toshiba Satellite Pro laptop.

    Hi NSHS,
    Have you checked to see if your PDF add-on is up to date? You should take a look at the [[Opening PDF files within Firefox]] Knowledge Base article. There is a lot of good information in there. You should try both of the suggested PDF add-ons to see if that fixes the issue.
    Hopefully this helps!

  • Drag and drop not working when uploading file using safari

    why i cannot drag and drop any file when using safari , and what happens the file auotmatically open while i need to upload it only , extra for that , i cannot write  any remark or fill a space while using website related to my work.
    my work is to upload drawing files using dwf file to a website so the other parties can review and give me review , and then i reply to the remark at the same place and make meeting through the same site.
    please any body can give any way to correct my mac.
    latelly i installed win7 only to use it for that website , and iam now changing from mac to win whenever i want to work , this not acceptable to me because it is waste of time beside i like the mac and it working with other application but not for safari.

    why ?
    I'm sorry, but every OS is different.  You cannot expect all features of one to be in another.  Or alternatively, for similar features, be done it the exact same way. 
    It looks to me after a quick google search that winexplorer is basically the moral equivalent of the mac's finder to present the file system in different ways.  The OSX Finder also has alternative views of the file system, i.e., icons, list, columns.  Experiment with the list and column views and see if one of them are more to your liking.
    As for winexplorer on the mac.  I don't know if this simulates it or not but there is a program called Macintosh Explorer so check that out as well.
    And finally, in the end, as I said in my earlier post, no matter what, nothing on the mac is going to change what I believe you think you can do and drop a file on a browser window and expect it to upload.

  • Hyperlinks to pdf files not working when project is exported out as SWF and uploaded to server

    hI all
    I'm using CS5 and i have hyperlinks to pdf files in my indesign project. However when i export to SWF, although the links work locally, they do not work when i upload all the relevant folders and files and test it from a server the links to the pdfs can not be found, the error messages indicates its looking for the files on my hard drive. I have also noticed that if i copy all the relevant folders and files and exported swf to a different directory and then launch swf from there the links do not work there either.
    Other than seperately uploading each pdf indvidually on to the server and then creating a hyperlink to it from the local indesign project i don't know what else to do.
    Any advice much appreciated.

    I have your same problem, but didn't consider uploading the PDFs and then linking to them. I'm willing to try it. Let me know if you ever found a better way, ok?
    Thanks.
    Lynn

  • Calling method from SWF file wtih javascript, when swf file is not loaded in any browser

    Hi There,
    I have a question regarding flex and javascript integration:
    1. We have created certain components and bundle them in swf. these swf file uses webservice to connect to backend code written in java.
    2. We have deployed swf file and backend on the same tomcat server.
    3. Backend server send some datapoint to UI and plot graph and displyaed to user.
    4. Now if user generate graph from datapoint and want to export it, we are tranferring image of that graph from UI to backend. No issues in this process.
    5. Now the question is. let say user has not open any swf file in browser and backend scheduling job want to generate the graph. How we will connect to swf file.
    6. Is ther any way we can connect or call method of swf from java/jsp/html/javascript code in this scenario without loading swf file in browser??
    Please help me!!!
    Thanks
    Sonu Kumar

    Both test sites work just fine for me.
    The "Update plugin" message is exactly what would be displayed if no .swfobject file at all was found... so it may not be the "version11" thing but rather, perhaps something else is messed up with the .swfobject file.
    File can be found in both folders:
    http://www.pureimaginationcakes.com/test/Scripts/swfobject_modified.js
    http://www.pureimaginationcakes.com/Scripts/swfobject_modified.js
    and file does download when downloading the html page (just check the cache).... but for some reason it doesn't seem to be working.... Hummmmm????
    Adninjastrator

  • Added preset motions to my interactive pdf file. It's not working when I export my file as an inter

    I added preset motions to my interactive pdf file. It's not working when I export my file as an interactive pdf. It's working when I play it on the Preview panel. I must not be doing something right. Does anybody have any clue what I need to do to have my presets motions work when played on Acrobat

    So do you mean export the whole document in a swf file format and then bring the whole swf file in and save it as a pdf file.  Is there way to export these motion presets seperately and bring them back into Indesign. I wish it was less difficult but I guess there is no way around it for the time being.

  • How do I move aiff files from the viewer to the timeline-it is not working when I try to drag and click or clicking on overwrite or insert in Final Cut Pro 7. Thanks

    How do I move aiff files from the viewer to the timeline-it is not working when I click and drag or when I try to move the files to the overwrite or insert buttons-Thanks.

    hi
    You cannot move audio from the viewer
    Mark your in and out points then in the browser grab hold of the audio tracks icon and drag that to the time line
    PJ

  • I baught Seagate Backup plus 2T hard drive to use as my Backup time machine. But its not working when i connect to time machine its not coping files, it keep saying preparing files. Can someone help me please...

    i baught Seagate Backup plus 2T hard drive to use as my Backup time machine. But its not working. when i connect to time machine its not coping files, it keep saying preparing files. Can someone help me please...

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a Fusion Drive or a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Finder not working, when click the infinity sigh comes, can't open any file

    finder not working, when click the infinity sigh comes, can't open any file?

    That could be an indication your drive is failing. If you do not have a current Backup, that is top priority.

  • Quicklook does not work with WMV files and quick look no longer maintains resized views when viewing from a folder using the up/down arrows

    Quicklook does not work with WMV files and quick look no longer maintains resized views when viewing from a folder using the up/down arrows. Any fixes?

    Same problem here...

  • The Open URL or File function is not working when I publish as a exe?

    The Open URL or File function is not working when I publish as a exe.  I have tried putting the exe in the same location as the files with no luck.  How do I get the buttons to function properly with a exe file.

    Have you set the Publish folder as a trusted location in Flash Global Security?
    If not, please read this post:
    http://www.infosemantics.com.au/adobe-captivate-troubleshooting/how-to-set-up-flash-global -security
    It may explain your issue.

  • HT203172 my dvd player is not working when i try disk U  i get this massage  Warning: SUID file "usr/libexec/load_hdi" has been modified and will not be repaired.


    my dvd player is not working when i try disk Utility  i get this massage  Warning: SUID file "usr/libexec/load_hdi" has been modified and will not be repaired.

    Is this bad?
    No. Ignore it.
    What does this mean?
    That you have the current OS version installed.
    As far as I know, I have not installed any Remote Access software on my Mac.
    It's part of the OS.
    (55800)

  • How to disable F1 to F12 keys in Web Browser when SWF file is in focus

    Hi all,
    Im running / loading a swf file in IE. I want to disable the
    function keys ( F1- F12 keys) in IE as I have defined special
    functions for these keys in my swf / flash file.Im using a
    javascript code to do this and the javascript code is working
    correctly.But the problem starts when the swf file is in focus,
    when swf file is in focus and if I press the F3 key the search of
    IE opens, but I have defined a special function in my swf file for
    this key, here the IE is overriding and it's taking the precedence
    in the event handling this is what I want to disable.So that I can
    catch the event in SWF file or get the Key code and run the my
    function defined for the key.
    Thanks.

    apollothethird wrote:
    When testing my applets on a Linux Web site I&#146;m finding that I have to totally exit the browser, then open up a new browser session to see the updates on my applets. Yes. Applets can be horrible for caching. I am surprised that exiting and restarting the browser works. I usually clear the cache in the Java Console.
    ..The refresh button on the browser won&#146;t show the new version of the jar file program. I find this consistent with Firefox, MS Internet Explorer, and Google Chrome.
    Is there some type of browser option that will allow the next jar version to be run without having to exit out of the browser to see it?
    No, but if the Java Console is open, it is pretty easy to force a refresh of the classes.
    As an aside, for a more general solution for your end users, look to launch the app. using [Java Web Start|http://java.sun.com/javase/technologies/desktop/javawebstart/index.jsp] . Updates are reliable and automatic.
    Thanks in advance for any comments on this.No worries (in advance).
    Note that my reply would have been sooner, except that I felt compelled to get that matter of the link in your post dealt with, before commenting.

Maybe you are looking for