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 1005371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:17:03+00:00 2026-05-16T08:17:03+00:00

I’m using the Loader class in AS3.0 to load external images. I need to

  • 0

I’m using the Loader class in AS3.0 to load external images. I need to load a random image each time and I’m using a timer to load a new image after 5 seconds or so. When I load the first image, I call…

myMovieClip.addChild(loader);

After the first time I call…

if (myMovieClip.numChildren > 0) {
  myMovieClip.addChildAt(loader, 1);
}

So, this should add the newly loaded image behind the first one…that seems to be working…

The next step I want to do is to fade between these two clips, so the one in front fades out over a couple of seconds and is then finally removed when it is invisible. After another few seconds I load the next one and repeat the process.

At present, I start a timer and when it fires I do this…

if (Loader(myMovieClip.getChildAt(0)).content.alpha <= 0)
{
  // Check if the alpha value is 0...if so, remove the image and stop the timer
  myMovieClip.removeChildAt(0);
  timer.stop();
}
else
{
  // Increase transparency
  Loader(myMovieClip.getChildAt(0)).content.alpha -= 0.1;
}

The problem is that my fading routine does not work. One image loads, and the next one appears straight away when it is finished loading.

My code feels like a bit of a hack…is there a nicer way that actually works…?

  • 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-05-16T08:17:03+00:00Added an answer on May 16, 2026 at 8:17 am

    A few pointers.

    Before adding an image, make sure its alpha equals 0, otherwise your image will show instantly.

    Fox is right, you can use a class to handle the fading or your images, namely the tweening of the image’s alpha property. I personally prefer to use TweenMax or TweenLite (greensock.com), but there are many different classes out there that can handle this very well.

    You can use the onComplete event of your tweening class to remove an image when it’s not visible anymore.

    You have to make sure that the next image is loaded before starting your fading routine, so I’d suggest calling the next image as soon as the previous one has loaded and having a Boolean to check against before starting the fading routine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have thousands of HTML files to process using Groovy/Java and I need to
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I want use html5's new tag to play a wav file (currently only supported
I am doing a simple coin flipping experiment for class that involves flipping a
In my XML file chapters tag has more chapter tag.i need to display chapters

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.