Welcome, Guest
  • Author Topic: easy question but not for me  (Read 2653 times)

    caraffucciu

    • Server what's that
    • *
    • Posts: 34
      • View Profile
      • Email
    easy question but not for me
    « on: 02/21/06, 12:02 »
    hello with all... Here I put on my scene a component short prop which I named "boutton1". While clicking above I would like to open a window here my code...

    on(click){win = mx.managers.PopUpManager.createPopUp(this, mx.containers.Window, true,{_name: "myWin", _x:25, _y:100, _width:680, _height:470, closeButton:true, title:"Welcome", contentPath:"welcome.swf"})
    closeWin = new Object();
    closeWin.click = function(){
       win.deletePopUp();
    }
    win.addEventListener("click", closeWin);

    };
    ;

    Can you correct me thank you very much...  :-\

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: easy question but not for me
    « Reply #1 on: 02/22/06, 10:11 »
    It's fine, just add a Window component to your library

    Jorge

    caraffucciu

    • Server what's that
    • *
    • Posts: 34
      • View Profile
      • Email
    Re: easy question but not for me
    « Reply #2 on: 02/22/06, 10:18 »
    not that it is ok... I think that the problem it is that the button is not a traditional button but the component boutton... and I wonder whether the actionscript should not be different...  ???

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: easy question but not for me
    « Reply #3 on: 02/22/06, 10:58 »
    Try first with a standard button, if it works, then a listener for the button (click event), check Manual, Button class, click event

    Jorge

    caraffucciu

    • Server what's that
    • *
    • Posts: 34
      • View Profile
      • Email
    Re: easy question but not for me
    « Reply #4 on: 02/22/06, 11:06 »
    it is precisely Ca which I does not include/understand... because I noticed two type of code on the component short prop... simple by on{click} (that I includes/understands) and the other with ear-phone which I does not include/understand.

    you can give me a very simple example to help me...

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: easy question but not for me
    « Reply #5 on: 02/22/06, 11:18 »
    Sure:

    listenerObject = new Object();
    listenerObject.click = function(eventObject){
     //do something ...
    }
    buttonInstance.addEventListener("click", listenerObject)

    Jorge

    caraffucciu

    • Server what's that
    • *
    • Posts: 34
      • View Profile
      • Email
    Re: easy question but not for me
    « Reply #6 on: 02/22/06, 11:24 »
    Ok... thanks Jorge

    caraffucciu

    • Server what's that
    • *
    • Posts: 34
      • View Profile
      • Email
    Re: easy question but not for me
    « Reply #7 on: 02/24/06, 08:37 »
    afflicted but when I have to carry out this script, flash announces me a redundancy in script... I again forgot something?
    Thanks...

    listenerObject = new Object();
    listenerObject.click = function(eventObject){
    win = mx.managers.PopUpManager.createPopUp(this, mx.containers.Window, true,{_name: "myWin", _x:25, _y:100, _width:680, _height:470, closeButton:true, title:"Pour fermer la fenêtre cliquer sur la croix", contentPath:"tourdhorizon.swf"})
    closeWin = new Object();
    closeWin.click = function(){
       win.deletePopUp();
    }
    win.addEventListener("click", closeWin);

    }
    articles.addEventListener("click", listenerObject)

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: easy question but not for me
    « Reply #8 on: 02/24/06, 08:57 »
    post the error

    Jorge

    caraffucciu

    • Server what's that
    • *
    • Posts: 34
      • View Profile
      • Email
    Re: easy question but not for me
    « Reply #9 on: 02/25/06, 09:22 »
    A script of this animation slows down the execution of flash player. If the execution is not suspended, it is possible that your computer does not react any more. Wish to give up the execution of script?

     ???

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: easy question but not for me
    « Reply #10 on: 02/25/06, 09:50 »
    Don't create the window inside the listener of another component, call instead a function to create the window fromt he first listener

    Jorge