LocalConnection to run a function in another .swf not working....

I'm trying to establish a LocalConnection so that I can communicate between my navbar & the main page on my website. Here is the code I have so far for the sending and receiving AS3 files, please let me know if you see anything out of the ordinary. The idea is that when you click on one of the icons on the navbar my "book" slides down to the center of the screen on the correct page. I actually have 4 buttons but only included the code I'm using for two in order to make this post shorter. The same idea is used for all four buttons though.
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);
Receiving:
import com.greensock.*;
import com.greensock.easing.*;
var receiving_lc:LocalConnection;
receiving_lc = new LocalConnection();
receiving_lc.connect("my_lc_as3");
receiving_lc.client = this;
var bookPosition:String = "up";
function gotoServicesPage(event:MouseEvent):void {
     book.gotoAndStop('webDesignPage');
if (bookPosition == "up");
        TweenLite.to(book, 2, {y:830});
          var bookPosition == "down";
function gotoPortfolioPage(event:MouseEvent):void{
     book.gotoAndStop('porftolioPage');
if (bookPosition == "up");
        TweenLite.to(book, 2, {y:830});
         var bookPosition == "down";
The reason I'm keeping track of whether the book is in the "up" or "down" is so that if it's in the down position already it doesn't re-tween back onto the screen. I am new to declaring and using variables; TweenLite; and LocalConnection so there is probably some simple problem with my AS3 code (although no errors are coming up in Flash). Any help would be much appreciated.

Alright I'm going to fix one problem at a time, starting with the LocalConnection. I've checked several websites for tutorials and examples but cannot seem to get it working properly. I'm just trying to run a simple function over it and can't get it working. Once I can get it working, I'll modify the rest of the code to do what I need. Right now I'm just trying to use it to run a function (slideServicesIn) in a seperate swf. file. I've checked and rechecked the code and just can't figure out why it's not working.
Here's the sending code:
import flash.net.LocalConnection;
import flash.events.MouseEvent;
var lc:LocalConnection = new LocalConnection();
function servicesBtnClick(event:MouseEvent):void{
lc.send("my_lc_as3","slideServicesIn");
servicesBtn.addEventListener(MouseEvent.CLICK, servicesBtnClick);
Looks pretty simple.... And here's the receiving code:
import flash.net.LocalConnection;
var lc:LocalConnection = new LocalConnection();
lc.connect("my_lc_as3");
/*If you're not familiar with TweenLite or TweenMax, I can revise the code. I can't get it to work even just to go to a certain frame label. This seems pretty basic if you are even a little familiar with TweenLite/Tweenmax*/
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;
var bookPosition:String = "up";
var currentPage:String;
function slideServicesIn ():void{
         if (bookPosition = "up"){
         //Goes to a certain frame label in the book movie clip
         book.gotoAndStop("webDesignPage");
         //Slides the book down 825px from the top of the screen using TweenLite
         TweenLite.to(book, 3, { y:825 } );
         bookPosition = "down";
         currentPage = "book.servicesPage";
        else () {
         //Fades out the current page using TweenLite
         TweenLite.to(currentPage, 1, { alpha:0, ease:Quad.easeIn } );
         //Fades in the Web Design Page using Tweenlite
         TweenLite.to(book.webDesignPage, 1, { alpha:1, ease:Quad.easeIn, delay: .2 } );

Similar Messages

  • Parent swf call function in Child swf not working

    Hi all,
    I'm having a problem with this and I just can't figure it out
    :( (I've been trying different things and staring at it for hours
    and I'm losing my mind...)
    So I have a Parent swf that loads a Child swf (this goes
    without any problems), but I want the Parent to call a function in
    the child, now this is where it goes wrong...
    The function the Parent has to call is named "lookupcar" and
    needs to give the value "wagen" with it. The problem I think is
    that the Parent wants to call the function but it still needs to
    load (correct me if I'm wrong). Is there a way to check if the
    Child swf is loaded completely before trying to call the function?
    Could you give me an example of this please? Or any other
    suggestions on what goes wrong?
    Code in the Parent
    root.inhoud.createEmptyMovieClip("thetext", "thetext",
    this.getNextHighestDepth());
    root.inhoud.thetext.loadMovie("uitrusting-wagenpark.swf");
    root.inhoud.thetext.lookupcar(wagen);
    Code in the Child
    (the function lookupcar)
    _global.lookupcar = function(carnr:String){
    trace("LOOKUPCAR, with car nr: " + carnr);
    Thanks in advance for all the help.

    Perfect....just to make sure i m taking care of it in a nice practical way....here is how i learned to access a file located in Child (researching other posts)
    is this the way you recommend it?
    (LoaderName.content as MovieClip).functionName(new Event("whatever"))
    and in Child File we have
    function functionName(e:Event)
    i have seen other ways of calling a function in Child Swf , like using EmbedSWF and etc. wanna make sure which one is a better practice. Thanks

  • When my thread starts running, at that time keylistener is not working.

    when my thread starts running, at that time keylistener is not working.
    plz reply me.

    //FrameShow.java
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.event.*;
    import java.awt.Dimension;
    import java.awt.geom.Dimension2D;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import java.util.logging.Level;
    import java.awt.event.*;
    import java.util.*;
    public class FrameShow extends JFrame implements ActionListener,KeyListener
         boolean paused=false;
         JButton stop;
         JButton start;
         JButton exit;
         public IncludePanel CenterPanel;
         public FrameShow()
    CenterPanel= new IncludePanel();
              Functions fn=new Functions();
              int height=fn.getScreenHeight();
              int width=fn.getScreenWidth();
              setTitle("Game Assignment--Santanu Tripathy--MCA");
              setSize(width,height);
              setResizable(false);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              show();
              initComponents();
              DefaultColorSet();
              this.addKeyListener(this);
         this.setFocusable(true);
         public void initComponents()
              Container contentpane=getContentPane();
              //Creating Panel For Different Side
              JPanel EastPanel= new JPanel();
              JPanel WestPanel= new JPanel();
              JPanel NorthPanel= new JPanel();
              JPanel SouthPanel= new JPanel();
              //CenterPanel = new IncludePanel();
              //IncludePanel CenterPanel= new IncludePanel();
              EastPanel.setPreferredSize(new Dimension(100,10));
              WestPanel.setPreferredSize(new Dimension(100,10));
              NorthPanel.setPreferredSize(new Dimension(10,100));
              SouthPanel.setPreferredSize(new Dimension(10,100));
              //CenterPanel.setPreferredSize(new Dimension(200,200));
              //Adding Color to the Panels
              NorthPanel.setBackground(Color.green);
              SouthPanel.setBackground(Color.orange);
              CenterPanel.setBackground(Color.black);
              //Creating Border For Different Side
              Border EastBr = javax.swing.BorderFactory.createEtchedBorder(Color.cyan, Color.red);
              Border WestBr = javax.swing.BorderFactory.createEtchedBorder(Color.cyan, Color.red);
              Border NorthBr = javax.swing.BorderFactory.createEtchedBorder(Color.cyan, Color.red);
              Border SouthBr = javax.swing.BorderFactory.createEtchedBorder(Color.cyan, Color.red);
              Border CenterBr = javax.swing.BorderFactory.createEtchedBorder(Color.cyan, Color.red);
              //Creating Components For East Panel
              JLabel left= new JLabel("LEFT");
              JLabel right= new JLabel("RIGHT");
              JLabel rotate= new JLabel("ROTATE");
              left.setForeground(Color.blue);
              right.setForeground(Color.blue);
              rotate.setForeground(Color.blue);
              //Creating Components For West Panel
              ButtonGroup group = new ButtonGroup();
              JRadioButton rb1 = new JRadioButton("Pink",false);
              JRadioButton rb2 = new JRadioButton("Cyan",false);
              JRadioButton rb3 = new JRadioButton("Orange",false);
              JRadioButton _default = new JRadioButton("Black",true);
              rb1.setForeground(Color.pink);
              rb2.setForeground(Color.cyan);
              rb3.setForeground(Color.orange);
              _default.setForeground(Color.black);
              //Creating Components For North Panel
              JLabel name= new JLabel("Santanu Tripathy");
              name.setForeground(Color.blue);
              name.setFont(new Font("Serif",Font.BOLD,30));
              //Creating Components For South Panel
              start = new JButton();
              stop = new JButton();
              exit = new JButton();
              start.setToolTipText("Click this button to start the game");
              start.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
              start.setText("START");
              start.setBorder(javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createEmptyBorder(3, 5, 3, 5), javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)));
              start.setMaximumSize(new java.awt.Dimension(90, 35));
              start.setMinimumSize(new java.awt.Dimension(90, 35));
              start.setPreferredSize(new java.awt.Dimension(95, 35));
              if(paused)
                   stop.setToolTipText("Click this button to pause the game");
              else
                   stop.setToolTipText("Click this button to resume the game");
              stop.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
              stop.setText("PAUSE");
              stop.setBorder(javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createEmptyBorder(3, 5, 3, 5), javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)));
              stop.setMaximumSize(new java.awt.Dimension(90, 35));
              stop.setMinimumSize(new java.awt.Dimension(90, 35));
              stop.setPreferredSize(new java.awt.Dimension(95, 35));
              exit.setToolTipText("Click this button to exit from the game");
              exit.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
              exit.setText("EXIT");
              exit.setBorder(javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createEmptyBorder(3, 5, 3, 5), javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)));
              exit.setMaximumSize(new java.awt.Dimension(90, 35));
              exit.setMinimumSize(new java.awt.Dimension(90, 35));
              exit.setPreferredSize(new java.awt.Dimension(95, 35));
              //Adding some extra things to the Panels
              group.add(rb1);
              group.add(rb2);
              group.add(rb3);
              group.add(_default);
              //Adding Component into the Panels
              EastPanel.add(left);
              EastPanel.add(right);
              EastPanel.add(rotate);
              WestPanel.add(rb1);
              WestPanel.add(rb2);
              WestPanel.add(rb3);
              WestPanel.add(_default);
              NorthPanel.add(name);
              SouthPanel.add(start);
              SouthPanel.add(stop);
              SouthPanel.add(exit);
              //Adding Border Into the Panels
              EastPanel.setBorder(EastBr);
              WestPanel.setBorder(WestBr);
              NorthPanel.setBorder(NorthBr);
              SouthPanel.setBorder(SouthBr);
              CenterPanel.setBorder(CenterBr);
              //Adding Panels into the Container
              EastPanel.setLayout(new GridLayout(0,1));
              contentpane.add(EastPanel,BorderLayout.EAST);
              WestPanel.setLayout(new GridLayout(0,1));
              contentpane.add(WestPanel,BorderLayout.WEST);
              contentpane.add(NorthPanel,BorderLayout.NORTH);
              contentpane.add(SouthPanel,BorderLayout.SOUTH);
              contentpane.add(CenterPanel,BorderLayout.CENTER);
              //Adding Action Listeners
              rb1.addActionListener(this);
              rb2.addActionListener(this);
              rb3.addActionListener(this);
              _default.addActionListener(this);
              exit.addActionListener(this);
              start.addActionListener(this);
    try
              start.addActionListener(
    new ActionListener() {
    public void actionPerformed( ActionEvent e )
                        start.setEnabled(false);
    CenterPanel.drawCircle();
    catch(Exception e)
    {System.out.println("Exception is attached with sart button exp = "+e);}
    try
              stop.addActionListener(
    new ActionListener() {
    public void actionPerformed( ActionEvent e )
                        paused=!paused;
                        if(paused)
                             start.setToolTipText("Click this button to resume the game");
                             stop.setText("RESUME");
                        else
                             start.setToolTipText("Click this button to pause the game");
                             stop.setText("PAUSE");
    CenterPanel.pause();
    catch(Exception e)
    {System.out.println("Exception is attached with sart button exp = "+e);}
         public void DefaultColorSet()
              getContentPane().setBackground(Color.white);
         public void actionPerformed(ActionEvent AE)
              String str=(String)AE.getActionCommand();
              if(str.equalsIgnoreCase("pink"))
                   CenterPanel.setBackground(Color.pink);
              if(str.equalsIgnoreCase("cyan"))
                   CenterPanel.setBackground(Color.cyan);
              if(str.equalsIgnoreCase("orange"))
                   CenterPanel.setBackground(Color.orange);
              if(str.equalsIgnoreCase("black"))
                   CenterPanel.setBackground(Color.black);
              if(str.equalsIgnoreCase("exit"))
                   System.exit(0);
         public void keyTyped(KeyEvent kevt)
    //repaint();
    public void keyPressed(KeyEvent e)
              System.out.println("here key pressed");
              //CenterPanel.dec();
         public void keyReleased(KeyEvent ke) {}
    }//End of FrameShow.ja
    //IncludePanel.java
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.Graphics.*;
    import java.awt.Dimension;
    import java.awt.geom.Dimension2D;
    import java.util.*;
    import java.util.logging.Level;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.event.*;
    public class IncludePanel extends JPanel implements Runnable
    int x=0,y=0;
    int color_1=0;
    int color_2=1;
    int start=0;
    Thread th;
    Image red,blue,green,yellow;
    java.util.List image;
    static boolean PAUSE=false;
         public IncludePanel()
         red= Toolkit.getDefaultToolkit().getImage("red.png");
         blue= Toolkit.getDefaultToolkit().getImage("blue.png");
         green= Toolkit.getDefaultToolkit().getImage("green.png");
         yellow= Toolkit.getDefaultToolkit().getImage("yellow.png");
    public void paintComponent(Graphics g)
              super.paintComponent(g);
              draw(g);
    public void dec()
         System.out.println("in dec method");
         x=x+30;
    public void draw(Graphics g)
              g.setColor(Color.red);
              int xx=0,yy=0;
              for (int row=0;row<=12;row++)
                   g.drawLine(xx,yy,180,yy);
                   yy=yy+30;
              xx=0;
              yy=0;
              for (int col=0;col<=6;col++)
                   g.drawLine(xx,yy,xx,360);
                   xx=xx+30;
              if(color_1==0)
                   g.drawImage(red, x, y, this);
              else if(color_1==1)
                   g.drawImage(blue,x, y, this);
              else if(color_1==2)
                   g.drawImage(green,x,y, this);
              else if(color_1==3)
                   g.drawImage(yellow,x,y, this);
    x=x+30;
              if(color_2==0)
                   g.drawImage(red, x, y, this);
              else if(color_2==1)
                   g.drawImage(blue,x,y, this);
              else if(color_2==2)
                   g.drawImage(green,x,y, this);
              else if(color_2==3)
                   g.drawImage(yellow,x,y, this);
    x=0;
    public void drawCircle( )
         th=new Thread(this);
         th.start();
         public void pause()
              if(PAUSE)
                   th.resume();
                   PAUSE=false;
                   return;
              if(!PAUSE)
              PAUSE=true;
         public synchronized void run()
              Random rand = new Random();
              Thread ani=Thread.currentThread();
              while(ani==th)
                   if(PAUSE)
                        th.suspend();
                   if(y==330)
                        color_1 = Math.abs(rand.nextInt())%4;
                        color_2 = Math.abs(rand.nextInt())%4;
                        if(color_1==color_2)
                             color_2=(color_2+1)%4;
                        y=0;
                   else
                        y=y+30;
                   repaint();
                   try
                        Thread.sleep(700);
                   catch(Exception e)
         }//End of run
    i sent two entire program

  • Iphone 4s Running Ios(7.1) Camera Focus Not Working Like Text On book It Showed Blurey Text & My Friend Also Same Modle His Camera Focus Perfectly..Is Is Possible To Fix It...Thnx Every 1

    Iphone 4s Running Ios(7.1) Camera Focus Not Working Like Text On book It Showed Blurey Text & My Friend Also Same Modle His Camera Focus Perfectly..Is Is Possible To Fix It...Thnx Every 1

    Hello SajidChaudhary,
    Thanks for using Apple Support Communities.
    For more information, take a look at:
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/ts2802
    Camera isn't functioning or has undesired image quality
    If the screen shows a closed lens or black image, force quit the Camera app.
    If you do not see the Camera app on the Home screen, try searching for it in Spotlight. If the camera does not show up in the search, check to make sure that Restrictions are not turned on by tappingSettings > General > Restrictions.
    Ensure the camera lens is clean and free from any obstructions. Use a microfiber polishing cloth to clean the lens.
    Cases can interfere with the camera and the flash. Try gently cleaning the lens with a clean dry cloth or removing the case if you see image or color-quality issues with photos.
    Try turning iPhone off and then back on.
    Tap to focus the camera on the subject. The image may pulse or briefly go in and out of focus as it adjusts.
    Try to remain steady while focusing:
    Still images: Remain steady while taking the picture. If you move too far in any direction, the camera automatically refocuses to the center.
    Note: If you take a picture with iPhone turned sideways, it is automatically saved in landscape orientation.
    Video: Adjust focus before you begin recording. You can also tap to readjust focus while recording. Exiting the Camera application while recording will stop recording and will save the video to the Camera Roll.
    Note: Video-recording features are not available on original iPhone or iPhone 3G.
    If your iPhone has a front and rear camera, try switching between them to verify if the issue persists on both.
    Have a nice day,
    Mario

  • SetVisible() function for JDialog is not working on Macintosh machine

    Hi All,
    I have coded 2 dialog boxes and i m making only one dialog box visible at a time and using threading.
    But using setVisible() function works fine when I am running that code on windows platform; while when I run on macintosh machine this is not working.It seems as i setvisible() is not executing at all on macintosh machine.
    I am using jdk1.5 on both windows as well as on macintosh.
    Tell me if there is some other method to make dialog boxes/frames visible/invisible.
    Waiting for reply
    Thanks

    Since you mentioned that you're using threading, I have to ask: have you ensured that setVisible is called on the EDT, possibly by wrapping it in a SwingUtilities.invokeLater ?
    db

  • I have a problem with iphone 4s...is ringing but another sounds not working....please help me!!!

    i have a problem with iphone 4s...is ringing but another sounds not working....please help me!!!

    Hi pystyke,
    Welcome to Apple Support Communities.
    You may find these links helpful with troubleshooting the audio issue you're experiencing:
    iPhone Assistant
    http://www.apple.com/support/iphone/troubleshooting/
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/TS2802
    Best,
    Jeremy

  • Repost Function using Variable is not working

    Hello experts!  I am on BW-BPS 3.5.  I have set up a repost function using variables to change a characteristic value for Business Unit.
    1. I created 2 variables as Bus.Unit From and Bus.Unit To in the Planning Area. I am not using the variables in my planning level.
    2. I entered the variables in the parameter group New Values area for the From and To Values.
    3. My goal is when the user executes the Repost Function for a Variable Prompt should appear and have the user select the From Business Unit and To Business Unit.
    The Variables are set up as USERVALUE User-Defined Values, Restriction of Values required by user and I have tried with/without option of Input Allowed by User. 
    Can you tell me what I am doing wrong, I expected a variable prompt when executing the Repost Function but it does not work.
    Thank you,
    Teri

    Ravi, Thank you for your reply however I contiue to have errors or the execution does not repost (change any value) as noted below.
    1. I have 2 Variables in Planning area var1 (from) var2 (to) for the same charateristic which is Business Unit
    2. Business Unit is in the level,  on the selection tab to add the variable I can only add 1 variable, So I added var1 (from) to the level. 
    3. Parameter group for old and new values - I have Var1 (from), var2 (to)
    4. Report Function - are you referring to Reporting variables in BPS? I have set this up as suggested in the "How to Use Reporting Variable in BW-BPS" document.
    5. Enter plan data: I receive prompt for VAR1, mandatory. At this point there is no value in Var2.
    6. Execute Repost function - I receive an error to "Restrict Var2"
    7. If I set variable values and add a value for Var2 I receive an error "The generated data is not contained in the selection condition".
    Next I removed VAR1 from my planning level and turned on the option 'Selection in package' for Business Unit. This seems to work well.
    What do you recommend?
    Thank you,
    Teri

  • SWF Not Working...Help Please :(

    Hi all,
    So I've been having an issue with a SWF not work on a page and this is what I can seem to come up with after hours of messing with Dreamweaver and Flash trying to understand why it won't work. When i test the movie from the working Flash file, it works no problem. Something is going wrong when I export or publish the movie and it no longer works. Is this something that happens?
    Your help is much appreciated...this site needs to go up in the next day or so and the SWF was working and then stopped working and I'm honestly not a Flash gal so I really have no business messing with it, but it was a specific request. Thanks!

    One thing that might be an issue as far as the web page goes it that the html specifies a file named carousel2.swf which does not appear to exist on the server and is not the same name as the file you are calling the swf in your swf link (*carousel3.swf).
    Without knowing what goes on inside carousel3, or carousel 2 for that matter, it's hard to say if it is missing the xml file that it might need.  But for either case, are you certain that you have uploaded the xml file that is needed?

  • Calling a function in another .swf, possible?

    I have two movies... main.swf and content.swf, and I'm trying to call a function in my main.swf from my content.swf. Here is the code..
    //function in main.swf
    function appear (event:MouseEvent):void{
         TweenLite.to(title1, 1, {autoAlpha:1, overwrite:false});
    //try to call from loaded content.swf
    close_btn.addEventListener(MouseEvent.CLICK, btnClick);
    function btnClick(event:MouseEvent):void {
         MovieClip(parent.parent).appear();
    I got an error message as soon as i click on close_btn. It says appear() is not a property or method.
    Would someone help me out on this please?
    Thank you very much.

    I think it is not a good OOP design. It is much better to design applications in a such way that they do not depend on placements (especially parents). Particularly, if your application acts as a component that can be consumed in some unpredictable fashion. Theoretically, if you write something that will become a stand alone swf - it should perform with no errors both as stand-alone and when loaded.
    You are already dealing with the results of this design flow. The most cumbersome and inflexible aspect of your approach is to capture parents chain.
    In your case I would totally dissociate you loaded swf from the placement and couple it with the parent via events.
    The best way would be for your loaded swf to dispatch and event that is consequently captured by it parent(s) no matter, again, where it is placed. For instance it can be done the following way:
    // in your top movie
    // say the loaded swf is set to a variable:
    import flash.display.MovieClip;
    import flash.events.Event;
    var loadedSWF:MovieClip;
    // your loading routine
    // once it is loaded
    // note that capture is set to true so that
    // no matter depth of event origination
    // it will be captured by this scope
    loadedSWF.addEventListener("close", onCloseClick, true);
    function onCloseClick(e:Event):void {
         // do whatever
    // IN YOUR LOADED SWF
    close_btn.addEventListener(MouseEvent.CLICK, btnClick);
    function btnClick(event:MouseEvent):void {
        // dispatch event
         dispatchEvent(new Event("close"));

  • Preloader in external swf not working

    I have several external SWFs that are loaded into my site and
    each one has a preloader. When I run them by themselves the
    preloader works fine, but when it is embeded into the main SWF the
    preloaders do not work. Any ideas?
    here is my actionscript -
    lBytes = _root.getBytesLoaded();
    tBytes = _root.getBytesTotal();
    percentLoaded = Math.floor((lBytes/tBytes)*100);
    loader.bar._xscale = percentLoaded;
    loader.percent.text = percentLoaded + "% of " +
    Math.floor(tBytes/1024) + "K loaded.";
    if (lBytes>=tBytes && tBytes>0) {
    if (count>=12) {
    gotoAndPlay("enter");
    } else {
    count++;
    gotoAndPlay("preload");
    } else {
    gotoAndPlay("preload");
    }

    I am experiencing the exact same problem on my site -
    www.expansiondesign.com
    It works in flash player but not when live (tested safari and
    firefox)
    I don't know if you are using the same script as I am paul.
    I execute the following when each image button is pressed:
    button1.onRelease = function () {
    startLoading("image1.jpg");
    which runs this:
    function startLoading(whichImage) {
    loadMovie(whichImage, "_root.image_holder");
    _root.onEnterFrame = function() {
    infoLoaded = _root.image_holder.getBytesLoaded();
    infoTotal = _root.image_holder.getBytesTotal();
    percentage = (infoLoaded/infoTotal*100);
    _root.loader._yscale = percentage;
    _root.loader._visible = true;
    if (percentage>=100) {
    delete this.onEnterFrame;
    _root.loader._visible = false;
    Thanks,
    Barton

  • Running syndaemon at startup in .xinitrc not working

    I'm trying to run syndaemon so I can set my touchpad to turn off when typing. I'm using the command:
    syndaemon -i 1 -d
    If I issue this after logging into Gnome in a terminal, it works fine and I can see the syndaemon process running in System Monitor.
    But if I add the command to my .xinitrc it doesn't work. I followed the instructions in the wiki, to no avail. I also found that another command I wanted to issue in .xinitrc ("xset -dpms") to solve a different problem with gnome-power-manager wasn't working either. I got that to work by issuing the command as a startup program in Gnome's Starup Applications gui.
    Anyway, I guess I could do the same thing with syndaemon, but I'm wondering why it's not working in .xinitrc, as it's supposed to. Thanks for any help.

    Okay, I tried slim and it did execute the xset and syndaemon commands from .xinitrc.
    Then in a Google search this old post from the Arch forums turned up, from way back in 2003: http://bbs.archlinux.org/viewtopic.php?id=726. At the end Xentac explains that GDM does in fact only look to .xinitrc for what window manger to start and ignores everything else (which of course is also what Wilco says above).
    Xentac wrote:
    If you choose the option to load fluxbox, that's all it will do.  It won't load anything in .xinitrc or .xsession.
    There should be a Session option in gdm.  Add fluxbox to the end of your .xsession (so it should now look exactly like your .xinitrc) and choose the Session option in gdm.
    Gdm assumes that your window manager will do all the auto-loading stuff (like gnome and kde do) so if it doesn't there isn't an easy way to add it, apart from hacking up the gdm menu item scripts (if you wanted to they're in like /etc/gdm/Session.d or something).
    So I guess using the startup applications gui in Gnome is the right way to do it. Unless anyone objects, I'm going to add a note to the wiki. Reading around, it seems like it might be possible to somehow execute startup processes with GDM reading a .xession file, but I didn't really get it.
    Curiously, when I was using Slim it solved a different bug I was having, with my brightness getting dimmed after every shutdown. So at least now I know it's gdm that's doing that. And once again I've learned that I'm more likely to turn up relevant Arch forum posts with google searches than with the Arch forum search function.
    And thanks again to everyone for their suggestions and ideas about how to address this issue.

  • Preloaders in external .swf not working

    Hi people.
    I have built this website to showcase our work
    http://www.perfectmarketing.co.uk
    All the movie clips shown in the centre of the screen are
    external .swfs with their own preloader.
    But when the site is live, the preloaders don't seem to be
    working, it takes a while for the movie clip to load and the
    preloader doesn't show. I want it to show so people know something
    is loading.
    anyone have any ideas.
    Thanks,
    Paul

    I am experiencing the exact same problem on my site -
    www.expansiondesign.com
    It works in flash player but not when live (tested safari and
    firefox)
    I don't know if you are using the same script as I am paul.
    I execute the following when each image button is pressed:
    button1.onRelease = function () {
    startLoading("image1.jpg");
    which runs this:
    function startLoading(whichImage) {
    loadMovie(whichImage, "_root.image_holder");
    _root.onEnterFrame = function() {
    infoLoaded = _root.image_holder.getBytesLoaded();
    infoTotal = _root.image_holder.getBytesTotal();
    percentage = (infoLoaded/infoTotal*100);
    _root.loader._yscale = percentage;
    _root.loader._visible = true;
    if (percentage>=100) {
    delete this.onEnterFrame;
    _root.loader._visible = false;
    Thanks,
    Barton

  • Published SWFs not working from CS3 on Mac?

    This one REALLY has me stumped..
    I am working on a Mac Dual 2-Gig G5 running OS 10.4.10 and
    Flash CS3.
    I have a web site for a client posted (
    http://www.aronwiesenfeld.com
    ). This site has been running flawlessly for over a year published
    to Version 8 Flash Player AS v2.0. This client asked me to create a
    new temporary splash page last night that would announce his new
    Art Show and then click on into the main site. This site uses a
    Shared Lib, a SharedTrigger, a Core SWF (containing the main site
    navigation elements and handles loading of various movies into
    levels) and a Splash SWF (that contains the two splash screens and
    initial navigation to areas of the site. The problem I THINK I am
    having is in the Splash SWF... or is a problem with my LOCAL Mac
    installation? When I click one of the 5 Site Nav buttons it is
    supposed to tell the main core movie to advance to a new frame (20)
    and I target that movie by referring to _level0. This has worked
    fine for the past year (on this and other sites). I am attaching an
    example of the code used on each of the initial Nav buttons in the
    Splash swf .
    So here is the mystery...
    When I "Test Movie" inside Flash CS3, everything works/looks
    "perfect". If I then go to the desktop and find the generated HTML
    file and open it in Safari (both version 2 and 3-beta), or Firefox
    or Opera, etc., everything looks fine until I click one of the
    initial text Nav Buttions. At that point it takes me to the main
    site and loads the external SWF into a level as it should
    (indicating that the 3rd line of code on the button is execution
    and by the fact the the Splash movie disappears, it indicates that
    the core movie is indeed moving to frame 20 (_level0) as requested
    in the first line of code. However, all of the main site navigation
    buttons along the bottom of the main site as well as the background
    NEVER APPEAR? Also when I start to move the mouse around the loaded
    external movie the site completely crashes and I get a blank screen
    - IN ALL BROWSERS whether I am launching the site from my hard
    drive or the Internet!! But it works perfect INSIDE Flash CS3.
    Now comes the real kicker...
    Just for the heck of it after spending 3 hours trying to fix
    this on my main G5 tower(publishing to Player version 9, etc.), I
    decided to try accessing the site from my old G4 laptop. Ready for
    this? The site appears to be working perfectly IN ALL BROWSERS ON
    MY G4 also running 10.4.10!!!
    So my guess is maybe their is a problem with the Flash Player
    Plugin in all my browsers on my G5 or the Flash Plugin has a
    problem with OS 10.4.10 only on my G5. BUT, even if I launch this
    site directly in Flash Player from the desktop on my G5 it does not
    work - so the stand-alone player is having the same issue - yet it
    works fine on my G5 INSIDE of Flash CS3.
    I thought I had seen it all the last 5 years with Flash, but
    this one has be completely stumped!
    My client emailed me from California and said the site was
    working fine there of his PC. If that is true then I am having a
    LOCAL Flash Player problem on my G5 running 10.4.10.
    In addition to my question, if anyone can give me feedback as
    to whether or not this site is working on your machine/browser/OS,
    could you please let me know? You will know if the site is working
    if you click on Enter Site, then click on any of the 5 buttons
    (except Info) and you see a grey background behind the image and
    the lower navigation string appears.
    Thanks!

    Well after trying everything I could think of I started down
    the list again. I re-downloaded the Flash Player 9 r47 Mac
    installer and ran the installer again (which I also did last night
    with no success).
    This time after re-installing the plugin - ALL THE BROWSERS
    IMMEDIATELY STARTED WORKING ad the site now comes up fine - so,
    apparently I had a bad Flash Player install in my browser!

  • SWF. not working when entering other state

    Hi
    I have just made a site where theres a main site without animation and a sub site with animation. The problem is that the animation/swf is not starting when i enter the subsite. It starts when theres no main site but when we enter the site from a another main site/sub site the animation the do not start.

    This might be a security issue. If I am understanding what you are say is you go to www.mysite.com then go to mysubsite.mysite.com. When you are accessing the Flash Catalyst produced swf at mysubsite.mysite.com this way it does not work. In the Flash Catalyst file, the linked swf is probably referenced as "http://www.mysite.com/mySWF.swf", but to the Flash Player this is a different address from mysubsite.mysite.com.
    If you add a crossdomain.xml file to your site to include the top level and sub domains, the issue should be resolved. For more information on the crossdomain.xml file: http://kb2.adobe.com/cps/142/tn_14213.html
    Good luck
    Chris

  • Swf not working when moved to other folder....

    Hi all...
    i have created a simple flex project that does not use any server technology...  i have then used acitonscript to dynamically set up my end points and channels for a simple remote object which calls a java class on a tomcat local server.
    all works as it should.
    the folder that contains my swf in on my desktop.  If i was to copy the folder and move it to another location... the program does not work.?
    I want to able to create a swf that can work anywhere on the local machine.
    and to be extra awkward... i dont want to use air
    any ideas?

    Hi greg..
    thanks for your help...
    ive tried it with -use-network=true. but i am not having any luck.
    when i tried -use-network=false i get an error :
    SecurityError: Error #2010: Local-with-filesystem SWF files are not permitted to use sockets.
    at flash.net::Socket/internalConnect()
    at flash.net::Socket/connect()
    at mx.netmon::NetworkMonitorImpl()[/ndepot/ide_builder/ActionscriptProjects/src/mx/netmon/Ne tworkMonitorImpl.as:79]
    at mx.netmon::NetworkMonitorImpl$/init()[/ndepot/ide_builder/ActionscriptProjects/src/mx/net mon/NetworkMonitorImpl.as:30]
    at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[E:\dev\beta1\frameworks\proj ects\framework\src\mx\managers\SystemManager.as:3394]
    at mx.managers::SystemManager/docFrameListener()[E:\dev\beta1\frameworks\projects\framework\ src\mx\managers\SystemManager.as:3258]

Maybe you are looking for

  • How we can raise same No of Invoice after Deletion of Particular Invoice

    Dear All,           Pls tell me if i delete a particular Invoice in SAP. And after deletion of Invoice I want to be generate same no of another invoice.  Is It possible. And what is the procedure to generate..   (For Example- if it is a last invoice

  • Usage reports for prepaid phones

    My employer is considering purchasing some prepaid phones for several new temporary employees whose primary role will be to make weekly phone calls to our clients. We would like to keep track of the calls made with these phones, so I'm wondering what

  • Too much logon audit success in same time ? a possible attack ?

    Hi ,  I reviewed system log on Windows Server 2008R2 , and at a certain time ( say 7:00:00 AM) there is near 1000 logon success in Security audit logs . all of them are from Anonymous User from NT Authority . the server is an application server , is

  • ICloud and Outlook 2011 for mac

    I currently run an imac, iphone and windows laptop. For e mail and calander I wish to use MS Office (it is what I am used to and is the system at work) and I have office for mac. On my laptop i can synce outlook with the iColud but on my mac version

  • Additional User with admin rights

    Hi all, i checked the documentation but i could not found a possibility to create an additional user with admin rights to access the Vibe Management Console. Does anybody know if this is possible and how to do this? Thanks in advance Alex