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

  • Home
  • SEARCH
  • 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 3875772
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:18:19+00:00 2026-05-19T22:18:19+00:00

I am running a loop to pull thumbs into a containing movieclip from an

  • 0

I am running a loop to pull thumbs into a containing movieclip from an xml list. What I want to do is have the thumb’s parent movieclip fade in after they are done loading, but I can’t figure out how to reference the parent once it’s loaded.

My code(which currently doesn’t work the way I want it):

var vsThumb:articleBox;
var currentarticleX:Number = 0;
var articleLinkURL:String;
var articleImageURL:String;
var articleText:String;
var vsThumbLoader:Loader;
var next_x:Number;
next_x = 9;
var thumbAlphaTween:Tween;
var articlevsThumb:Array = new Array();

function loadarticleHeadlines():void
{
    for (var i:int = 0; i < egarticleXml.articlelist.articleitem.length(); i++)
    {
        vsThumb = new articleBox();
        vsThumb.alpha = 0;
        vsThumbLoader = new Loader();
        vsThumbLoader.load(new URLRequest(egarticleXml.articlelist.articleitem[i].articlethumbnail));
        articleListContainter.addChild(vsThumb);
        vsThumb.articleImage.addChild(vsThumbLoader);
        vsThumb.articleTitle.text = egarticleXml.articlelist.articleitem[i].articletitle;
        titleAutosize(vsThumb.articleTitle);
        vsThumb.x = next_x;
        next_x += 260;
        articlevsThumb[i] = vsThumb;
        vsThumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, showBox);
        vsThumb.clickBtn.buttonMode = true;
    }
    function showBox(event:Event):void 
    {
        thumbAlphaTween = new Tween(articlevsThumb[i],"alpha",None.easeNone,0,1,.25,true);
    }
}

So how do I refer back to the loader’s parent so I can fade in the whole movieclip? Can I pass a variable into the showBox function?

  • 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-19T22:18:20+00:00Added an answer on May 19, 2026 at 10:18 pm
    1. Don’t use nested functions. They tend to make things more complicated.
    2. i will always have the end value (articleitem.length()-1) in all of the event handlers you create, because its scope is the outer function, loadarticleHeadlines (it will increase by 1 on every iteration). That’s probably why your code doesn’t work.
    3. The event will be fired on the loaderInfo of your loader, so you can find the loader’s parent by using event.target.loader.parent:

      function loadarticleHeadlines() : void
      {
          for (var i:int = 0; i < egarticleXml.articlelist.articleitem.length(); i++)
          {
              vsThumb = new articleBox();
              vsThumb.alpha = 0;
              vsThumbLoader = new Loader();
              vsThumbLoader.load(new URLRequest(egarticleXml.articlelist.articleitem[i].articlethumbnail));
              articleListContainter.addChild(vsThumb);
              vsThumb.articleImage.addChild(vsThumbLoader);
              vsThumb.articleTitle.text = egarticleXml.articlelist.articleitem[i].articletitle;
              titleAutosize(vsThumb.articleTitle);
              vsThumb.x = next_x;
              next_x += 260;
              articlevsThumb[i] = vsThumb;
              vsThumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, showBox);
              vsThumb.clickBtn.buttonMode = true;
          }
      }
      
      
      function showBox(event:Event):void 
      {
          thumbAlphaTween = new Tween(event.target.loader.parent,"alpha",None.easeNone,0,1,.25,true);
      }
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a long running loop I want to run in the background with
I have a program running a loop I want to have two time counters,
I have a while loop running that is returning values from a MYSQL table.
I have a Parallel.ForEach loop running an intensive operation inside the body. The operation
I have a program in Octave that has a loop - running a function
I currently have a php loop running exactly how I need it with proper
I have a for loop running on my main runloop. I'm trying to have
I have an Arduino connected to my computer running a loop, sending a value
I have a thread, A , which performs periodic actions inside a while(running) loop.
I have this loop running after a click(), and it does not return false

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.