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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:45:04+00:00 2026-05-20T08:45:04+00:00

Ok, my mind is boggling over this issue im having. I know this might

  • 0

Ok, my mind is boggling over this issue im having. I know this might seem like such an easy issue and I can’t understand why I cant figure it out but none the less I can’t and I’ve just about given up. Here’s the issue:

I have a sprite container which is supposed to hold a bunch of thumbnails to videos. I am able to populate the container with all the videos and the whole works but obviously if I add a bunch of videos its going to exceed the size of the flash document so I need to add a UIScrollBar (which I did) now the scrollbars target is set to the container but isnt allowing me to scroll and if im correct this is because the container doesnt have a set height. So Im trying to set the height of this container but the second I try setting the height or even width all my thumbnails I used to be able to see are gone! It’s as if the size is being set to 0 when its not I’ve even tried to set it to a specified size just to test and nothing. Anyways heres my code if anyone can help out I’d really appreciate it! Thanks in advance!


import fl.controls.UIScrollBar; 

var videoList:XMLList;
var numVideos:Number;
var current_Video:Number = 0;
var video_position:Number;
var video_paused:Boolean;
var xmlPlaylist:String;

//XML File setup
var playlist_xml:XML;
var myLoader:URLLoader = new URLLoader();

//Playlist setup
var thumb_width:Number;
var thumb_height:Number;
var thumbs_x:Number;
var thumbs_y:Number;
var main_container:Sprite;
var thumbs:Sprite;
var scrollbar:UIScrollBar;

//Loader Data
this.loaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
function loaderComplete(e:Event):void
{
    var myQueryStrings = this.loaderInfo.parameters;
    xmlPlaylist = myQueryStrings.pList;

    myLoader.load(new URLRequest(xmlPlaylist + "?uniq=" + new Date().getTime()));
}

myLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void {
    playlist_xml = new XML(e.target.data);

    numVideos = playlist_xml.video.length();
    videoList = playlist_xml.video;

    thumb_width = playlist_xml.@thumb_width;
    thumb_height = playlist_xml.@thumb_height;
    thumbs_x = playlist_xml.@thumbs_x;
    thumbs_y = playlist_xml.@thumbs_y;

    current_Video = Math.round(Math.random()*(numVideos-1))+1;
    current_Video--;

    startPlayer();
}

function startPlayer()
{
    makeContainers();
    callThumbs();
    setVideo(current_Video);
}

function makeContainers():void
{
    main_container = new Sprite();
    addChild(main_container);

    thumbs = new Sprite();
    thumbs.addEventListener(MouseEvent.CLICK, playVideo);
    thumbs.addEventListener(MouseEvent.MOUSE_OVER, onOver);
    thumbs.addEventListener(MouseEvent.MOUSE_OUT, onOut);
    thumbs.x = thumbs_x;
    thumbs.y = thumbs_y;

This is where the Issue is: (If i comment out this code it displays the thumbnails)


    thumbs.width = thumb_width;
    thumbs.height = (thumb_height + 11) * 3;

    thumbs.buttonMode = true;
    main_container.addChild(thumbs);

    scrollbar = new UIScrollBar();
    scrollbar.x = thumbs_x + thumb_width + 2;
    scrollbar.y = thumbs_y;
    scrollbar.setSize(25, (thumb_height + 11) * 3);
    scrollbar.visible = true;
    scrollbar.scrollTarget = thumbs;
    main_container.addChild(scrollbar);
}

function callThumbs():void
{
    for (var i:Number = 0; i (less than) numVideos; i++) //For some reason Stack Overflow isnt allowing me to put the symbol less than so i just typed it in...
    {
        var thumb_url = videoList[i].@thumb;
        var thumb_loader = new Loader();
        thumb_loader.name = i;
        thumb_loader.load(new URLRequest(thumb_url));

        thumb_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);

        thumb_loader.y = (thumb_height + 11) * i;
    }
}

function thumbLoaded(e:Event):void
{
    var my_thumb:Loader = Loader(e.target.loader);
    thumbs.addChild(my_thumb);
}

function playVideo(e:MouseEvent):void
{
    setVideo(e.target.name);
}

function onOver (e:MouseEvent):void
{
    var my_thumb:Loader = Loader(e.target);
    my_thumb.alpha = 0.5;
}

function onOut (e:MouseEvent):void
{
    var my_thumb:Loader = Loader (e.target);
    my_thumb.alpha = 1;
}

function setVideo(current_Video)
{
    var display:String = videoList[current_Video].@title;
    var video:String = videoList[current_Video].@url;

    txt_Display.text = display;
    flvPlayer.source = video;
}

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-05-20T08:45:05+00:00Added an answer on May 20, 2026 at 8:45 am

    This is easy. You are creating Sprite, adding listeners, setting coordinates. The sprite is still empty. Then you set width and height, which are translating to scaleX and scaleY. On empty sprite this messes up transformation matrix and sprite will never show up. Set width, height, or scaleX/Y only on non-empty sprites.

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

Sidebar

Related Questions

This is blowing my mind because it's probably an easy solution, but I can't
This is mind-boggling... I can make getResource() and getResourceAsStream() work properly when I run
My php is a little rusty but this is boggling my mind right now.
Mind has gone blank this afternoon and can't for the life of me figure
I have in mind a construct like this: template <typename T, T defaultValue> struct
This is boggling my mind. Using the following code: Process du = new Process();
This is something that's been mind boggling to me for a while, some times
I'm trying to get my head round this mind boggling stuff they call Database
I'm having a rather mind-boggling problem with some JS I'm working on for a
Why does System.Xml.XmlDocument.LoadXml method throw System.Net.WebException ? This is really mind boggling crazy, if

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.