jscript for flash

  • Hi,

    I can't open the jscript for the popup image or pdf document in flash, only in html5. I'm wondering why is that? Error says SecurityError: Error #2060 and I've tried to add allowScriptAccess in script embedpano in index.html but it didn't help. I'm not sure have I put it correctly, I've tried this but none helped:

    embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano", html5:"auto", passQueryParameters:true, allowScriptAccess:true});
    ..
    embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano", html5:"auto", passQueryParameters:true, allowScriptAccess:always});
    ..
    embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano", html5:"auto", passQueryParameters:true, allowScriptAccess:"always"});
    ..
    embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano", html5:"auto", passQueryParameters:true, allowScriptAccess:true});
    ..
    embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano", html5:"auto", passQueryParameters:true});
    viewer.addVariable("allowScriptAccess", "always");

    This are the codes

    from index.html:
    .
    .
    .
    <script type="text/javascript" src="js/jquery/jquery-1.4.3.min.js"></script>
    <script type="text/javascript" src="js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
    <link rel="stylesheet" href="js/fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
    <script type="text/javascript">
    function openPopup(t,linktourl,w,h,type)
    {
    $.fancybox({
    'title' : t,
    'width' : w,
    'height' : h,
    'href' : linktourl,
    'type' : type,
    'autoScale' : 'true',
    'overlayColor' : '#000000',
    'overlayAlpha' : '0.3'
    });
    };
    </script>
    .
    .
    .
    <script>
    embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano", html5:"auto", passQueryParameters:true});
    </script>

    from vtour.xml:

    <hotspot ..
    onclick="js(openPopup('title', 'path', 500, 500, 'iframe'))"
    />

  • Hi,

    what your testing environment?
    Local file or local server or something embedded?

    Btw - just as note - there no allowScriptAccess setting in the krpano embedding script, but that Flashplayer setting will be set already set automatically.

    Best regards,
    Klaus

  • Hi,

    Klaus, thank you for the allowscriptaccess tip.
    I'm using the local file enviroment and the web server enviroment, and non of these work in flash, only in html5. And path to the image file is relative, i.e. /directory/file, not the global with the http.

    I've been thinking is it related to the sandboxing? Do I need to insert the following --> sandbox="allow-same-origin allow-scripts allow-popups allow-forms"
    in the javascript function "openPopup" but I don't know how...

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!