Actionscript Function

I new to flex so I'm still trying to get my head around the
concepts. I have created a flex 2 application that uses a repeater
to populate radio buttons based on a actionscript array.
Inside the repeater I am displaying the radio button, on the
button I have put a click event to run an actionscript event
handler. This works and through the actionscript handler I can
change the value of a text field. What I want to be able to do is
pass a value from the repeater to the action script handler. In
java script I would just have the function name and the value
i.e. buttonClickHandler(some data); and at the receving end
you have function buttonClickHandler(data) {}, and then you just
refer to the imported data as 'data' inside the javascript
function. With flex the function is defined as
private function buttonHandler(event:MouseEvent):void.
Basically I don;t know how to pass data into an event
triggers by a mouse event.
Brian

Straightforward, register event and dispatch it from the
repeater item.
<mx:Repeater id="ProductRepeater"
width="100%" height="100%"
dataProvider="{products}">
<v:ProductDetail id="prod"
width="95%"
productItem="{ProductRepeater.currentItem}"
ProductClicked="ProductClickHandler(event);"
/>
<mx:Spacer width="5%" />
</mx:Repeater>
and here is the handler function
public function ProductClickHandler(event:ProductEvent):void
var e:ProductEvent = new
ProductEvent(event.product,"ProductClicked");
this.dispatchEvent(e);
}

