0

*I have some prlblems to center my photos in stage, I use Flash cs5 as3 UILoader, and the photos size is all are defferents, so I tried to move the UILoader Registration point to the center on the top with free transform tool, but Is not change anything at all. I don't want to check the ScaleContent in the Properties, made those photos very bad qualities. 1000px x 700px highth stage, and photos should be 400px high. What should I do?

      import flash.utils.Timer;
      import flash.events.TimerEvent;
      import flash.events.MouseEvent;
      import flash.events.Event;
      import fl.containers.UILoader;
      import flash.text.TextField;
      import flash.display.SimpleButton;
      import fl.transitions.Tween;
      import fl.transitions.TweenEvent;
      import fl.transitions.easing.*;
      stage.colorCorrection = ColorCorrection.ON;
      var myImage:String = "smallWildlife/00.jpg";
      var request:URLRequest = new URLRequest(myImage);
      uiLoader.addEventListener(Event.COMPLETE, completeHandler);
      uiLoader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
      uiLoader.load(request);

      function progressHandler(event:ProgressEvent):void
      {

status_txt.text = "Percentage Loaded:" + Math.round(event.target.percentLoaded);
       }

       function completeHandler(event:Event):void
       {   
       uiLoader.x = stage.stageWidth/6 - uiLoader.content.width/6;
       uiLoader.y = stage.stageHeight/100 - uiLoader.content.height/700;
       new Tween(uiLoader,"rotationX",Elastic.easeOut,90,0,4,true);
       }

        next_btn.addEventListener(MouseEvent.CLICK, nextImage);

       //variable is a container that holds some value...;
       var imageNumber:Number = 0;

      function checkNumber():void
      {
next_btn.visible = true;
back_btn.visible = true;
//If the imageNumber is = 58, then do something...
if (imageNumber == 58)
{
    trace(imageNumber);
    next_btn.visible = false;
}
//if the imageNumber is = 1, then don't show the back button
if (imageNumber == 0)
 {
    trace(imageNumber);
        back_btn.visible = false;
  }
        }
       checkNumber();

       function nextImage(evtObj:MouseEvent):void
       {
//Adding to the current value +1
imageNumber++;
uiLoader.source = "smallWildlife/0" + imageNumber + ".jpg";
checkNumber();
      }

       back_btn.addEventListener(MouseEvent.CLICK, backImage);

      function backImage(evtObj:MouseEvent):void
      {
//Subtract 1 from the current value
imageNumber--;
uiLoader.source = "smallWildlife/0" + imageNumber + ".jpg";
checkNumber();
      }

      stop();

Thanks for your time!

Lily Mm
  • 7
  • 6

2 Answers2

0

The registration point is the little crosshair that comes up when you're editing MovieClips, not the anchor point of the transformation tool.

David
  • 877
  • 1
  • 7
  • 18
  • Hi David, UILoader, how to change the UILoader registration point? – Lily Mm Feb 03 '13 at 00:49
  • @LilyMm It's not easy doing it dynamically, but if you're using the IDE, then just edit the UILoader MovieClip and move it around. – David Feb 03 '13 at 02:02
  • Hi David, I use AS3 Flash CS5, I don't know IDE, so I change UILoader to a MovieClip? – Lily Mm Feb 07 '13 at 16:43
  • @LilyMm CS5 is an IDE. What exactly is your UILoader if it's not a MovieClip? – David Feb 07 '13 at 17:27
  • @Aavid, I just drag the UILoader component to the stage, that's how I use. – Lily Mm Feb 07 '13 at 18:09
  • David, sorry spell your name wrong. I did convert UILoader component to a symbol, but I have error. 1006 – Lily Mm Feb 07 '13 at 18:16
  • @LilyMm Can you post the line that it refers to? And for future reference, you don't have to use @ David since comments on my questions automatically come up in my notifications. – David Feb 07 '13 at 19:34
  • -David, I don't know much about his website, I hope I do right. Line, mean ----? bradmarkel.net, I made this website, but have problems with center those phontos. – Lily Mm Feb 07 '13 at 21:44
  • @LilyMm I was referring to the part of the code that the error points to. – David Feb 07 '13 at 22:09
  • -David, I am chinese, some times it's hard for me to understand. what should I do to make my photos in center of stage??? try this www.bradmarkel.net – Lily Mm Feb 07 '13 at 22:30
  • @LilyMm You can always email me the .fla and I can show you how it's done. Or follow this: http://www.youtube.com/watch?v=94V1R68H5FQ&edufilter=Db24N54Eu_vpe4P65Iz5FA – David Feb 07 '13 at 22:44
  • -David, this video is not working, and I need change uiLoader registration. – Lily Mm Feb 07 '13 at 23:22
  • -David, in youtube that video I can watch, but the video is for teach change the movie clip registration point, but UILoader is not the same way to change registration point, right? – Lily Mm Feb 08 '13 at 02:10
  • @LilyMm What exactly is UILoader? A Graphic? – David Feb 08 '13 at 04:08
  • -David, uiLoader component, dynamic loader to load photos in Flash, so it's not a Graphic. – Lily Mm Feb 08 '13 at 17:58
