LocalConnection to perform a function in another .swf works do not...

I am trying to establish a LocalConnection so that I can communicate my navbar & the home page on my site. Here is the code I have so far for the sending and reception of AS3 files, let me know if you see something out of the ordinary. The idea is that, when you click on one of the icons on the navigation bar of my slides 'book' to the center of the screen on the right page. Actually I have 4 buttons, but included only the code that I use for two in order to make this shorter post. The same idea is used for four good buttons.

Sending:

var sending_lc:LocalConnection;

sending_lc = new LocalConnection();

servicesBtn.buttonMode = true;

portfolioBtn.buttonMode = true;

function servicesBtnOver(event:MouseEvent):void {}

servicesBtn.gotoAndPlay ('over');

}

function servicesBtnOut(event:MouseEvent):void {}

servicesBtn.gotoAndPlay ('out');

}

function servicesBtnClick(event:MouseEvent):void {}

sending_lc. Send ("my_lc_as3", "gotoServicesPage");

}

servicesBtn.addEventListener (MouseEvent.ROLL_OVER, servicesBtnOver);

servicesBtn.addEventListener (MouseEvent.ROLL_OUT, servicesBtnOut);

servicesBtn.addEventListener (MouseEvent.CLICK, servicesBtnClick);

function portfolioBtnOver(event:MouseEvent):void {}

portfolioBtn.gotoAndPlay ('over');

}

function portfolioBtnOut(event:MouseEvent):void {}

portfolioBtn.gotoAndPlay ('out');

}

function portfolioBtnClick(event:MouseEvent):void {}

sending_lc. Send ("my_lc_as3", "gotoPortfolioPage");

}

portfolioBtn.addEventListener (MouseEvent.ROLL_OVER, portfolioBtnOver);

portfolioBtn.addEventListener (MouseEvent.ROLL_OUT, portfolioBtnOut);

portfolioBtn.addEventListener (MouseEvent.CLICK, portfolioBtnClick);

Reception:

import com.greensock;

com.greensock.easing import. *;

var receiving_lc:LocalConnection;

receiving_lc = new LocalConnection();

receiving_lc. Connect ("my_lc_as3");

receiving_lc.client = this;

var bookPosition:String = "rise."

function gotoServicesPage(event:MouseEvent):void {}

book.gotoAndStop ('webDesignPage');

}

If (bookPosition is 'up');

{

TweenLite.to (Book 2, {y:830});})

var bookPosition = "down".

}

}

function gotoPortfolioPage(event:MouseEvent):void {}

book.gotoAndStop ('porftolioPage');

If (bookPosition is 'up');

{

TweenLite.to (Book 2, {y:830});})

var bookPosition = "down".

}

}

The reason I'm followed by whether the book is in 'up' or 'down' so that it was in the down position, already it is not re-tween on the screen. I'm new to the declarant and by using variables. TweenLite; and LocalConnection so there's probably a simple with my AS3 code problem (even if no errors are coming in Flash). Any help would be appreciated.

You should produce something inslideServicesIn() function to verify that LC works in principle.

Output trace or create a TextField.

Tags: Adobe Animate