Similar Messages

  • Call Actionscript function from Javascript

    Can anyone show me a simple example of calling an
    actionscript function from within javascript? Everything I have
    found searching online refers to using the ExternalInterface but I
    was sure I also read that Adobe Air does not support it. I am
    currently using htmlloader to load a html page containing
    javascript into an <mx:HTML>. But I cant seem to touch the
    actionscript functions from within javascript. I am specifically
    trying to work with the FCKeditor that I have integrated so if
    anyone has any examples other methods of integrating the editor I
    would love to see them as well.
    Thanks!

    Let's assume u have embeded swf object named "flashObj"
    <embed src="MYSWF.swf" quality="high"
    width="100%" height="100%" name="flashObj"
    play="true"
    loop="false"
    quality="high"
    allowScriptAccess="sameDomain"
    type="application/x-shockwave-flash"
    pluginspage="
    http://www.adobe.com/go/getflashplayer">
    </embed>
    On each time onblur is called it invoke AS function
    myActionScriptFn
    window.onblur = function() {
    if(flashObj != null){
    flashObj.myActionScriptFn(navigator.appName);
    You need to add a listener in Action Script code
    ExternalInterface.addCallback("myActionScriptFn",
    myActionScriptFn);
    public function myActionScriptFn(appName:String):void
    // Any code here
    Regards

  • Actionscript function when hovering

    Has anyone ever tried to run an actionscript function when
    hovering over the <a>Anchor tag of HTMLtext?
    Here is the situation. I have an HTML text field and I want
    to be able to embed definitions of key words. In turn, when the
    user hovers over the world, I’d like to open a window
    containing the definition.
    While one can add a "Hover" effect with CSS, i wish to run a
    function when an EVENT LINK is hovered over. Can anyone suggest a
    way to do this or maybe a workaround?
    var htmlText1:String = "<a
    href='event:hoverOverMe'>Hover Here Please</a>";
    this.textArea1.htmlText = htmlText1;
    this.textArea1.addEventListener("MOUSE_OVER", overHandler)
    public function overHandler(event:MouseEvent)
    //Get mouseover information
    //Possible get information from the anchor tag under the
    mouse?
    Any help to point me in the right direction is appreciated.
    Art

    Hi! This interests me as well, so I'll be following this
    thread with keen interest. Although the following doesn't answer
    the question, it does seem to eliminate the possibility of using an
    anchor tag in the way that you have suggested, the Alert Box in the
    anonymous function reveals the text and its formatting but the
    anchor tag has been stripped out.
    But I'm hoping as I guess would you, that the document object
    model caters for the immediate objects (such as your illustrative
    tag had it not been stripped out) in the event bubbling phase ...
    as the Alert box reveals a rich set of tags I should think that
    there is at least a little hope here.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
    xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="init()"
    >
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    public function init():void
    testHTML.htmlText="<a id='anchorID' href='#'>This is
    some text</a>"
    testHTML.addEventListener(MouseEvent.MOUSE_MOVE,function(e:MouseEvent){Alert.show(e.targe t.htmlText.toString());});
    ]]>
    </mx:Script>
    <mx:TextArea id="testHTML" width="300" height="300">
    </mx:TextArea>
    </mx:Application>

  • Feature Request: Custom uninstaller which executes actionscript function on uninstall

    Hi,
    My name is Ronald Kamp and I'm an IT Consultant at iDA MediaFoundry Belgium.
    I would like to request a feature. At the moment I have an application that writes a file to the app-storage of my application, to the user's documents and settings folder and one value to the Encrypted Local Store. On uninstall, I would like to remove all of these files so that all links to the application are removed.
    Would it be possible to add a feature to the AIR SDK that will execute a certain piece of actionscript so that all of these files are removed? Of course, it would be possible to create an installer with InstallAnywhere but then we would lose all of the checks that are performed with the standard AIR installer and uninstaller.
    Thanks in advance.
    Kind regards,
    Ronald Kamp

    Hi Ronald,
    Thank you for the feature request feedback.  I agree, having this functionality would be great.  If you get a chance, I'd like to recommend voting for both of these ideas:
    Custom hook on AIR application uninstall
    Deleting local data store while unistall
    You might also be able to work around this now by creating a native installer and having it sub launch your AIR installer.  More details about this can be found on our redistribution instructions, and you can sign up for the licensing needed on our runtime distribution page.
    Thanks,
    Chris

  • Object not embedded error whenever i tried to access actionscript function from js

    hi,
    i badly need help in embedding my swf in html , because it keeps saying that my object is undefined.
    object undefined error.
    i am trying to pass values from js to actionscript and then i embedded it.
    i tried to embed it using embed and object tags only, but the javascript functions are not working.
    It keeps saying that object is expected.
    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
      codebase="http://download.macromedia.com/" WIDTH="500" HEIGHT="500" id="flaMovie1">
      <PARAM NAME=movie VALUE="dwpPlayer.swf">
      <PARAM NAME="allowScriptAccess" value="always" />
      <PARAM NAME=quality VALUE=high>
      <EMBED src="dwpPlayer.swf"
        quality=high bgcolor="#aaaaaa" WIDTH="400" HEIGHT="200"
        TYPE="application/x-shockwave-flash"
        PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
      </EMBED>
    </OBJECT>
    i am trying to embed it that way, the swf is showing but the javascripts and functions are not working..
    please help. i already tried using the AC FL RunContent, yes it is showing but i can't postion my items using this
    <table>
                            <td>
                            hoy!
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div visibility:visible>
                                <script language="JavaScript" type="text/javascript">
                                AC_FL_RunContent(
                                'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
                                'width', '400',
                                'height', '400',
                                'src', 'dwpPlayer',
                                'quality', 'high',
                                'pluginspage', 'http://www.adobe.com/go/getflashplayer',
                                'align', 'middle',
                                'play', 'true',
                                'loop', 'true',
                                'scale', 'showall',
                                'wmode', 'window',
                                'devicefont', 'false',
                                'id', 'dwpPlayer',
                                'bgcolor', '#ffffff',
                                'name', 'dwpPlayer',
                                'menu', 'true',
                                'allowFullScreen', 'false',
                                'allowScriptAccess','always',
                                'movie', 'dwpPlayer',
                                'salign', ''
                                ); //end AC code
                                </script>
                                </div>
                            </td>

    here's a sample of correct embedding html.  you'll need AC_RunActiveContent.js, too:
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Bday-flowers_Preview_NoMusic</title>
    <script language="javascript">AC_FL_RunContent = 0;</script>
    <script src="AC_RunActiveContent.js" language="javascript"></script>
    </head>
    <body bgcolor="#cdb4a7">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!--
    <p align="center"><font face="Arial" size="40" color="#2d3271" letterSpacing="0.000000" kerning="1">Preview Only</font></p><p align="center"></p><p align="center"><font face="Arial" size="40" color="#2d3271" letterSpacing="0.000000" kerning="1">(Your message will </font></p><p align="center"><font face="Arial" size="40" color="#2d3271" letterSpacing="0.000000" kerning="1">appear here.)</font></p><p align="center"></p><p align="center"></p><p align="center"></p><p align="center"></p><p align="center"></p><p align="center"></p>
    -->
    <!-- saved from url=(0013)about:internet -->
    <script language="javascript">
        if (AC_FL_RunContent == 0) {
            alert("This page requires AC_RunActiveContent.js.");
        } else {
            AC_FL_RunContent(
                'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
                'width', '990',
                'height', '680',
                'src', 'Bday-flowers_Preview_NoMusic',
                'quality', 'high',
                'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                'align', 'middle',
                'play', 'true',
                'loop', 'true',
                'scale', 'showall',
                'wmode', 'window',
                'devicefont', 'false',
                'id', 'Bday-flowers_Preview_NoMusic',
                'bgcolor', '#cdb4a7',
                'name', 'Bday-flowers_Preview_NoMusic',
                'menu', 'true',
                'allowFullScreen', 'true',
                'allowScriptAccess','sameDomain',
                'movie', 'Bday-flowers_Preview_NoMusic',
                'salign', ''
                ); //end AC code
    </script>
    <noscript>
        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="990" height="680" id="Bday-flowers_Preview_NoMusic" align="middle">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="true" />
        <param name="movie" value="Bday-flowers_Preview_NoMusic.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#cdb4a7" />    <embed src="Bday-flowers_Preview_NoMusic.swf" quality="high" bgcolor="#cdb4a7" width="990" height="680" name="Bday-flowers_Preview_NoMusic" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
        </object>
    </noscript>
    </body>
    </html>

  • Calling an actionscript function from a webview

    In the mobile app that I am developing I need to be able to open a webview that displays a website that is saved locally to the app. I then need to be able to press a button within that webview and have it call a function in the app itself. Is there a way to do this? Can a webview (using javascript or something) call a function in the app? If so, How?

    In JavaScript, set the document.location property to  some custom URL string. You could use your own URL scheme to pass parameters from JS to  AS3, e.g. as3://actions/document/save?overwrite=false. Then in ActionScript, handle the LocationChangeEvent.LOCATION_CHANGING event, and examine and/or decode the URL.
    Call event.preventDefault() in your AS3 event handler to cancel the navigation and stay on the same page.

  • ActionScript function not visible to Javascript

    In the example
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15683&sliceId=2
    there is a flash movie that we created using flash 2004 and
    actionscript 2.0 that should expose a function that javascript can
    call for clipboard functionality in firefox.
    The movie is created and displays with a little test text box
    but the function is not showing up as available to the javascript
    (firebug) and its not executing.
    We followed the documentation as closely as possible, so does
    anyone have ideas of little common things that could have been left
    out or ways to troubleshoot this kind of issue?
    We're new to flash/actionscript but very familiar with
    javascript/web interface development...so anything no matter how
    elementary, please feel free to advise!
    Thanks in advance for your time and knowledge!
    Va.
    Update:
    Trying a few things that I've seen, I believe that
    ExternalInterface is not available to my ActionScript, so the
    callback function does not expose anything to Javascript.
    I am using Macromedia Flash MX 2004, which uses Flash 7. Here
    are my new questions:
    - Is ExternalInterface available in Flash 7?
    - If yes, are there configuration settings might need
    tweaking?
    Thanks for reading and any suggestions!

    This is a known issue of CEP (Common Extensibility Platform, a DLL that supports displaying extensions). Code like “document.cookie” in HTML extension is invalid because CEF (CEP integrated CEF3 to display HTML Extensions) intentionally disables cookies on "file://..." for a variety of reasons.
    However, CEP stores cookies at:
    Windows: "C:\Users\yourusername\AppData\Local\Temp\cep_cookies"
    Mac: "/Users/yourusername/Library/Logs/CSXS/cep_cookies"
    Please let me know if more information is needed, thanks

  • Calling Actionscript functions from HTML in Air?

    Arg... I feel like I am soo close - but something is not
    quite right...
    I am stuck on the communcation from Javascript back to
    Actionscript in an Adobe Air 1.5 app... (not flex).
    here is my Main():
    quote:
    public class Main extends Sprite {
    public var _as3Var:String = "testing";
    public function as3Function():void
    trace("as3Function called from Javascript");
    public function Main() {
    NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE,
    onInvoke);
    protected function onInvoke(e:InvokeEvent):void {
    NativeApplication.nativeApplication.removeEventListener(InvokeEvent.INVOKE,
    onInvoke );
    var app = new App();
    addChild(app);
    app.init(new ExternalContainer(), e.currentDirectory,
    e.arguments);
    Now, I simply want to either access _as3Var or as3Function()
    from my AppSandbox javascript... My HTMLLoader looks like this:
    quote:
    _html = new HTMLLoader();
    _html.useCache = false;
    _html.runtimeApplicationDomain =
    ApplicationDomain.currentDomain;
    _html.load(new URLRequest("sandbox/AirRoot.html"));
    And this is my javascript snippit:
    quote:
    Exposed.testAs3 = function()
    air.trace("Exposed.testAs3 called"); /* this works great */
    air.trace("runtimeVersion:"); /* this works great */
    air.trace(air.NativeApplication.nativeApplication.runtimeVersion);
    /* this works great */
    air.trace("seeing if I can get to AS3 params..."); /* this
    works great */
    air.NativeApplication.nativeApplication.as3Function(); /*
    this produces an exception: TypeError: Value undefined does not
    allow function calls. */
    What I am doing wrong?

    as3Function and _as3Var are members of Main, not the
    nativeApplication object.
    How you can reference your Main object depends on the
    relationship between Main and the HTMLLoader running the
    javascript. For example, if _html is a child of Main, you could
    call as3Function like this: window.htmlLoader.parent.as3Function().
    If _html is not a child of Main, then you can either create a
    static reference to Main in the Main class constructor:
    public static var mainInstance:Main;
    public function Main() {
    mainInstance = this;
    Or create a reference to Main in your JavaScript object when
    you create _html. If _html is created inside Main (so that this is
    the Main instance), then the following would work:
    _html.window.mainInstance = this;
    You could then call as3Function like this:
    window.mainInstance.as3Function();

  • Actionscript Function to Reload CFGrid

    I'm looking for some guidance on how to use actionscript to
    reload a cfgrid on an onclick event. I am currently using getURL()
    to call a cfc to asynchonously update the query driving the grid,
    but I cannot figure out how to actually refresh the grid itself
    without reloading the page.
    Any help would be tremendously appreciated.
    Thanks
    Joel

    BKBK --
    Thanks, as always, for your response.
    I forgot to mention in my previous post that I am using a
    flash format form, and so the AJAX goodness of CF8 (which I don't
    yet have, unfortunately) will not work. Do you have any idea how to
    accomplish what I need with actionscripting? Basically, I need to
    do exactly what the grid.Coldfusion.refresh function does for AJAX,
    but in AS.
    Thanks!
    Joel

  • How can we call actionscript functions from js

    hi
    how can we call Action script function from js file . i
    tried ExternalInterface. add Callback() .but it throws an error .is
    there any other chance to call action script method .thnx in
    advance

    angadala,
    some people have found it is good to include the full
    qualification path, ie
    if (flash.external.ExternalInterface.available)
    flash.external.ExternalInterface.addCallback("ext_method_name",int_method_name);
    } // if (flash.external.ExternalInterface.available)
    There are also browser differences which affect how you find
    the Flex application object which are documented at
    http://www.adobe.com/livedocs/flex/3/html/help.html?content=passingarguments_5.html
    Richard

  • Actionscript Functions Help

    Hey, can someone please help me find a solution in this code that i've got. I'm using this code to make gameplay mechanics of a rhythm game but there seems to be a problem with the code that i've coloured in red.
    var timer1:Timer = new Timer (1000,1);
    timer1.addEventListener(TimerEvent.TIMER, addRed);
    var score:int;
    stage.addEventListener(KeyboardEvent.KEY_DOWN, hitRed);
    function addRed(e:TimerEvent){
              var activeRed:red = new red();
              activeRed.x = 75;
              activeRed.y = -100;
              activeRed.vy = 7.5;
              addChild(activeRed);
              activeRed.addEventListener(Event.ENTER_FRAME, animRed);
    function hitRed(activeRed:KeyboardEvent){
              if (activeRed.keyCode == Keyboard.S){
                        activeRed.target.removeEventListener(Event.ENTER_FRAME, animRed);
                        activeRed.target.parent.removeChild(activeRed);
                        score += 1
    function animRed(e:Event){
              var borderBottom = 800 + (e.target.height / 2);
              e.target.y += e.target.vy;
              if(e.target.y > borderBottom){
                        e.target.removeEventListener(Event.ENTER_FRAME, animRed);
              e.target.parent.removeChild(e.target);

    If you are getting that error, things are not likely to work in any case. 
    The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....
    - is declared but not instantiated
    - doesn't have an instance name (or the instance name is mispelled)
    - does not exist in the frame where that code is trying to talk to it
    - is animated into place but is not assigned instance names in every keyframe for it
    - is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).
    If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

  • Calling a function on an object passed as argument

    Hi everyone,
    i'm trying to call an actionscript function on an object passed as argument to a c function. Here are how I do :
    I have a class named test_class implemented as
    package
         public class test_class
              public var bliblou:int;
    and a C function that have to modify the bliblou var of an test_class object passed as argument. Here is my function :
    static AS3_Val test_obj_param( void* self, AS3_Val args )
         AS3_Val obj;
         AS3_ArrayValue( args, "AS3ValType ", &obj );
         AS3_Set( obj, AS3_String("bliblou"), AS3_Int( 123456 ) );
         return AS3_Null();
    Then I call the function in my actionscript main function like this :
    var loader:CLibInit = new CLibInit;
    var lib:Object = loader.init();
    var test:test_class = new test_class();
    lib.test_obj_param( test );
    But when the test_obj_param is trying to run, I obtain an error saying "unable to access a propriety of a null object".
    What am I doing wrong ? Is it possible to do what I try to (calling a function on an object passed as argument) ?
    Thanks in advance

    After a long trip to Alchemy possibilities and a lot of tests I have finally found a solution to my question.
    Instead of using AS3ArrayValue to get my objet, I use the AS3 function shift on the args array to get my object. Here is how I do
    static AS3_Val test_obj_param( void* self, AS3_Val args )
         AS3_Val emptyParams = AS3_Array("");
         AS3_Val obj = AS3_CallS( "shift", args, emptyParams );
         AS3_SetS( obj, "bliblou", AS3_Int( 123456 ) );
         AS3_Release(emptyParams);
         return AS3_NULL();
    Maybe there is a bug in the AS3ValType getter.

  • Links to AS functions in text?

    Is there a way to create hyperlinks to AS functions within
    text that is imported from an XML file without having to call out
    to JavaScript and back?
    In other words, I'd like to have a way to put a link in the
    middle of a line of text and have it call an ActionScript function
    when clicked.
    Thanks for any help!

    lectro,
    > Is there a way to create hyperlinks to AS functions
    within
    > text that is imported from an XML file without having to
    > call out to JavaScript and back?
    I think the answer is yes. It is possible to create
    hyperlinks (<a>
    tags) in HTML-formatted text in a Flash text field. It is
    possible to have
    that hyperlink trigger ActionScript, rather then open a URL.
    The
    HTML-formatted text can indeed be loaded from an XML
    document. Because none
    of this involves anything outside of the SWF file itself
    (besides the XML
    document), no JavaScript is required.
    > In other words, I'd like to have a way to put a link in
    the
    > middle of a line of text and have it call an
    ActionScript
    > function when clicked.
    Assuming you're using HTML-formatted text, it's as easy as
    using the
    asfunction pseudo protocol, instead of the http protocol. For
    example:
    var tf:TextField = this.createTextField("sampleTF", 0, 0, 0,
    0, 0);
    tf.autoSize = "left";
    tf.html = true;
    tf.htmlText = "<p>Lorem ipsum dolor <a
    href='asfunction:myFunction'>sit
    amet</a>.</p>";
    function myFunction():Void {
    trace("I've been clicked!");
    If your function accepts parameters, send those in as a
    string, like
    this:
    tf.htmlText = "<p>Lorem ipsum dolor <a
    href='asfunction:myFunction,param'>sit
    amet</a>.</p>";
    function myFunction(msg:String):Void {
    trace(msg);
    In the above example, the parameter's value is "param", so
    that string
    gets passed into the function, where it is intercepted as the
    variable msg.
    The line trace(msg) will trace "param" to the Output panel.
    David Stiller
    Co-author, Foundation Flash CS3 for Designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

  • How can i call a function of a swf-file which is embedded as a Resource in 3D-Annotation?

    Hi.
    I use a Flash-menu as an embedded *.swf in a 3D-Annotation. Now i want to trigger one of the ActionScript-Function out of the 3D-Annotation.
    How can i get access to that function?
    Cause of it is embedded, the callAS() Methods still not possible. But how else can i do that?
    Can u give me a simple example? How is the usability of Flashvariable in the Ressource-Tab of 3d-Annotation?
    Kind regards
    Florian

    It depends to some extent on how your SWF has been bound to the 3D scene. If you have bound it using a script, then you have a FlashMovie object that has a .call() method - but if you've attached it to something using the binding option on the Resources panel you will need to collect a reference first. If you know you are going to talk to the SWF it's best to bind it using JavaScript.
    Let us assume you have a SWF in the resources collection but it's not bound to anything. In the 3D scene there is an object called 'cube' on which the SWF must appear as a material, and the SWF has declared a function to the ExternalInterface engine that is called "myFunction", which expects a string as a variable. Here's what you would put in the script attached to the 3D scene:
    var fm = new FlashMovie("demo.swf");
    var matl = scene.meshes.getByName("cube").material;
    matl.useFlashMovie(fm);
    fm.call("myFunction","hello");
    The call() method is strictly typed - for example if your AS function expects a boolean and you sent it a string, it will not execute. There is also a limit on the possible returned variables - e.g. you cannot send back an Object.
    Note that commands sent in the other direction using ActionScript's ExternalInterface.call() method are targeted at  document-level by default, not at the 3D API - so if your AS is trying to call something it must exist as a document-level JavaScript function. It is possible to divert this traffic into the 3D API using the FlashEventHandler object, but it gets complicated as your code must implement XML encoding of the traffic - this is done automatically by the document-level script but not by the 3D API.
    To answer your second question, in the resources dialog you can define the FlashVars string which is passed to the SWF when it loads - this is the same URL-encoded set of variables that you would send to a SWF when embedding it in an HTML page. It's a static string; you cannot read or edit it with JavaScript but this means it will still work if the user disables the JavaScript engine.

  • Trigger actionscript from end of captivate movie

    Hi Guys,
    I'm going insane trying to work out how to trigger an
    actionscript event from the last slide of my Captivate movie.
    Basically I'm doing a product walk through which I am exporting as
    a swf an then dynamically loading into my flash file.
    I need to be able to detect when the externally loaded
    Captivate swf has completed playback so that I can then continue on
    with the rest of my flash movie.
    I have tried adding a swf in Captivate with actionscript to
    trigger the event at the end of the slide but it doesn't work?
    I have also tried exporting the whole thing as an fla and
    then re exporting it from Flash MX 2004 and the animation seems to
    get ruined and out of synch.
    Any ideas on how I can detect and trigger and AS event when
    the loaded Captivate swf has completed would be much appreciated.
    Thanks heaps for reading.
    Chris

    hi Chris
    i created a similar workaround. i ran into a number of issues
    when trying to call an actionscript function at the end of a
    Captivate swf. i determined that captivate is VERY picky about
    imported swfs. for instance, i had a single imported swf that
    contained an animated background and one line of actionscript, and
    it never worked. however, when i split it into two separate swfs
    (one just for graphics, one just for actionscript), it worked! go
    figure.
    i also noticed you have to be careful where you place it on
    the captivate timeline, depending on what you're trying to do. if
    you're calling an end-of-movie function, be sure the swf is only on
    the last few frames of the last slide. sometimes when i placed the
    actionscript swf on the first frame of my last slide it wouldn't
    work, but after moving it down a bit, it worked fine.
    lastly, i had to use "_root" to get mine working. i know many
    people consider it bad form, but if it works, it works. i did the
    following:
    1. created a function in my Flash interface named "endDemo()"
    2. created an empty Flash file with one line of actionscript:
    _root.endDemo();
    3. imported the swf into my captivate movie and placed it on
    the last few frames of the last slide.
    4. set my captivate movie prefs to stop at the end of the
    movie, and not to fade out.
    worked for me... good luck!
    - philip

Maybe you are looking for

  • HT1296 my calendar is showing all the birthdays listed against people in my contacts list a day earlier than they should. Why?

    Since receiving a new iPhone 4S to replace a previous phone, my calendar is now showing all birthdays as being a day before the date they are listedon within my contacts list. Any ideas why and how to rectify?

  • Veto closing of Tab in TabPane

    Hi, I'm showing multiple editors inside a tab-folder and if the user closes a Tab which is dirty I'd like to step in and show a confirmation dialog to the user asking if he'd really like to close the tab and else leave it open. Maybe I'm missing some

  • New 27" i7 shuts down instead of sleeping

    Well, my brand new (just out of the box) 27" i7 iMac doesn't want to sleep: it shuts down immediately instead. Not a normal shut down, but it LOOKS like it's going to sleep, but it won't wake. It's not simply that she screen remains black, but it's s

  • Lens Distortion Correction Documentation?

    I have seen in some discussions that LR corrects lens distortion for some lenses and some cameras.  I have not been able to find documentation that indicates what cameras and lenses are supported for this - either for LR2.3 or 3.0beta.  Is that docum

  • CIF R3 material as Resource into APO

    Hi  Experts,    We have a requirement to CIF R3 material (belonging to a specific material group) in our case its packing material group (Vessel) as a Transportation Resouce in APO. We need these Products as a transportation resource in TP/VS. Regard