A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: gdsgd

  1. #1
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389

    gdsgd

    I'm trying to start a page but would like to understand the use of the Stage.onResize method...

    Is it supposed to work when the browser scale changes?

    I'm coding:

    Code:
    Stage.scaleMode = "noScale";
    this.createTextField("stageSize_txt", this.getNextHighestDepth(), 10, 10, 100, 22);
    	var stageListener:Object = new Object();
    	stageListener.onResize = function() {
        stageSize_txt.text = "w:"+Stage.width+", h:"+Stage.height;
    	prova_mc._xscale = 10;
    	prova_mc._yscale = 10;
    };
    where prova_mc is just a circle clip on stage, but nothing happens if I resize my browser

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi Cap,

    You forgot to add one line of code from the tutorial you used.

    Stage.addListener(stageListener);

  3. #3
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    Thanks, Fruit,

    I didn't think this would be posted. I kept being redirected to a page saying the site was down...

    I do have the line in my file, I forgot to post it here.

    Does this have anything to do depending on the browser one uses? I have tried on chrome and internet explorer and it doesn't change the size of my clip on stage

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Here you are

  5. #5
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    Hey, thanks, Fruitbeard

    can I ask you to write the code for me here, please? I have restored my computer again and would like to try and keep it as clean of expired programs as possible

  6. #6
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    you need a clip called screen on the screen too, square, x=0, y=0

    [PHP]Stage.scaleMode = "noScale";
    Stage.align = "TL";

    this.createTextField("stageSize_txt",this.getNextH ighestDepth%2

  7. #7
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    thanks, Fruitbeard,

  8. #8
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    wow as2 has listeners, never "heard" of that good to know.

  9. #9
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    You have been self mastering AS2 for this long and never knew that.

  10. #10
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    My previous post was missing most of what I wrote, I hope you managed to get what you needed Cap.
    A test to see if it has been fixed.

    PHP Code:
    Stage.scaleMode "noScale";
    Stage.align "TL";

    this.createTextField("stageSize_txt",this.getNextHighestDepth(),100,100,100,22);
    var 
    stageListener:Object = new Object();

    Stage.addListener(stageListener);
    stageListener.onResize theStage;

    function 
    theStage():Void
    {
        
    stageSize_txt.text "w:" Stage.width ", h:" Stage.height;
        
    prova_mc._xscale 10;
        
    prova_mc._yscale 10;
        
    screen._width Stage.width;
        
    screen._height Stage.height;
        
    screen._x 0;
        
    screen._y 0;
    }

    //theStage(); 

  11. #11
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    make the jump you said, itll be fun you said

  12. #12
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Switching to AS3 does not mean forgetting the AS2 knowledge you have.
    Anyway, the fact that AS2 has listeners has nothing to do with taking the jump.

    It was the fact that whilst becoming an AS2 guru, it seems a little odd that you never heard of listeners in AS2 before.

  13. #13
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    maybe I should've listened :/

  14. #14
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi

    PHP Code:
    var AlloyListener:Object = new Object();

    Stage.addListener(AlloyListener);
    AlloyListener.onMousemove doAlloy;

    function 
    doAlloy():Void
    {
        
    Alloy.payAttention;


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center