Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9234679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:50:47+00:00 2026-06-18T06:50:47+00:00

I made a photo gallery, and I Use Flash cs5 As3 UILoader component,how can

  • 0

I made a photo gallery, and I Use Flash cs5 As3 UILoader component,how can I load all different size photo in the center? The Uiloader component registration on the top left, I need make to to middle?
stage 1000 px wide, 420px highth.

My photos are differents size, some are 803×400, some are 580×400, and the uiLoader registration point is on the top left, that is the problem, if I made the 580×400 in the middle, and the 803x400px phone will be far out to the right.

Is there any way to fix this problem?

[www.bradmarkel.net]
click wildlife, you will understand what I mean.

Here is my gallery codes, thanks for your time!

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 = "smallNews/resized web news photos/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
{
var spr = new Sprite();

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

addChild( spr );

// Center uiLoader in spr
uiLoader.x =  -  uiLoader.width / 500;
uiLoader.y =  -  uiLoader.height / 235;
new Tween(spr,"rotationX",Elastic.easeOut,45,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 = 47, then do something...
if (imageNumber == 24)
{
    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 = "smallNews/resized web news photos/0" + imageNumber + ".jpg";
checkNumber();
      }

      back_btn.addEventListener(MouseEvent.CLICK, backImage);

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

      stop();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:50:48+00:00Added an answer on June 18, 2026 at 6:50 am

    You have to arrange uiloader in the center of its container, if I understood do something like this:

    function completeHandler(event:Event):void
    {
    var spr = new Sprite();
    
    // Place spr anywhere on the stage
    spr.x = stage.stageWidth / 6;
    spr.y = stage.stageHeight / 235;
    spr.addChild( uiLoader );
    
    addChild( spr );
    
    // Center uiLoader in spr
    uiLoader.x =  -  uiLoader.content.width / 2;
    uiLoader.y =  -  uiLoader.content.height / 2;
    new Tween(spr,"rotationX",Elastic.easeOut,45,0,4,true);
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've made my own custom photo gallery control, where the user can tap a
I made a neat little photo gallery here at - http://schnell.dreamhosters.com/wallpapers.php Feel free to
I have made a photo gallery,but when the images change it seems the table
I have made a php image gallery, which should list all the subdirectories of
I want to add functionality to my photo gallery - different types of animation
I have made an image gallery. What currently happens is the following. I display
I'm making a new version of an app that use Three20. I have made
I have made an online gallery using Python and Django. I've just started to
I am trying to build a photo frame application on iphone. I made the
I just released an update to my app DreamFX Photo, and made it free.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.