Similar Questions

  • perform a function after another

    Hello

    I have a function that loads an image from the web and change the size of the image within an iterative loop. There is a Leo and a listener on the charger for loading is complete:

    for (var i: uint = 0; i < = 10; i ++)
    {

    my_loader.contentLoaderInfo.addEventListener (Event.COMPLETE, onCompleteHandler);
    function onCompleteHandler(evt:Event)
    {. / / change the size of the image / /}

    other instructions...

    }

    I want the program run "other instructions" but only after the image is fully charged and the size has changed

    How can I do?

    Thank you in advance.

    1. never use nested functions - unnest them

    2. because you call load() on my_loader in the loop - it will not be loaded belongings correctly. In these conditions, you need to create as many instances of Loader as load() calls you place.

  • Function to display image - work is not since the EPG (403 Forbidden)

    We are in the process of upgrading to 3.1, 4.1 Apex and at the same time from the EPG of Apache. We have a function that generates an image along the lines of:
    DECLARE
      html  xx.yy%TYPE;
    BEGIN
      SELECT col
        INTO html
        FROM xx
       WHERE a=b;
    
      HTP.p(html);
    END;
    Then in the APEX, we call this image using:
    <img src="#OWNER#.xxdisplayimg">
    In 3.1, if I paste in the URL the following then it shows the image:
    http://us:port/pls/apex/aa.xx
    However to do so in

    the instance of 4.1 (but with / apex /... instead of course) then we get a "403 - Forbidden" returned page.
    Everything is granted until correctly as far as I know (for example, work in public, apex_public_user).

    Anyone shed some light?

    See you soon,.

    Hello

    Connect with schema APEX that is APEX_040000 or APEX_041000 and search for a function namely wwv_flow_epg_include_mod_local.

    This function allows you to control which stored procedures are allowed to run through a URL. If you want to allow all just stored procedures replace "return false" with "return true;". If you want to allow specific stored procedures, you can provide its name under:

        if upper(procedure_name) in (
              '') then
            return TRUE;
        else
            return FALSE;
        end if;
    

    ---
    Lavenu
    MaxApex accommodation
    http://www.maxapex.com

  • SWF works is not in using dreamweaver

    OK, I have a file I downloaded with a flash in her photo gallery. now, everything works fine on my cpu, I click on the swf file, it opens and works very well. OK I downloaded the complete file for the flash Gallery on my server and when I click on view in the html file that came with it he opened the Gallery very well and also when I click on display in the swf file that I have uploaded to the server it is. but when I put the html code of the gallery in dreamweaver it will not show the gallery in the preview browser, nor when I save the dreamweaver project on my server it will display the library through the html from dreamweaver. as I said everything works fine until I have post in Dreamweaver I really need help with this I tried to make it work for a week now with no luck. Ty

    Without actually your page and looking at his code, all we can do is guess.  My guess is that you have not downloaded the SWF file.

    You're ok with this not be seen on iPhone/iPad, right?

  • file .swf works do not on a hosted web page

    Hi all I have a problem with my file .swf on a website I did (www.oceansheshireltd.com) the flash object will simply not work I tried to change the src of the file both in the object and embed tags still will not work, have tried to point the script for the .js document still will not work. I downloaded the file .swf, .fla file and the .js file, they are all in the same folder as the index page, but still doesn't work, any help please (ned murphy saw some forums you have helped others maybe u might be able to help) I put the flash on the Web site bellows object code

    < script type = "text/javascript" src = "public_html/AC_RunActiveContent.js" >
    AC_FL_RunContent ('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9, 0.28, 0', 'wid th', ' 200', 'height', '200', 'hspace', ' 1 ', 'hspace', '1',' align","left","title"," our nation ',' src ',' our United Nations, 'quality', 'high', "pluginspage",'e http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash movi ',' ',' our United Nations); 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,28,0 "width ="200"height ="200"hspace ="1"hspace ="1"align ="left"title ="our nation"> "
    < param name = "movie" value = "public_html / our nations.swf" / >
    < param name = "quality" value = "high" / >
    " < embed src =" public_html / our nations.swf "width ="200"height ="200"hspace ="1"hspace ="1"align ="left"quality ="high"pluginspage =" http://www.Adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"type =" application/x-shockwave-flash"> < / embed > "
    < / object > < / noscript >

    As I just mentioned, you probably do not want to include the public_html in this way.

    You should never specify the public_html directory in a url.  The host server is designed for deafult in this directory for the content of your site.

  • Restore function looks like it works but not recover.

    I tried restore several times and it seemed he was working but would never restore to a set point.  I even made a point and then tried to restore at this point without success.  The answer was "Impossible to restore.

    Some security programs prevent changes to their file and must be configured to allow the restoration of the system work.  For example, if your computer has Norton Antivirus or Norton Internet Security, you must disable Norton product Tamper Protection before you run the system restore. See the documentation of your security program. Boulder computer Maven
    Most Microsoft Valuable Professional

  • How s/n know when and what account perform a function using the database link?

    Dear,

    My application of the CIM team asked DBA to create new function and run it. Function must use the database link for remote database data. So I need to create a new database to their licensing link. Cause we guess we'll experience the performance issue after the user performs this function, or another question and errors may occur. So we want to know when and who use this feature that connects to a remote database through the new database connection in advance. And I also need to know when and which connect to the remote database using this new database link. We have no idea to get this information?  Can anyone recommend how do? Thank you very much.

    Best reqards, Otis.

    Check what business purpose, it will solve.  If the function is so safe, why everyone will use. Only admin people should access.

    All of these additional controls of this kind must be avoided as much as possible to improve the overall performance of the application.

    Still if you need, see the database audit mechanism, specifically designed for this type of activity.

    Kind regards

    Harman

  • Is parent to perform the function in child

    I have a function in children that I need to be executed by the parent, but I can't make it work.  Anyone know how to call the function in a child of a parent?

    What I do is to have the parent load a few buttons, and I would like to re - use the swf, but have the parent to provide the text for the button.

    Here's how I built it:

    main.swf - main container for everything

    -button_page.swf - this is the page that has the buttons on it

    field - button.swf - the image of the button with dynamic text

    So the button_page.swf try to perform a function on button.swf, called "populate_button".  He is also passing the text inside, so the function should be performed as "populate_function("Back")".  I can't call to function properly.  I tried several different things, including:

    btn_back.populate_button ("Back");

    the instance of the button.swf is called 'btn_back '.

    Any help would be greatly appreciated.  Thank you!

    Aaron

    If I'm not mistaken...

    in AS3... the only 'good' inter comm swf is w / connection local... parent has been deprecated, except for XML nodes...

    You're wrong

    2 SWFs can communicate with eachother very well. Make sure they are actually loaded before trying to communicate.

    You only need a communication cross-avm netconnection: AVM0 (AS1/AS2) to AVM3 (AS3) and vice versa.

    VIVIsecVI, show us the code that loads the swf button actually.

  • LocalConnection between another SWF and main SWF does not work!

    Hello, can someone help me!

    I have a main SWF within several sovereign funds. I want to add the score of all levels to the main SWF.

    But I also have a code to unload each SWF before another SWF starts. I figured out how to do this.

    But I don't know.

    The code I have is something like this:

    The level. SWF

    Stop();

    var sending_score:LocalConnection = new LocalConnection()

    sending_score. Send ('_myConnection', 'add_score');

    var App_Timer1:Timer = new Timer (100.1); After 3 seconds, the timer causes the film to the next section

    App_Timer1.addEventListener (TimerEvent.TIMER_COMPLETE, startApp1);

    App_Timer1.start ();

    function startApp1(event:TimerEvent):void {}

    gotoAndPlay (105);

    }

    You are welcome.

  • How can I call functions of a SWF file loaded into another swf?

    Hello

    Please excuse my ignorance, I am very new to actionscript and flash.

    I have 2 Fund sovereigns - a.swf and b.swf.

    I load b.swf in a.swf with the following code:

    var swfLoader:MovieClipLoader = new MovieClipLoader();
    swfLoader.loadClip("b.swf", container_mc);
    

    Now in b.swf, I have a function as follows:

    public function sendData(){
      trace("I ran the function!");
    }
    

    So I did a lot of reading, from what I can tell, I should be able to perform the function of sendData() from code in a.swf, by typing:

    container_mc.sendData();
    

    but it's not working. What I am doing wrong?

    Thanks in advance,

    Adam

    container_mc. SendData();

    will work AFTER THAT b.swf is initialized.  That is to say, use a listener to detect that.

  • Run the Flex application function in Flash swf

    Hello

    I have Flash Web site (embed) calls my flex swf built (some form of contact). When I click on the button "submit" in my Flex application, I need to perform a function that is written on the side of Flash. So I need access to Flash public service so a side event could be triggered.

    Is this possible and how it's done.

    Thnx in advance

    Two options:

    One is to use LocalConnection between two sovereign wealth funds.

    Another is to use the external Interface of Flex to talk about javascript in the browser and then use javascript to describe the Flash swf file.

    Tracy

  • Library swf with does not perform the actions

    I have an actionScript animation film simple (using Greensock TweenMax) after export works fine when I open the .swf file obtained on its own (double click on my Mac finder).  My film has 2 frames, frame 1 sets up the interpolation on the object function in my film, frame 2 performs the function and stops.  As I said, if I open the exported .swf file or preview in a html browser, I see the desired animation effect.

    However, when I include the swf exported in another project file (using import to library) and drop it in my main script - I don't get the animation that I see in my standalone swf file.  I tried to call the file directly to play and notheing happens.  When I opened this symbol of swf (double clicking) after putting on the main timeline, I see 2 managers, but only in the original file symbiols graphics are in these frameworks (no action).

    I test the same goal using an exported swf of a film by the animation timeline (classic Tween), and it worked fine).

    What Miss me?  Is it possible to take advantage of a file to swf actionscript animation in other films?  I want to do so that I can create a bunch of stand alone animations I load in dynamically and play without chronology animate each one.  Any help GREATLY appreciated, thank you very much!

    Yes, if it's an AS3 file you can use the Loader class.

    If you want the movie to be physically in the other alternative file would be to copy the script of the film to a movieclip in the other file.

  • Open another SWF file in the same window of the browser?

    I designed a website, the first HTML page. How to code a button to load another SWF file in the same web browser window?

    The example site uses Flash.  If you want it works exactly the same as you do not want to use the Flash.

    If you want similar functionality, then you can simply use the navigateToURL() function to open the new page with the swf site integrated into it.

    Explaining the AS3 button Code
    --------------------------

    Assume that you create a button symbol.  Since this is a button, it is already a car animation object that will react to mouse interactions, but only visually at this stage.  The first thing you need to do to make it useful down must assign a unique instance name.  If you drag a copy of it on the stage of the library, and while it is still selected, enter you this unique instance for her name in the Panel properties... say you name "btn1.

    In AS3, to make a button with the code, you must add a listener of events and event handler for it function.  You may need to add a little (for different events, like reversal, deployment, by clicking on it, but for now let's just say you want to be able to click them to get a web page.)  In the scenario that contains this button, a layer of separate actions that you create in a similar framework where this button exists, numbered, you must add the event listener:

    Btn1.addEventListener (MouseEvent.CLICK, btn1Click);

    The name of the unique function for the treatment, the click of this button is specified at the end of the assignment of event listener, so now you just have to write this function:

    function btn1Click(evt:MouseEvent):void {}

    var url: String = "http://www.awebsite.com/awebpage.html";

    var req:URLRequest = new URLRequest (url, "_self");   "_self" indicates that it takes to open in the same window

    navigateToURL (req);

    }

  • How can I control a button from a swf file to another swf file?

    Hello

    I have a file main.swf . From this file I can access the file external.swf which is an external file.

    Now, how can I write code on my file main.swf to the button that is on my external.swf file?

    Activities.MainPanel.close_btn.addEventListener (MouseEvent.CLICK, btnClickClose);

    Activities.MainPanel.close_btn (This button is actually the external.swf file, but I want to write code on main.swf file to run it on external.swf) How can I control a single swf in another swf file button?

    Thank you.

    Some examples of code that you should be able to adapt to your needs.

    create a new instance of the loader object.

    var loader: Loader = new Loader();

    make the download request...

    var request: URLRequest = new URLRequest ("external.swf");

    Add a full event for the loader listener

    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, completeHandler);

    start the actual loading process...

    Loader.Load (request);

    Create a new empty movieClip instance, you place the movie loaded into this movieClip after loading

    var externalMovie:MovieClip;

    This function is called when the download is complete and the file is ready for use.

    function completeHandler(event:Event):void {}

    set the contents of the film to the new empty movieClip...

    externalMovie = MovieClip (event.target.content);

    Add this new film to the display list.

    addChild (externalMovie);

    }

    Now you can reference the film loaded with the name of the instance 'externalMovie '. So if, for example, you want to address a button in the film loaded, you can write something like that on the main timeline:

    externalMovie.addEventListener (MouseEvent.CLICK, btnClickClose);

    function btnClickClose(event:MouseEvent):void {}

    }

  • The call of a function in a SWF with an external program TLFTextField

    I have a program that loads another swf B, and after B, a will call a function of B.  He used to work when B creates a TextField and TextFormat is using, but when I changed to create a TLFTextField, I got this error:

    Reference error: #1069 Error: loadCurrentPictureFromMenu property not found on ECard__Preloader__ and there is no default value.

    to ECard / swfLoadCompleteEventHandler ()...

    And also

    WARNING: Ignorance of the attribute 'trust' in the http://fpdownload.adobe.com/pub/swz/crossdomain.xmlpolicy file.  The secure attribute is allowed only in HTTPS policy files and taken...

    So I wrote these 2 programs to test this:

    ----------------------- Test B -------------------------

    Import fl.text.TLFTextField;

    Import flashx.textLayout.formats.TextLayoutFormat;

    Import flashx.textLayout.elements.TextFlow;

    var myFormat:TextLayoutFormat = new TextLayoutFormat();

    myFormat.fontFamily = "Kids."

    myFormat.fontSize = 24;

    var tlfTextField:TLFTextField = new TLFTextField();

    tlfTextField.x = 50;

    tlfTextField.y = 50;

    addChild (tlfTextField);

    var myTextFlow:TextFlow = tlfTextField.textFlow;

    myTextFlow.hostFormat = myFormat;

    myTextFlow.flowComposer.updateAllControllers ();

    tlfTextField.text = "test this."

    function changeText(string:String):void

    {

    tlfTextField.text = string;

    }

    ---------------------- Test A -----------------------------------

    import flash.net.URLRequest;

    import flash.display.Loader;

    import flash.display.MovieClip;

    var urlRequest:URLRequest = new URLRequest ("testTLFTextField.swf");

    var loader: Loader = new Loader();

    Loader.Load (urlRequest);

    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, loadingCompleteEventHandler);

    function loadingCompleteEventHandler(evt:Event):void

    {

    addChild (loader);

    loader.contentLoaderInfo.removeEventListener (Event.COMPLETE, loadingCompleteEventHandler);

    var mc:MovieClip = evt.currentTarget.content;

    mc.changeText ("we are here");

    }

    ---------------------------------------------------------

    I got the error #1069 again, but when I changed back to TextField TLFTextField, it works again.  Test one can now find the 'changeText()' function to test B.

    I use CS5.5.

    Any help is appreciated!

    Thanks in advance!

    This can also be due to bugs in the class Loader.

    If you're on CS5.5, use the class ProLoader .

Maybe you are looking for