Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Customize the RadioButton component

Explorer ,
Mar 07, 2013 Mar 07, 2013

This question was posted in response to the following article: http://help.adobe.com/en_US/as3/components/WS5b3ccc516d4fbf351e63e3d118a9c65b32-7f1b.html

TOPICS
ActionScript
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 07, 2013 Mar 07, 2013

"You can transform a RadioButton component horizontally and vertically while authoring and at run time. While authoring, select the component on the Stage and use the Free Transform tool or any of the Modify > Transform commands. At run time, use the setSize() method.".

No, both methods don't work. There is a reason why Flash is losing ground to other solutions. First and forthmost, even the documentation itself is incorrect.

I can't imagine having a setSize() method and propertiies like scaleX and scaleY when all these don't work (to make the radio button bigger).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 07, 2013 Mar 07, 2013

actually the bounding box of the radio button does get bigger ... but visual wise, it still looks the same! Seriously one may then ask - then what's the purpose???

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Mar 07, 2013 Mar 07, 2013

Put the RadioButton Component inside a MovieClip and then scale the MovieClip, this should give you the desired (visible) effect

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 08, 2013 Mar 08, 2013

Thanks. Using a mc as a "wrapper" does work. But what's the purpose of providing methods and properties that don't work? Worst still, the documnetation is incorrect.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Mar 08, 2013 Mar 08, 2013

Components in AS3 are structural different from MovieClips even if they might have properties like scaleX etc. these properties work different than in MovieClips. Google AS3 slice-9 and you will get an impression why it makes sense if you want to avoid distortion and other nasty things.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 08, 2013 Mar 08, 2013

No, if you have checked the AS3 reference, setSize is actually a method of UIComponent. Likewise, in the AS3 component framework, scaleX is a property of the UIComponent. The inheritance structure is

UIComponent Inheritance Sprite Inheritance DisplayObjectContainer Inheritance InteractiveObject Inheritance DisplayObject Inheritance EventDispatcher Inheritance Object.

MovieClip is out of the picture here.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Mar 08, 2013 Mar 08, 2013

Yes, thats what I said. While Adobe might have a tendency to not always make their documantation crystal clear, your sentence:

But what's the purpose of providing methods and properties that don't work? Worst still, the documnetation is incorrect.

shows that you expected the components to behave like a Sprite/MovieClip (scaling should behave similar to these: all parts of say a RadioButton Component should scale visually)

You made the mistake to expect that the word "scale" could only have one meaning, the one that you are used to (from working with normal MovieClips/Sprites).

Read this article: then the reason why components need to use another "context" to control their size will become clear.

By using MovieClip as a wrapper class you can "override" this behaviour if you want to use components in an non-standardconform way. So I really don`t see your problem here.

And why you would use that to criticize Adobe/Flash as being unprofessional, where your rant only shows that you maybe have missed the basics how to work properly with components.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 08, 2013 Mar 08, 2013

While I appreciate your input, is the documentation ""You can transform a RadioButton component horizontally and vertically while authoring and at run time. While authoring, select the component on the Stage and use the Free Transform tool or any of the Modify > Transform commands. At run time, use the setSize() method." correct?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Mar 08, 2013 Mar 08, 2013
LATEST

It is, actually. While you would expect the font and cirlce for the RBcomponent should transform visually if you use the tranform controls, the main purpose of components inside a componentframework is to work together with other components, and since the most common use case for radiobuttons is to be arranged aligned with other components it is useful to go the extra way of styling a component (via Textformat for example) or skinning it (if you want to change the look& feel) so that you can easily use the same textformat.

I can't imagine having a setSize() method and propertiies like scaleX and scaleY when all these don't work (to make the radio button bigger).

The component is a compiled clip, the visual part is by far not the most important part of it.

Sure Adobe could have invented a new property like scaleOnlyTheBoundingBoxX but hopefully you see while in the long run that wouldn`t be helpful.

Its a similar thing to say about a displayObjects x/y properties:

I can't imagine having a setPosition() method and propertiies like x and y when all these don't work (setting the display objects  position where I want it).

Because the unexperienced user expects that a stage has only one absolute coordinate system where in fact every display object has its own.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines