LocalConnection and attachMovie...

SORRY(BUT FOR ANYONE INTERESTED, THE PROBLEM WAS THE WORD
"THIS" IN THE RECIEVING SWF... CHANGED TO _ROOT AND IT WORKS)
hello,
in the first (sending) swf is this code:
one.onRelease=function(){
var nChosen:Number=1;
var sending_lc:LocalConnection = new LocalConnection();
sending_lc.send("lcNumber", "methodToExecute", nChosen);
two.onRelease=function(){
var nChosen:Number=2;
var sending_lc:LocalConnection = new LocalConnection();
sending_lc.send("lcNumber", "methodToExecute", nChosen);
and in the recieving .swf:
// Code in the receiving SWF file
this.createTextField("result_txt", 1, 10, 10, 100, 22);
result_txt.border = true;
var receiving_lc:LocalConnection = new LocalConnection();
receiving_lc.methodToExecute = function(nChosen:Number) {
this.attachMovie("circle"+nChosen, "circle",
this.getNextHighestDepth(), {_x:180, _y:18});
result_txt.text = nChosen;
receiving_lc.connect("lcNumber");
the textField properly displays nChosen, but the movieClip is
not attaching (yes, the linkage name is set up, they are circle1
and circle2)
help appreciated thanks!

http://www.adobe.com/devnet/director/articles/local_connect_objects_03.html#prepare:
quote:
Known Issues
At this time, there are some situations in which
LocalConnection objects do not behave as expected. These issues
only arise for those using LocalConnection objects in Director MX
2004/Shockwave Player 10 to connect with LocalConnection objects in
Flash MX/Flash Player 6/Director MX. In these cases, the clients
are both able to connect and exchange messages without producing
any errors. The difficulty is that when the Director MX
2004/Shockwave Player 10 client receives incoming messages, the
allowDomain callback function is triggered as expected, but
regardless of the return value it provides, the incoming message
appears to be ignored. There are no known workarounds for this
issue at this time, so the best measure of protection is to ensure
that these version mismatches don't occur.
however I am using Director10 and FlashCS3;
dsdsdsdsd

Similar Messages

  • How I remove previous MC created with createmovieClip() and attachMovie()

    Hello.
    i have another problem today, :-)
    my little application contain a combobox and a MC "filmstrip" in my _root. the combobox work with an xml file containing links to other xml files. Inside my MC "filmstrip" i have a script loading with a for loop the xml file selected in the combobox on the _root .
    In this loop i createEmptyMovieClip an attachMovies with the data  of the xml selected.
    evrything works exept that evrytime i change my selection in the combobox it load the data  on top of the previous load.
    I would like to delete  the previous load before load the new one... if someone can help me???
    On my scene 1st frame i have only a code for scroll the movieclip filmstrip but i think is not nescessary that i show it.
    here is the code inside the MC fimlstrip (sorry but i put all the code). i attach an example aswell
    var link1:Array = new Array();
    var url:String;
    var theUrl:String;
    var whoOn:Number;
    whoOn = 1;
    //load the  xml containing the link for T.Load() function
        var x:XML = new XML();
        x.ignoreWhite = true;
    x.onLoad = function(success) {
            var photos:Array = this.firstChild.childNodes;
            for (i=0; i<photos.length; i++) {
                link1.push(photos[i].attributes.link1);
            url = link1[whoOn];
            theUrl = url;
            _root.filmstrip.Tload(theUrl);
            _root.lengthscroll(theUrl);
        x.load("category.xml");
    //create the Listener object
    var cbListener:Object = new Object();
    //create tee change function
    cbListener.change = function(event_obj:Object) {
        if (_root.select.selectedItem.label == "Last updated") {
            whoOn = 0;
        } else if (_root.select.selectedItem.label == "Special") {
            whoOn = 1;
        trace(_root.select.selectedItem.label);
        url = link1[whoOn];
        trace("url is "+_root.filmstrip.url);
        theUrl = url;
        _root.lengthscroll(theUrl);
        Tload(theUrl);// set the url to load in the T.load()
    _root.select.addEventListener("change",cbListener);
    function Tload(theUrl) {//function that load the url selected in the combobox
        var T:XML = new XML();
        T.ignoreWhite = true;
        var thumb:Array = new Array();//create array
        var thTxt:Array = new Array();
        var DescTXT:Array = new Array();
        var priceTXT:Array = new Array();
        var linkTXT:Array = new Array();
        var Modelink = "http://www.windi.no/catalog/advanced_search_result.php?keywords=";//1st part of the link for when you click on the tumbnails
        var Spc = 0;// space between thumbnail default 0
        var posX = 0;// thumbnail position x
        var posY = 0;//thumbnail 1st position y
        var tl:MovieClip = this;
        var whoIsOn:Number;
        whoIsOn = 0;
        T.onLoad = function(xml) {
            var photos:Array = this.firstChild.childNodes;
            //loop the php Xml for the thumbnail
            for (i=0; i<photos.length; i++) {
                var Num = i+1;
                var WhoIsOn = Num;
                var TXTCLIP = "TXTCLIP"+Num;
                var TXTCLIP2 = "TXTCLIP2"+Num;
                var TXTCLIP3 = "TXTCLIP3"+Num;
                var Clp_name = "clip"+Num;
                var Bt_name = "Bt"+Num;
                var container = (container+Num);
                //put each attributs of thumbnail for each photos node
                thTxt.push(photos[i].attributes.thumbtext);
                thumb.push(photos[i].attributes.thumbnail);
                DescTXT.push(photos[i].attributes.thumbdesc);
                priceTXT.push(photos[i].attributes.thumbprice);
                linkTXT.push(photos[i].attributes.thumbmodel);
                _root.Text_Thumbnail(thTxt[whoIsOn]);
                _root.bigphotos.loadMovie(thumb[whoIsOn],1);
                var fullink = (Modelink+linkTXT[i]);//the 2nd part of the "Modelink"
                //display Tiles
                var TXT:MovieClip = tl.attachMovie("TXTCLIP", TXTCLIP, tl.getNextHighestDepth());
                TXT._x = posX+120;
                TXT._y = posY+Spc+13;
                TXT.titleTXT.text = thTxt[i];
                //desccription
                var TXT2:MovieClip = tl.attachMovie("TXTCLIP2", TXTCLIP2, tl.getNextHighestDepth());
                TXT2._x = posX+120;
                TXT2._y = posY+Spc+30;
                TXT2.titleTXT.text = DescTXT[i];
                // display prices
                var TXT3:MovieClip = tl.attachMovie("TXTCLIP3", TXTCLIP3, tl.getNextHighestDepth());
                TXT3._x = posX+120;
                TXT3._y = posY+Spc+90;
                TXT3.titleTXT.text = priceTXT[i];
                //display thumbnails
                var container:MovieClip = tl.createEmptyMovieClip(Clp_name, tl.getNextHighestDepth());
                container.loadMovie(thumb[i],1);
                container._yscale = 30;
                container._xscale = 30;
                container._x = posX;
                container._y = posY+Spc;
                //for the OnRelease function on the thumbnail
                var BT:MovieClip = tl.attachMovie("Btb", Bt_name, tl.getNextHighestDepth());
                BT._x = posX;
                BT._y = posY+Spc;
                BT.whoIsOn = i;
                BT.onRelease = function() {
                    stopAllSounds();
                    getURL((Modelink+linkTXT[this.whoIsOn]));//this is the link when you click on the thumbnail
                BT.onRollOver = function() {
                    _root.Text_Thumbnail(thTxt[this.whoIsOn]);//display the title of the thumbnail by rolling over
                    _root.whoIsOn = this.whoIsOn;
                    _root.bigphotos.loadMovie(thumb[this.whoIsOn],1);//Display the poto of the thumbnail by rolling over
                BT.onRollOut = function() {
                    _root.Text_Thumbnail("");
                Spc = Spc+160;//for the space betwen the clips           
        //load the xml file selected in the combobox
        trace("the url loaded is: "+theUrl);
        T.load(theUrl);//Load the url selected in the combobox

    created a function for remove the movieClips bu it dont wotk :
    var link1:Array = new Array();
    var url:String;
    var theUrl:String;
    var whoOn:Number;
    whoOn = 1;
    //HERE MY FUNCTION
    function reset_all() {
        _root.filmstrip.removeMovieClip();
    //<---TO HERE
    //load the  xml containing the link for T.Load() function in filmstrip movie clip the xml file
    function loadCat() {
        var x:XML = new XML();
        x.ignoreWhite = true;
        x.onLoad = function(success) {
            var photos:Array = this.firstChild.childNodes;
            for (i=0; i<photos.length; i++) {
                link1.push(photos[i].attributes.link1);
            url = link1[whoOn];
            theUrl = url;
            _root.filmstrip.Tload(theUrl);
            _root.lengthscroll(theUrl);
        x.load("category.xml");
    loadCat();
    //create the Listener object
    var cbListener:Object = new Object();
    //create tee change function
    cbListener.change = function(event_obj:Object) {
        if (_root.select.selectedItem.label == "Last updated") {
            whoOn = 0;
        } else if (_root.select.selectedItem.label == "Special") {
            whoOn = 1;
        trace(_root.select.selectedItem.label);
        url = link1[whoOn];
        trace("url is "+_root.filmstrip.url);
        theUrl = _root.filmstrip.url;
        _root.lengthscroll(theUrl);
        Tload(theUrl);// set the url to load in the T.load() function in filmstrip
    _root.select.addEventListener("change",cbListener);
    function Tload(theUrl) {//function that load the url selected in the combobox
        var T:XML = new XML();
        T.ignoreWhite = true;
        var thumb:Array = new Array();//create array
        var thTxt:Array = new Array();
        var DescTXT:Array = new Array();
        var priceTXT:Array = new Array();
        var linkTXT:Array = new Array();
        var Modelink = "http://www.windi.no/catalog/advanced_search_result.php?keywords=";//1st part of the link for when you click on the tumbnails
        var Spc = 0;// space between thumbnail default 0
        var posX = 0;// thumbnail position x
        var posY = 0;//thumbnail 1st position y
        var tl:MovieClip = this;
        var whoIsOn:Number;
        whoIsOn = 0;
        T.onLoad = function(xml) {
           reset_all(); /// HERE I APLY IT
            var photos:Array = this.firstChild.childNodes;
            //loop the php Xml for the thumbnail
            for (i=0; i<photos.length; i++) {
                var Num = i+1;
                var WhoIsOn = Num;
                var TXTCLIP = "TXTCLIP"+Num;
                var TXTCLIP2 = "TXTCLIP2"+Num;
                var TXTCLIP3 = "TXTCLIP3"+Num;
                var Clp_name = "clip"+Num;
                var Bt_name = "Bt"+Num;
                var container = (container+Num);
                //put each attributs of thumbnail for each photos node
                thTxt.push(photos[i].attributes.thumbtext);
                thumb.push(photos[i].attributes.thumbnail);
                DescTXT.push(photos[i].attributes.thumbdesc);
                priceTXT.push(photos[i].attributes.thumbprice);
                linkTXT.push(photos[i].attributes.thumbmodel);
                _root.Text_Thumbnail(thTxt[whoIsOn]);
                _root.bigphotos.loadMovie(thumb[whoIsOn],1);
                var fullink = (Modelink+linkTXT[i]);//the 2nd part of the "Modelink"
                //display Tiles
                var TXT:MovieClip = tl.attachMovie("TXTCLIP", TXTCLIP, tl.getNextHighestDepth());
                TXT._x = posX+120;
                TXT._y = posY+Spc+13;
                TXT.titleTXT.text = thTxt[i];
                //desccription
                var TXT2:MovieClip = tl.attachMovie("TXTCLIP2", TXTCLIP2, tl.getNextHighestDepth());
                TXT2._x = posX+120;
                TXT2._y = posY+Spc+30;
                TXT2.titleTXT.text = DescTXT[i];
                // display prices
                var TXT3:MovieClip = tl.attachMovie("TXTCLIP3", TXTCLIP3, tl.getNextHighestDepth());
                TXT3._x = posX+120;
                TXT3._y = posY+Spc+90;
                TXT3.titleTXT.text = priceTXT[i];
                //display thumbnails
                var container:MovieClip = tl.createEmptyMovieClip(Clp_name, tl.getNextHighestDepth());
                container.loadMovie(thumb[i],1);
                container._yscale = 30;
                container._xscale = 30;
                container._x = posX;
                container._y = posY+Spc;
                //for the OnRelease function on the thumbnail
                var BT:MovieClip = tl.attachMovie("Btb", Bt_name, tl.getNextHighestDepth());
                BT._x = posX;
                BT._y = posY+Spc;
                BT.whoIsOn = i;
                BT.onRelease = function() {
                    stopAllSounds();
                    getURL((Modelink+linkTXT[this.whoIsOn]));//this is the link when you click on the thumbnail
                BT.onRollOver = function() {
                    _root.Text_Thumbnail(thTxt[this.whoIsOn]);//display the title of the thumbnail by rolling over
                    _root.whoIsOn = this.whoIsOn;
                    _root.bigphotos.loadMovie(thumb[this.whoIsOn],1);//Display the poto of the thumbnail by rolling over
                BT.onRollOut = function() {
                    _root.Text_Thumbnail("");
                Spc = Spc+160;//for the space betwen the clips           
        //load the xml file selected in the combobox
        trace("the url loaded is: "+theUrl);
        T.load(theUrl);//Load the url selected in the combobox

  • Dynamic text and attachMovie

    OK here is my function
    This works to produce a simple text effect. The problem
    arises when I try to use it multiple times. The variable "theText"
    either is written twice (I only get one string twice on the screen)
    or the two get mixed together( half of on "theText" and part of the
    last function calls "theText". I need to be able to use the effect
    more than once throughout a linear animation. Can anyone please
    help solve this. I have a deadline and I am obviously out of my
    league.
    speed = 50;
    i=1;
    function newText1(theText,space,initX,initY) {
    if(i<theText.length+1) {
    thisLetter = theText.substring(i-1,i);
    textMovies = attachMovie("textBox","textBox"+i,i);
    textMovies._x = textMovies._x + initX
    textMovies._x = textMovies._x + initX +(space * i);
    textMovies._y = initY;
    textMovies.theText = thisLetter;
    ++i;
    } else {
    trace("Interval Cleared");
    clearInterval(intevalID);
    intevalID = setInterval(newText1,speed,"test?",12,5,60);

    It's simple but confusing. The default path on your local
    machine (while testing) starts from the directory the .SWF file is
    in.
    The default path on the server starts from the directory the
    .HTML file is in.
    If you keep HTML and SWF in the same directory, you don't
    need to worry. Otherwise you need to take care.
    Good luck
    Wolf

  • Flash Player 9, Director MX, LocalConnection and the file system sandbox

    I have a Director MX asset to which I have no source-code
    access. Previously I could use LocalConnection in a Flash Player 8
    projector to interact with the Director app, local to the
    file-system. I seem unable to do the same thing with a Flash Player
    9 projector. The director asset looks for and loads the relevant
    Flash projector and unloads itself when it is no longer present,
    and this functionality continues without a problem. However, when I
    use the LocalConnection.send method, the Flash player does not
    receive the expected responses.
    I know that this is a rather general and abstract question:
    put simply, does anyone know whether Flash Player 9 and Director MX
    can't talk to each other using LocalConnection?
    ps to pre-empt over-enthusiastic respondees, yes I am aware
    of other technologies such as AIR, Zinc etc, and no they're not a
    viable option for my particular project.

    Hi,
    the following sourcecode is compiled with Flexbuilder 2 and
    runs in flashplayer 9.0.115 as expected.
    How do you trigger the effect?
    best regards,
    kcell
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Button label="run"
    click="{wr1.play();}"></mx:Button>
    <mx:Label id="l1" top="20" text="this is label"
    visible="false"/>
    <mx:Image id="img1" source="@Embed('k.jpg')" top="40"
    visible="false"/>
    <mx:WipeRight id="wr1" target="{img1}" duration="1000"
    effectStart="img1.visible=true" effectEnd="{wr2.play();}"/>
    <mx:WipeRight id="wr2" target="{l1}" duration="1000"
    effectStart="l1.visible=true"/>
    </mx:Application>

  • LoadClip and attachMovie don't work together?

    Hi,
    I have an empty movie clip on stage ("mc1") that I use
    loadClip to get a PNG in there.
    Then I'd like to attach another MC to that same mc1 ("txt1").
    But it won't work.
    Everything else works, and I can attach the txt1 clip to
    other MCs on the stage, but not mc1.
    var curClip = mc1.attachMovie("txt1", "tempName",
    mc1.getNextHighestDepth());
    A trace of curClip yields "undefined" as does
    trace(typeof(curClip));
    Am I trying to break some laws of Flash Physics here?
    (Note: trace(mc1.getNextHighestDepth()); yields 0... why's
    that?)
    Thanks!

    yes, that's a no-no. you can create a child movieclip of mc1,
    load your target into that and attach a movieclip to mc1 and both
    (the load target and attached movieclip) will continue to
    exist.

  • LocalConnection and BitmapData

    Hi.
    I have a promlem with transferring BitmapData from one swf to
    another by using LocalConnection:
    //1st swf
    sending_lc.send("lc_name", "functionName", 1, "2",
    myBitmapData);
    //2nd swf
    receiving_lc.functionName = function(a,b,c){
    trace(a);// output 1
    trace(b);// output 2
    trace(c);// output undefined <<<PROBLEM:)
    Can anybody help me, please?
    Thank you!

    This post has a duplicate entry, original here:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=288&threadid =1279966&enterthread=y

  • LocalConnection and BitmabData

    Hi.
    I have a promlem with transferring BitmapData from one swf to
    another by using LocalConnection:
    //1st swf
    sending_lc.send("lc_name", "functionName", 1, "2",
    myBitmapData);
    //2nd swf
    receiving_lc.functionName = function(a,b,c){
    trace(a);// output 1
    trace(b);// output 2
    trace(c);// output undefined <<<PROBLEM:)
    Can anybody help me, please?
    Thank you!

    No, its not about the limit, its about the complex type of
    the object being sent. Flash uses references for complex objects
    when they are passed to functions as arguments. When using
    LocalConnection the SWF you send the BitmapData has a different
    memory address space than the receiving SWF so you get an
    undefined.
    Try it for yourself. Use 3 tier approach of LocalConnection:
    SWF1 <-----> SWF_GATEWAY <-----> SWF2
    1) non-working scenario:
    SWF1 sends BitmapData to SWF_GATEWAY that in turns sends it
    to SWF2, it will not work.
    2) working scenario:
    SWF1 sends BitmapData to SWF_GATEWAY that in turns sends it
    back to SWF1, it will work.

  • Xml gallery with createEmptyMovieClip and attachMovie

    how i can make it so that flash loads in the xml document
    containing my images, create an empty movieclip for each image, and
    actually display that image from the xml file in the newly created
    empty movie clip.
    Please if some one knows..
    I'm new in Flash and Actioscript.
    Thanks.

    how i can make it so that flash loads in the xml document
    containing my images, create an empty movieclip for each image, and
    actually display that image from the xml file in the newly created
    empty movie clip.
    Please if some one knows..
    I'm new in Flash and Actioscript.
    Thanks.

  • AttachMovie and removeMovieClip not working

    I've got three buttons which I want to start playing three
    different movies when clicked. Each button click should cancel the
    movie already playing and start up the new one. This sounds simple.
    For some reason I'm having all sorts of trouble with this. The
    first movie plays, but the others never start. What am I doing
    wrong here? Thanks for looking at my code. :)

    I've removed the mouse actions so that I have just
    this.mov_btn1.onRelease = function() {
    and my code inside, but it's still not working. For some
    reason I cannot get the currently playing movie to quit AND start a
    new movie right afterward. Maybe I should use some sort of wait
    function between removeMovieClip and attachMovie?

  • Flex SWFLoader LocalConnection Click events problem

    Hi,
    I'm experiencing a issue while trying to integrate a SWF movie with Flex for using it to create an AddOn for Xcelsius SDK. The idea is to create a Map Addon , just like the ones that are included with Xcelsius but with a custom map of the region where i live.
    The swf communicates with Flex through a LocalConnection and sends a message each time a region has been clicked, Flex retrieves this event and copies a data row to another place in the Excel Spreadsheet, so other diagramms can feed themselves with this data and represent it or whatever.
    This localconnection works just fine when i execute the Flex Project alone, but when i generate the Addon (using the AddOn packager), this stops working. I introduced a label to use as debug so each time a message from the swf file comes , Flex will write the message in this Label.
    What i saw, and that is the strange part of this issue. is that this label is being Updated also in Xcelsius, because when i leave the Preview mode i can see on the edit window that the label has changed its text, but not during the Preview mode (it is where i need it to work)
    I am using Xcelius SDK 2.0.1 Hotfix 3 , Flex Builder 2, Flash cs5 (tried with AS2, AS3 and exporting for multiple browser)
    Has anybody experience the same issue?
    Know somebody a howto, tutorial or sample of a Custom map in Xcelsius?
    Where can i find good Documentation? (i have already the samples and tutorials from SAP)
    Thanks in advance,
    Alex.

    How are you embedding the map?
    Xcelsius does not use Flash maps (so does not embed them in a SWF).
    You may be better off using SVG for your map and compiling it into the Flex project using the [Embed] metadata like you can for SVG.
    Or like I did with AnyMap parse and draw the SVG on the fly instead.
    That way you don't need to embed a Flash map and use the LocalConnection.
    Regards
    Matt

  • LocalConnection: Receiving message from flash(.swf) file

    hi
    I have got a flash radio file (.swf) from third party which playes the songs. I need to integrate this inside my application.Application is portal and written in asp.net which launches this flash file as pop-up
    Scenario is : When user click on any song in .swf file, at the application we should be able to display its title.
    I have found(through reverse enginnering) that radio.flash file uses localConnection and send following parameters whenever the user click on any song.
    conn.send("basePlayerConnect,"setPlayerLabel","title","thumb","albumtitle")
    where title is string, thumb is image and albumtitle is string
    Now i have written a another flex application which has a textinput. i emebeded this in the portal application (as embedded .swf file). Whenever a radio popup is launch at site and user click on any song the title of the song should be displayed inside this flex application
    Code is:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="{createLw()}">
    <mx:Script>
        <![CDATA[
        import flash.net.LocalConnection;
        private var incoming_lc:LocalConnection = new LocalConnection();
        private function createLw()
            incoming_lc.connect("basePlayerConnect");
              incoming_lc.client = this;
        function setPlayerLabel(param1:String,param2:String,param3:String):void
          sentMessage_txt.text = "param1";
        ]]>
    </mx:Script>
        <mx:TextInput id="sentMessage_txt" x="0" y="0"/>
    </mx:Application>
    this is very imp for me please let me know how to ahieve this

    Try
        public function setPlayerLabel(param1:String,param2:String,param3:String):void
          sentMessage_txt.text = param1;     // no quotes
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • AIR to AIR localconnection working only in one direction

    I have two simple air applications and i need to be able to send a message to the opposite app on the click of a button. My code works fine from app1 to app2 but i am getting the following error when trying to send a message from app2 to app1: Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095: flash.net.LocalConnection was unable to invoke callback returnMessageHandler. error=ReferenceError: Error #1069: Property returnMessageHandler not found on flash.net.LocalConnection and there is no default value.
    Here is my code:
    App1
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initConn();">
        <mx:Script>
            <![CDATA[
                import mx.controls.Alert;
                import flash.net.LocalConnection;
                public var conn:LocalConnection;
                public function initConn():void
                    conn = new LocalConnection();
                    conn.allowDomain("app#app2");
                    conn.addEventListener(StatusEvent.STATUS, onStatus);
                    //Alert.show(conn.domain);
                    try
                        conn.connect("returnConnection");
                    catch (error:ArgumentError)
                        trace("Can't connect.");
                private function onStatus(event:StatusEvent):void
                    switch (event.level)
                        case "status":
                            //Alert.show("LocalConnection.send() succeeded");
                            break;
                        case "error":
                            //Alert.show("LocalConnection.send() failed");
                            break;
                public function returnMessageHandler():void
                    Alert.show("Recieved return message from app2");
                public function sendMessage():void
                    conn.send("app#app2:taskConnection", "localconnectionHandler");
            ]]>
        </mx:Script>
        <mx:Button x="10" y="10" label="send message" click="sendMessage();"/>
    </mx:WindowedApplication>
    App2
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="InitConn();">
        <mx:Script>
            <![CDATA[
              import mx.controls.Alert;
              import flash.net.LocalConnection;
              public var conn:LocalConnection;
              public function InitConn():void
                    conn = new LocalConnection();
                    conn.addEventListener(StatusEvent.STATUS, onStatus);
                    conn.allowDomain("app#app1");
                    conn.client = this;
                    //Alert.show(conn.domain);
                    try
                        conn.connect("taskConnection");
                    catch (error:ArgumentError)
                        trace("Can't connect.");
                public function onStatus(event:StatusEvent):void
                    switch (event.level)
                        case "status":
                            Alert.show("LocalConnection.send() succeeded");
                            break;
                        case "error":
                            Alert.show("LocalConnection.send() failed");
                            break;
                public function localconnectionHandler():void
                    Alert.show("Recieved message from app1");
                public function sendReturnMessage():void
                    conn.send("app#app1:returnConnection", "returnMessageHandler");
            ]]>
        </mx:Script>
        <mx:Button x="10" y="10" label="send return message" click="sendReturnMessage()"/>
    </mx:WindowedApplication>
    If anyone can plese help me figure this out I would greatly appriciate it I'm tearing my hair out!
    Thanks
    Adam
    Flexchief

    I figured out what my problem was...
    app1 needed the following line: conn.client = this;
    in order to receive the return message from app2.
    Flexchief

  • DispatchEvent not working in debug mode

    Hello,
    I have a localconnection, and when I receive a message from
    the local connection I dispatch an event. However, the dispatch
    event does not work. I step into the code and go into some
    Macromedia code for the "mx.events.EventDispatcher.dispatchEvent"
    and "mx.events.EventDispatcher.dispatchQueue", and when I inspect
    my variables the eventObj has both a target and a type set, but
    when the code tries to access them through eventObj.target and
    eventObj.type it returns null.
    Also, this only happens in debug mode (Debug -> Debug
    Movie) and not in test mode (Control -> Test Movie). In test
    movie the exact same code works flawlessly.

    Im not very sure just try to help but look this one
    mx.utils.Delegate
    i look for some issue with your problem and i think this can help
    you.

  • Troubles importing Flash 10 Animation with 3D Transform

    I am looking for any workaround/experiences for importing a Flash 10 animation with 3D transforms. Currently, doing this will wig out Captivate 4 and break the embedded animation in all sorts of ways. AS3 support in Captivate is turned on and the same animation will load and play correctly if the 3D transform is removed. All other Flash 10/AS3 possibilites work including motiosn graphs and filters.
    I find the 3D transform option of Flash CS4 to be one of the most powerful features ever introduced in Flash and would allow some incredible breakthrough design possibilities for my Captivate projects, if it would just support it! Any experiences with this issue welcomed. A bug report has been submitted also, but looking for a quicker remedy.

    Problem Resolved!
    I got this tip from Vikram (Adobe Support)
    1. Open your project having Flash Player 10 animations involving 3D transforms.
    2. Click the Edit menu and select Preferences.
    3. Select "Publish settings" under the "Project" section.
    4. Check "Animations" option under the "Externalize resources" section.
    5. Press OK.
    6. Now click the publish button.
    7. In the publish dialog, select Flash Player 10 from the "Flash Player version:" drop down.
    8. Click publish.
    (F4 preview may not work, so use preview in browser)
    Also, you may need to be wary of embedded scripted symbols as they may loose reference to the parent symbol after being embedded in yoru your CP4 project containing 3D transforms. My advice here is to try to script using as much object oriented js as possible in the main timeframe.
    I am using a combination of localConnect and ExternalInterface functions to control the 3D animation from captivate quiz buttons. This process adds a whole new level of interactivity and visual interest to your captivates!

  • EASY Question - But Hard for the Actioscript inept

    Ok,
    So this is my first attempt at making a web page...
    I am trying to simply make my little button display my movie
    labeled "Content", I don't think I am doing somthing right...
    Doh....
    I have diffrent movies (p1 & p2) for button rollover
    effects... and I have a seperate clip named content with labels for
    "start1" and "start2" that I want to display when I click the
    buttons
    Anywho if you would like to take a look see I would be very
    thankful:
    http://www.itamidesign.com/test.fla
    Thanks for your help...
    -Todd

    Something went wrong when I tried your link.
    Is your movie inside your flash program or is it an external
    movie?
    If you have named your button something like myBtn, then you
    can put in some actionscript to load an external movie such as:
    myBtn.onRelease = function():Void
    movieHolder.loadMovie("content");
    where movieHolder is the name of an empty movie clip that you
    place on the stage to hold external movies.
    Alternately, you can add the code to the button itself. In
    this case you don't need to give the button an instance name:
    on (release)
    movieHolder.loadMovie("content");
    If your movie is already part of your Flash program, instead
    of an external file, then you will need to go into the linkage
    properties of the movie and check: "Export for ActionScript". You
    do this by right clicking on the movie in the library. You must
    give the movie a name when you do this. You can still call it
    "Content". Next you use one of the formats listed above except
    change loadMovie to attachMovie. (Actually they might both still
    work, but I have been in the habit of using loadMovie for external
    content and attachMovie for internal content. Don't ask me why, I
    just try things and when they work, I tend to repeat that method of
    doing things.)
    For attachMovie, you will need to give your clip a level
    number. You can hard code in a number if you want any movie you
    attach to replace the prior movie or you can use:
    movieHolder.getNextHighestDepth() if you want your movie to be
    placed on top of anything else that you already have in the movie
    holder without replacing it.
    You can type loadMovie or attachMovie in the search bar of
    the built in help menu to see more examples. If you have further
    questions such as how to make the movie holder, be sure to ask a
    follow up question.

Maybe you are looking for