A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: _width and _height

  1. #1
    Member
    Join Date
    Mar 2003
    Posts
    30

    _width and _height

    I have a problem with the _width and _height property. I have a menu that contain a mask (to hide the 3D effect). My problem is that the _width and _height property give me the size of the Mask and not the actual visible size. Is there a way to specify a layer or something on which I want the _witdh and _height property to have those of the visible part only?

    I want to use this to hide my sub menu like that
    if (((_parent._ymouse < 0) or (_parent._ymouse > _parent._height))
    or ((_parent._xmouse < 0) or (_parent._xmouse > _parent._width))){
    HideSubMenu();
    }

  2. #2
    Senior Member xaero182's Avatar
    Join Date
    Sep 2002
    Posts
    159
    hey,

    isn't the size of your mask equal to the visible part?

    or is it a mask that exists out of different parts and you want the sum of the heights and widths of these parts?

    greets,

    Xaero

  3. #3
    Member
    Join Date
    Mar 2003
    Posts
    30
    yeah, you're right, it's the size of the mask that is the visible part. But the _width and _height property give me the size of the layer that is mask. I want the _width and _height of the visible part.

  4. #4
    Senior Member xaero182's Avatar
    Join Date
    Sep 2002
    Posts
    159
    hmmm

    did you give an instance name to your mask?

    i tested this:

    my mask 's instance name is mc

    txt = mc._width;

    it worked
    it returned 288, the width of the mask...

    can you send me your movieclip (fla) if it doesn't work?

    greets,


    Xaero

  5. #5
    Member
    Join Date
    Mar 2003
    Posts
    30
    how do you give a mask an instance name?

  6. #6
    Member
    Join Date
    Mar 2003
    Posts
    30
    I send you a very simple example that give me the width of a big rectangle but I want the width of the small rectangle. Could you tell me what I have to do to get the width of the visible part?

    Thank you
    Attached Files Attached Files

  7. #7
    Senior Member xaero182's Avatar
    Join Date
    Sep 2002
    Posts
    159
    hey,

    i made a movieclip of your mask and gave it an instance name

    greets,

    Xaero
    Attached Files Attached Files

  8. #8
    Member
    Join Date
    Mar 2003
    Posts
    30
    Thanks for your help xaero182.
    But I still have a problem, I modyfied the .fla to show you what my problem is.
    I add text on the rectangle but it's not visible when I tested the animation.
    Do you know how to make the text appear?
    I don't understand why if I change the color it's change but the text doesn't appear.
    Attached Files Attached Files

  9. #9
    Senior Member xaero182's Avatar
    Join Date
    Sep 2002
    Posts
    159
    aaaahhhh i see what the problem is

    u used dynamic text
    if you want to mask or add spacial effects (fade,...) to this type of tekst, just click on 'character...' (properties bar in MX) and set 'Embed Font Outlines
    For' 'All Characters'

    greets,


    Xaero

  10. #10
    Member
    Join Date
    Mar 2003
    Posts
    30
    Thanks xaero182!
    I'd never find that by myself!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center