# Using Flex components instead of AS3 classes

**URL:** https://forum.kirupa.com/t/using-flex-components-instead-of-as3-classes/250998
**Category:** flash
**Created:** [February 4, 2008, 2:51pm UTC](https://forum.kirupa.com/t/using-flex-components-instead-of-as3-classes/250998 "2008-02-04T14:51:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Miguelele](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@Miguelele](https://forum.kirupa.com/u/Miguelele)
#### Post date: [February 4, 2008, 2:51pm UTC](https://forum.kirupa.com/t/using-flex-components-instead-of-as3-classes/250998/1 "2008-02-04T14:51:18Z")

</div>

Hi: after my first great Flex experience using pure AS3 code, I’m going to try the “visual style”, using mxml, but I have found a show stopper. Although I am sure it a silly question:

- I have a loop to display picture thumbs, with name and comments.
- The picture, the text fields and the graphics ornaments are in a component.

I think about a Component as it is a Class, isn’t it true?

So I have instantiated the component as any other class, but I can’t communicate with its functions (setPictureName) or the properties. It fires an error in the main container.

On the other side: **if I comment out the references to the functions, all the thumbs are perfectly displayed** , with the ornaments I have drawn in the component. So the component IS there!!

No problem using a class written in pure AS3, but I think Flex components are better for graphic layouts, so I want to try it if someone can help me.

Regards: Miguel
