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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:05:13+00:00 2026-05-22T00:05:13+00:00

Objective: I would like to pass Skins to an itemRenderer (which is a Button)

  • 0

Objective: I would like to pass Skins to an itemRenderer (which is a Button) of a List, and be able to skin every button in that List.

This is what I have:

List:

<s:List itemRenderer="renderers.ItemRenderer" dataProvider="{collectionWorkspace}" />

ArrayCollection:

<s:ArrayCollection id="collectionWorkspace">
    <comp:Layout1 />
    <comp:Layout2 />
    <comp:Layout3 />
    <comp:Layout4 />
    <comp:Layout5 />
</s:ArrayCollection>

The Layouts are Skin classes with HostComponent Button.

ItemRenderer:

<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:mx="library://ns.adobe.com/flex/halo"
                xmlns:s="library://ns.adobe.com/flex/spark">

    <s:states>
        <s:State name="normal" />
    </s:states>

    <s:Button skinClass="{data}"/>

</s:ItemRenderer>

I get an error (fixed for clarification):
Error: Skin for Application….Button1 cannot be found.

  • 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-22T00:05:14+00:00Added an answer on May 22, 2026 at 12:05 am

    You are handing the skinClass property an instance of the skin class, not the actual class (which the button needs to create its own instance of the skin class).

    If you can, the best thing to do would be to make collectionWorkspace be an array of Class objects, not of instances.

    <s:ArrayCollection id="collectionWorkspace">
        <fx:Class>yourPkg.Layout1</fx:Class>
        <fx:Class>yourPkg.Layout2</fx:Class>
        <fx:Class>yourPkg.Layout3</fx:Class>
        <fx:Class>yourPkg.Layout4</fx:Class>
        <fx:Class>yourPkg.Layout5</fx:Class>
    </s:ArrayCollection>
    

    If you can’t do that, you should be able to pull out the class of the instance and pass it to the skinClass.

    <s:Button skinClass="{Object(data).constructor}"/>
    

    EDIT:

    The binding by default won’t work because data starts off as null before it gets initialized with the class. If you give it null, you will get the exception. To fix it, you will need to return the default for the time between null and value:

    <s:Button skinClass="{data != null ? data as Class : spark.skins.spark.ButtonSkin}"/>
    

    I tried doing this with an ArrayCollection using some button skins. It worked.

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

Sidebar

Related Questions

I have a web service with a URL like this: http://webservice.com/?log=1 I would like
I'm creating a doubly-linked list in Objective-C. I would like my node class to
In an class header I have seen something like this: enum { kAudioSessionProperty_PreferredHardwareSampleRate =
I would like to know how the following works in Objective-C in my header
I would like to know how, in Objective-C, how to tell if a string
I am developping an objective c application and I would like to detect non
I am porting a project from C# to Objective-C, and I would like to
How would I expose an Objective-C method within JavaScript when using the iPhone SDK
Objective-C has no namespaces; it's much like C, everything is within one global namespace.
My objective is to write a program which will call another executable on a

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.