Creating MX2004 V2 Components - How do I access the width property in code?

Posted on 2005-05-16
Last Modified: 2010-04-03
I have created a MX2004 component which works really well.  

As a final touch, i would like to use the W (width) and H(height) properties from the component box in my code.  

How can I reference these properties in code?

This is a little urgent so i've put the points up a bit.
Question by:mt600
    LVL 27

    Expert Comment

    Is your component extending movieclip or UIObject?

    Author Comment

    it extends UIComponent
    LVL 27

    Accepted Solution


    Author Comment


    I believe I have spotted a glitch in v2 components.  Although I was using that coding, when i compiled my clip, the width variable then read as 0 (although in live preview and in my pre-compiled version, the width was read fine).  I'm not sure what I did, although i tidied a lot of code, but it's working now so thankyou.  

    I needed someone to confirm it and an example so i knew i wasn't going mad.  Thanks again, just what the doctor ordered.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
    This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
    The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now