ExternalInterface.call("saveglobalscore",score) on several areas?

I use ExternalInterface.call("saveglobalscore",score) in a SWF to call a JavaScript in the html container. The swf file is located in one field other than the html container. Everything works very well if all the files are in the same root directory, but as soon as I make reference to the swf file that is located in the other domain, the call is not working! What Miss me?

SWF file has this frame 1:
to import flash.external.ExternalInterface;
function clickListener(eventObj:Object):Void {}
ExternalInterface.call("saveglobalscore",score) ("sendToResponseForm");
}

SWF file has this on mc as a button instance:
{We (Press)}
clickListener();
}

HTML/container file that is in the < head > tag:
< script type = "text/javascript" >
function sendToResponseForm() {}
Window.Location = "my.other.html.file";
}
< /script >

HTML file has this integrated:
< object classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase =" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6, 0,29,0 ' width ="700"height ="550">" "
"" < param name = "movie" value = " http://www.otherdomain.com/vid/my.SWFFile.swf" / >
< param name = "quality" value = "high" / >
"" "" < embed src = " http://www.otherdomain.com/vid/my.SWFFile.swf" quality = "high" pluginspage = " http://www.macromedia.com/go/getflashplayer ' type =" application/x-shockwave-flash"width ="700"height ="550"> < / embed >
< / object >

If all goes well, that's enough for you to chew. As I was saying that if swf and html are in the same domain, it works. As soon as I point to the second area of source of swf file it stops working.

Thank you
Demont

Here is my error: the swf file has been very good and actually worked in IE6/IE7 but doesn't work in Firefox. The process to include the swf file in the HTML code has been vitiated. I originally published the HTML using Dreamweaver to write the in the code. Which fixes the problem, it's that I published the swf using the Flash file in a folder of the office that produced a javascript (AC_RunActiveContent.js), the swf file and HTML file. Javascript code dynamically determined Explorer who was used and which plugin player was necessary. The script loads/writes in the end the appropriate environmental content and any embed or object of the swf file is successfully. He had nothing to with Lacrosse communication area at all.

The main challenge was last updated the HTML/Javascript Flash to use the appropriate resource, swf, which was located on a different server and move the js file in the appropriate directory, update the link in the HTML accordingly. My only concern was the more general source external javascript. But, at least I'm not concerned with the question of whether it works or not.

Hope this helps someone.

Demont

Tags: Adobe Animate

