My first component

Been playing with components lately, and that was my first attempt, a component that draws a rectangle with specific arguments that a user supply (I know it will never be used, but made it for the sake of curiosity what components are and how can they be created), quite dirty coding tho, but my first attempt to do it, please tell me the pros and cons of my coding. And please do not hesitate to ask me about any part of my coding.

And if you’re also curious about them as I was, then check out Macromedia DevNet’s Tutorials, here is the one that got me started:

[link]

Seeking your comments as well as your suggestions. :nerd:

Very sweet h88, good job! :thumb:

Will have to use this one one day for interfaces and such!

Thanks for your complement, Sintax, :slight_smile: tho I don’t think it’s quite a good idea to use components to draw shapes and such, because you simply can make a MovieClip method that returns exactly the same thing and gain more stability. Nevertheless, components will come in handy if you try to create guestbooks, forms, or even buttons! :slight_smile:

Clever :slight_smile: Finally a component where I actually understand what is going on. Nice and simple, good job man :slight_smile:

Thank you Lost, Glad you understanded what’s going on mine, I had exactly the same feeling when I tried once to view the code of one of the Flash UI components. :skull:

I think my code wasn’t exactly a good OOP practice, but it was my first try after all, can’t wait to make other applications using components, though I think It’s not that easy, but not that hard at the same time. :beam:

Hoping to see your component done as well as others comments and suggestions about my code. :slight_smile:

Yeah, I have view a few components myself and my jaw hit the floor. I am horrible at OOP coding, I try and try, but it just never seems to want to click. Raydred was explaining some of it to me in simple terms, and I got it and still do, but overall I am just no good at OOP.

I tried my hand at making a component before, and failed… miserably :stuck_out_tongue:

In the future I may give it another shot though :bad:

I don’t know whether or not you code was good OOP practice, all I know is it works and it your coding looks clean to me :slight_smile:

*Originally posted by lostinbeta *
**Clever :slight_smile: Finally a component where I actually understand what is going on. Nice and simple, good job man :slight_smile: **
:wink:

[edit]

oh, and i don’t see the ‘dirty coding’ you’re talking about, it’s pretty clear =)