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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:03:40+00:00 2026-05-14T02:03:40+00:00

I am building a Flex application with ActionScript 3. Unfortunately I’ve hit a wall

  • 0

I am building a Flex application with ActionScript 3. Unfortunately I’ve hit a wall with this one…

I would like to be able to apply an upSkin to my dynamically generated button like this:

//this theSkin variable is dynamic in my app, but for this example it's a simple string
var theSkin:String = "http://www.mypicturedomain.com/images/myimage.gif";

var navBtn:Button = new Button();
navBtn.id = "thumb1";
navBtn.width = 60;
navBtn.height = 45;    

//skin the button
navBtn.setStyle("upSkin", theSkin);

//add the button to my canvas
myCanvas.addChild(navBtn);

When I attempt this, I get this error:

TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Loader@3dac941 to Class.

How do I skin this button with my image dynamically? A couple of things to consider:

  1. The upSkin image must be remote. It can’t be local.
  2. The button must be generated dynamically (it’s in a for loop).

Any help/ideas would be much appreciated at this point!

  • 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-14T02:03:41+00:00Added an answer on May 14, 2026 at 2:03 am

    I solved my problem by going with a HorizontalList component instead of a canvas. Much easier! Just had to stick my images in an array and make sure that itemRenderer was set to mx.controls.Image so it would display the items in my array collection as images. Once my array was made, I just had to create an arraycollection out of it then assign a data source to the horizontallist. It looks something like this:

    private function myFunction():void{
    
        var thumbArray:Array = new Array("http://www.something.com/mypic1.png", "http://www.something.com/mypic4.png", "http://www.something.com/mypic3.png");
        var myArrayCollection = new ArrayCollection(thumbArray);
    
        imageScroller.dataSource = myArrayCollection;
    
    }
    
    <mx:HorizontalList itemRenderer="mx.controls.Image" columnWidth="80" rowHeight="64" x="0" y="0" id="imageScroller" width="640" enabled="true" borderStyle="none" backgroundAlpha="1" borderColor="#FCA000" backgroundColor="#1C1C1C"></mx:HorizontalList>
    

    Hope this helps someone else!

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

Sidebar

Related Questions

I'm building a Flex/Flash Builder 4 application that loads data using E4X/XML, like this:
I'm building a desktop application in Flex/AIR, and one of the current items on
I am building a web based application written in ASP.NET and Flex. One of
I am building a mobile application in Flex 4.5 and from this app I
I'm building a flex application using the http://code.google.com/p/facebook-actionscript-api/ library. Is it possible to get
I am building a Flex iPhone application that in an ideal world would need
i'm building a client-side WMS parser (flex/ActionScript 3) & i'd like to test against
I'm building Flex 3 application and I have a geocoding service ( http://.../GeocodeServer )
I'm building a Flex application, which is going to perform many server requests (let's
I'm building a quite large Flex application as our administration tools and I need

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.