Similar Questions

  • The parameter ExternalInterface.call("saveglobalscore",score) String length limit?

    Is there a limit on the length of string to the amount of characters from a string can contain when it is passed as a parameter to ExternalInterface.call("saveglobalscore",score) ()?

    Also, there are characters that ExternalInterface.call("saveglobalscore",score) () cannot serialize to a string? As \n, \t... etc.

    The livedocs don't answer these questions.

    Thanks for your reply, but I just thought of it.

    ExternalInterface.call("saveglobalscore",score) ("jsFunc", longString);

    There seems to be no limit tank that I fell on the cause I could push 2K in there.

    The problem is the line breaks in the string, they must be stripped during serialization. Just make sure that you clean the string of new line as follows:

    longString = longString.split ("\r") .split ("\n").join("").join("");
    ExternalInterface.call("saveglobalscore",score) ("jsFunc", longString);

    works very well...

  • ExternalInterface.call("saveglobalscore",score)

    This does not work what is the wrong in this code.

    If I trace (urlPath) showing - null.

    var urlPath = ExternalInterface.call("window.location.href.toString");
    
    if(urlPath != "http://www.domainname.com/demo/test/welcome.swf")
    {
              trace("Yes");
              pageMsg.text = "this is html"
      
    }
    else
    {
              trace("no");
              pageMsg.text = "This is swf"
    }
    
    

    I tested this code html of the page and it works fine.  I created a test document if you want to check.  Click on the green rectangle so that the url displayed...

    http://www.nedwebs.com/Flash/welcome.html

    The swf file contains an mc button named "btn" and a textfield named "url".  The code in the swf file is as follows...

    btn.addEventListener (MouseEvent.CLICK, traceURL);

    function traceURL(evt:MouseEvent):void {}
    var urlPath = ExternalInterface.call("saveglobalscore",score) ("windowhref");
    URL. Text = urlPath;
    }

    You should test it on a server by using the html page, if you don't already have it.

  • Flex 3: need help with ExternalInterface.call("saveglobalscore",score)

    Hello

    I have my setting up a Flex project in my Flex Builder.

    I am going through my step by step to understand.

    In our project, we got this call:

    public function callDataOfJSMethod (): void
    {
    ExternalInterface.call("saveglobalscore",score) ("getData");
    }

    But I was not this getData anywhere, couldn't you please let me know what it could be and where I can find that?

    Thanks in advance.

    It should be a javascript method in the html wrapper.

  • ExternalInterface.call("saveglobalscore",score) () throws ScriptTimeoutError, which may not be intercepted

    Hello

    In my flex code, I invoke ExternalInterface.call("saveglobalscore",score) () to call a function in c ++. In this feature of c ++, a modal dialog box will appear. If this modal dialog box is open for a long time, a warning dialog box saying that a function has executed more than 15 seconds. I wanted to capture this error (which should be ScriptTimeoutError) to suppress this warning dialog box. But I failed.


    In the following code, flex timeout warning dialog will show, do not show my words:

    Try
    {
    ExternalInterface.call("saveglobalscore",score) ("popUpModalDialog");
    } catch(e:Error)
    {
    Alert.Show ("Please don't show dialogue timeout");
    }


    But if I change the code a bit more, flex timeout warning dialog will not appear, my words will show:

    Try
    {
    While (true) {}
    } catch(e:Error)
    {
    Alert.Show ("Please don't show dialogue timeout");
    }


    The examples show that ExternalInterface. () Call throws an error that cannot be intercepted.
    Is there a way I can suppress this warning dialog?

    Thank you!

    Hello

    In my flex code, I invoke ExternalInterface.call("saveglobalscore",score) () to call a function in c ++. In this feature of c ++, a modal dialog box will appear. If this modal dialog box is open for a long time, a warning dialog box saying that a function has executed more than 15 seconds. I wanted to capture this error (which should be ScriptTimeoutError) to suppress this warning dialog box. But I failed.

    In the following code, flex timeout warning dialog will show, do not show my words:

    Try
    {
    ExternalInterface.call("saveglobalscore",score) ("popUpModalDialog");
    } catch(e:Error)
    {
    Alert.Show ("Please don't show dialogue timeout");
    }

    But if I change the code a bit more, flex timeout warning dialog will not appear, my words will show:

    Try
    {
    While (true) {}
    } catch(e:Error)
    {
    Alert.Show ("Please don't show dialogue timeout");
    }

    The examples show that ExternalInterface. () Call throws an error that cannot be intercepted.
    Is there a way I can suppress this warning dialog?

    Thank you!

  • Problem with AS3 &amp; quot; ExternalInterface.call("saveglobalscore",score) &amp; quot; in Internet Explorer

    Hello

    Explain how the page is set up:

    I have a HTML page with 2 different movies Flash AS3.

    The first flash movie is the main entertainment and is located in the middle of the screen with a large background image defined in the body of the HTML.

    The second flash movie spans 100% width/height of the size of the screen and acts as a black fade > invisible.

    What I'm doing:

    Once the second Flash animation has gone from black to invisible it calls a JavaScript function on the HTML page to hide the div element, the second flash movie is integrate in (it's like the first flash movie displays a set of input boxes, which the user must be able to type-which will not be able to click on if there is another flash animation that just overlap the first film).

    My initial solution:

    In the second Flash movie is the following code:

    ////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////
    Stop();

    This will load the API needed to communicate with external entities
    to import flash.external.ExternalInterface;

    call the JavaScript function
    ExternalInterface.call("saveglobalscore",score) ('myJavaScriptFunction');
    ////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////

    .. .and it works fine in Mozilla Firefox/Safari. The actionscript code successfully the JavaScript function in the HTML page and this JavaScript function simply calls (to this poster from the scene an alert() message to show that it has been called successfully).

    Problem with IE:

    But, at the time when I try this in Internet Explorer, I get an alert() message but a JavaScript error message that says:

    ////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////
    Code: Select all
    Line: 1
    Char: 106
    Error: 'null' is null or not an object
    Code: 0
    ////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////

    As you would expect I am totally confused as to what could be the problem.

    It's really urgent because it is a living project which must be completed immediately, any help you might have would be greatly appreciated!

    Kind regards

    Select this option.

    GWD salvation,

    Who did it! :)

    I applied the attribute id = "fTrans" to the tag and IE worked well.

    I disparage me my brain one, thank you very much!

    Kind regards
    Mark

  • ExternalInterface.call("saveglobalscore",score) () error with Flash Player 10

    I don't know what that means. The function runs successfully in javascript, and I evaluate ExternalInterface.available...

    TypeError: Error #1009: cannot access a property or method of a null object reference.
    at flash.external::ExternalInterface$/_callIn()
    < anonymous >)
    at flash.external::ExternalInterface$/_evalJS()
    at flash.external::ExternalInterface$/call()
    at views.audio::myObject/myFunction()

    UPDATE: it was JS calling a reminder the null value.

  • New path before calling ExternalInterface.call("saveglobalscore",score))

    When click on a component button (called btn_Connect here),
    I want to display a message in a label (lbl_Status here)
    before calling a long-term fscommand() function.

    But there is no action until the fscommand() is completed.

    How can I do?

    Thank you
    Joseph

    Part of my ActionScript code is below.
    My flash application has only a single image.

    To redraw the flash and deal with other possible user interface events,.
    I changed my c# code so that the long task can run in a separate thread.

    Now, everything works fine as I had hoped.

    Joseph

  • ExternalInterface call the Javascript to AS2 array throwing error undefined

    I need to pass various (follow-up) IDs to a .swf.  the IDS are in a table like this =

    < script type = "text/javascript" >

    function getImpID() {}

    var medID = {impID: pvID '12345': ' 677890', exID: '654332'};

    return medID;

    };

    function thisMovie (banner) {}

    If (navigator.appName.indexOf ("Microsoft")! = - 1) {}

    Returns the window [banner]

    }

    else {}

    return the document [banner]

    }

    }

    Window.OnLoad = getImpID;

    < /script >

    For now, the AS2 I is:

    flash.external import. *;

    System.security.allowDomain (sourceDomain)

    var allID:String = ExternalInterface.call.apply ("getImpID");

    function getIDs() {}

    var impID:Number;

    var pvID:Number;

    var exID:Number;

    var id_arr:Array = allID.split(",");

    _root.id_test. Text = impID;

    }

    getIDs();

    Basically, what I need is to divide the three identifiers from the javascript so that I can add with different URL clickTags in the will.  I primarily the "undefined" error, so I'm going out on a limb here I have the AS2 does nothing now value.  More big scratcher head for me is, if I have the ID in an array in javascript (medID) how do I get them not only correctly in Flash, but separate them in their separate identity papers.

    Any suggestions would be greatly appreciated.

    Thank you!

    I forgot to answer, your tips have helped solve the puzzle =

    ActionScript:

    function idTag() {}

    getID = Object (ExternalInterface.call("saveglobalscore",score) ("getImpID"));

    getID.toString ();

    _root.id_test. Text = getID;

    }

    idTag();

    JavaScript

    has worked like a charm!

  • ExternalInterface call in Javascript popup

    I am incorporating a swf in a pop up window using the javascript window.open function. I am currently passing through static values for the height and the width corresponds to the height and width of the embedded swf file of the popup.  A user can click a button in the swf file, and it changes the size of the SWF to 400 x 300, at 800 x 600.  In flex, I use ExternalInterface.call("saveglobalscore",score) ("resize"); but nothing happens.  I'm a complete noob with javascript, is not how to use the ExternalInterface API?  Any ideas why it does not work?  Is there an easier way to get the same functionality to work with something else?  The JavaScript code is below, tons of thanks in advance to tide me over.

    < SCRIPT TYPE = "text/javascript" >

    <!--

    popup function (mylink, windowname)

    {

    If (! window.focus) return true;

    var href;

    If (typeof (mylink) is 'chain')

    href = mylink;

    on the other

    href = myLink.href;

    Popup = window.open (href, windowname, 'width = 400, height = 300, scrollbars = no, resizable = 1');

    Returns false;

    }

    function resize()
    {
    popup.resizeTo (800, 600);
    }


    ->

    < /script >

    < body >

    " < a HREF =" http://localhost/main.swf "onClick ="return popup (this, 'notes')"> "

    App

    < /A >

    Here is the sample,

    Sample.MXML

    
    http://www.adobe.com/2006/mxml"
         layout="absolute"
         width="100%" height="100%">
         
              
         
         
    
    

    Parent html

    
         
              Resize Demo
              
         
         
              
         
    
    

    Child html (Popup.html)

    
         
              Resize - Popup
              
         
         
              
                   
                   
              
         
    
    
  • call the owner VI several times

    Hi all

    I try to call the owner VI several times and was not sure if it's possible. I try to call the same VI in a VI with different condition.

    I have this VI as active with reentrant template (VI_1), and inside the loop, he calls another instance of this model (let's call it VI_2) and wait for the completion called VI (VI_2) and proceed to the next action. The problem, it's wait until done does not wait even if I set it to True. Can someone tell me what I am doing wrong? or even if this is possible.

    Thank you in advance.

    So the VI calls himself?

    If so, you can drop the VI to its own diagram if it is defined in the version of LabVIEW 2009 neres and later.

    Tone

  • I continue to receive phone calls from someone saying they are from microsoft.

    Could you tell me, how you would contact me to tell me that I had downloaded a VIRUS. Because I keep getting phone calls from someone saying they are from microsoft.

    Could you tell me, how you would contact me to tell me that I had downloaded a VIRUS. Because I keep getting phone calls from someone saying they are from microsoft.

    They are * not * Microsoft. This is a complete scam and one that has become very common these days. Do anything they tell you to do and hang up on them.

  • Fill in several areas of direct paint with a gradient selection

    Hi all

    I have a very brief but complicated question. I am filling several areas with just a gradient in paint, so that they seem to overflow one. Is it possible? See the image below for what is happening now.

    Knipsel.PNG

    I don't see why you should use Merge. It works without it for me.

    But you will have to click and drag with the gradient tool.

  • Volumes of App with several areas

    Hello

    We have volumes app setup within our environment. Within our environment, we have several areas Setup active directory. Is it possible to configure Manager Volumes App to see several areas active directory, or do we need to configure a volume of separate application for each domain manager?

    Thank you.

    Rob.

    Volumes of App supports several areas approved under a single forest. Ideal configuration is to provide the Volumes App Manager with credentials for the forest root and it can then cross in the child domains as needed.

  • How to create a site of muse in several languages with several areas

    I was asked to create a website for a product. A very simple site with maybe one or two pages and a product to sell for whom customer wishes as Paypal as payment gateway. Simple right?

    No! This customer wants to market its products in Europe, that they would like to buy several European areas (.fr, .de, for example).

    So how the hell can I do that? I use Muse to build and Business Catalyst for hosting.

    Bearing in mind that the customer won't pay separately hosted sites. Is it possible to translate the text for each area. Or could I assign several areas but lead to different homepages within the same site?

    I have no idea how to problem solve this.

    Hello

    Some links that may be useful,

    How to set up a multilingual with Adobe Muse website and push it live Adobe Business Catalyst

    Re: How can I create different languages for my page?

    How can I create a multilingual website?

    How to create a multilingual site

    Let me know if you have any question.

Maybe you are looking for