Skip navigation
Currently Being Moderated

UnitValue in flex

Apr 20, 2012 2:23 AM

Tags: #extension

Probably it's a simple question but I'm unable to find the answer, which is the equivalent of UnitValue in flex ?

 

It seems UnitValue is not available with extension builder, I have looked in all libraries.

 

And in this case how to get the value of ( for sample) activeDocument.width ? It works playing with the string value but I'm sure it should be a better method.

 

Thanks.

 
Replies
  • Currently Being Moderated
    Apr 20, 2012 2:12 PM   in reply to MSSDedalus

    Sorry, there isn't one in any readily available library I know of.

     

    That said, I do have one that I wrote for my own personal use.

     

    I've attached the source code of the class. No guarantee it works!!

     

     

     

    Regards

    Attachments:
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 20, 2012 2:16 PM   in reply to Bob Stucky

    For that matter, you might find my Bounds class useful too!

     

    Again, it's only been tested as far as I've needed to. No guarantees. But then you have the source, so you can fix whatever you might need to.

     

     

     

     

    Regards

    Attachments:
     
    |
    Mark as:
  • Currently Being Moderated
    Dec 14, 2012 1:19 AM   in reply to Bob Stucky

    Hey Bob,

     

    thanks for the UnicValue.as it helps a lot. I just browsed your code Bounds.as for a minute and saw a possible copy&paste error in line 144:

     

     

    bounds.right.subtract( Bounds.unitValue( page.marginPreferences.bottom ) );

    bounds.bottom.subtract( Bounds.unitValue( page.marginPreferences.bottom ) );

     

    Looks wrong, hadn't had the time to think over it.

     

    Regards,

    Gregor

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 14, 2012 9:16 AM   in reply to grefel

    Yep, it's a copy paste error.

     

    Thanks for pointing it out.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points