0

Try changing this

function completeHandler(event:Event):void
{   
    uiLoader.x = stage.stageWidth/6 - uiLoader.content.width/6;
    uiLoader.y = stage.stageHeight/100 - uiLoader.content.height/700;
    new Tween(uiLoader,"rotationX",Elastic.easeOut,90,0,4,true);
}

to this

function completeHandler(event:Event):void
{   
    var spr = new Sprite();

    // Place spr anywhere on the stage
    spr.x = stage.stageWidth / 6 - uiLoader.content.width / 6;
    spr.y = stage.stageHeight / 100 - uiLoader.content.height / 700;
    spr.addChild( uiLoader );

    addChild( spr );

    // Center uiLoader in spr
    uiLoader.x = - uiLoader.width / 2;
    uiLoader.y = - uiLoader.height / 2;

    new Tween( spr, "rotationX", Elastic.easeOut, 90, 0, 4, true );
}
khailcs
  • 328
  • 1
  • 9
  • go to bradmarkel.net and cleck the willife gallery, I just can not make it right. – Lily Mm Feb 08 '13 at 22:55
  • I now see your problem - your **uiLoader** is not a **UILoader object** but a **Graphic** inside a **Sprite** inside a **MovieClip**. What you need to do is **click** the **windows tab**, then click **components**, find the **UILoader**, then drag it to the stage and name it **uiLoader**. That should do. Here it is doing xRotation: 'http://www.swfcabin.com/open/1360365998'. Good luck with your website! – khailcs Feb 09 '13 at 01:27
  • I don't get this code of yours: this.uiLoader.x = (-this.uiLoader.width) / 402; this.uiLoader.y = (-this.uiLoader.height) / 235; Try going back to this: uiLoader.x = - uiLoader.width / 2; uiLoader.y = - uiLoader.height / 2; – khailcs Feb 09 '13 at 01:36
  • you can see the website, bradmarkel.net, wildlife, all photos are not on the center. – Lily Mm Feb 12 '13 at 18:57
  • Did you know how to make all those photos in the center in the website? – Lily Mm Feb 12 '13 at 23:24
  • Send me the fla. files so we can get this over with. Here's my email add: khailcs@yahoo.com – khailcs Feb 13 '13 at 13:07
  • @khaics, Thanks, I will sent the Fla files, but I want to make sure is only Fla files? or all the file with photos? – Lily Mm Feb 15 '13 at 15:47
  • Thanks, I will sent the Fla files, but I want to make sure is only Fla files? or all the file with photos? – Lily Mm Feb 15 '13 at 17:36
  • ,I did send with photos along to your email! – Lily Mm Feb 18 '13 at 01:28
  • Didn't receive your email. – khailcs Feb 23 '13 at 23:32
  • ,I fixed the problem, sorry I get back this late. Thanks for your help! – Lily Mm Mar 05 '13 at 03:00