johntimothybailey
(0 comments, 16 posts)
This user hasn't shared any profile information
Posts by johntimothybailey
Funny Compiler Check Bug
0return [
{label:"MyriadPro",styleName:"textDefault"}
,{label:"Albertus",styleName:"textAlbertus"}
];
return
[
{label:"MyriadPro",styleName:"textDefault"}
,{label:"Albertus",styleName:"textAlbertus"}
];
1065: Metadata attributes cannot have more than one element. ProjectName/src/com/novelastudios/examples FontsUtil.as line 8 1255105753861 1317796
[/error message]
Popularity: 6% [?]
Serialize/Clone Objects (Bug with Required Constructor Params)
0My opinion is that the following is a big bug.
When serializing/cloning an object that has required constructor parameters, you receive an error telling you the arguments are incorrect. Note: the following is just an example using a “native” flash class. Really, you should never have to serialize or clone an Event, so please just see it as an example class as the type of class isn’t the point.
import flash.net.registerClassAlias;
import flash.events.Event;
import mx.utils.ObjectUtil;
flash.net.registerClassAlias("flash.events.Event",Event);
var event:Event = new Event(Event.CHANGE);
var eventClone:* = ObjectUtil.copy(event);
trace(eventClone is Event)
RESULT
ArgumentError: Error #1063: Argument count mismatch on flash.events::Event(). Expected 1, got 0.
at flash.utils::ByteArray/readObject()
at mx.utils::ObjectUtil$/copy()
at Untitled_fla::MainTimeline/frame1()
As noted by Nutrox, “All constructor parameters need a default value. You can’t pass values directly to an object’s constructor when it is restored from serialised data because Flash creates an instance of the object automatically before calling the object’s readExternal() method.”
What are your thoughts? I’m interested in striking a conversation about this.
Popularity: 33% [?]
Hidden $addChild for Flex Components
0Ever try to add a DisplayObject to a Flex Component? If you have, you know the run-time engine will complain about a type conversion (Adobe casts DisplayObjects to IUIComponents). Well, there is a hidden $addChild for UIComponents. To utilize simply add use namespace mx_internal; to the beginning of your script. Now you can use $addChild.
For more information, check out http://www.boostworthy.com/
Popularity: 6% [?]
DisplayObject.scrollRect dimension reporting workaround
0I came across a bug where when you set the scrollRect of a DisplayObject and get a dimension, within the first few mil/nano-seconds it reports the correct width and height. However, after that the reported width and height is the scrollRect‘s width and height. This to me is a bug considering you can not request the object to tell you it’s full dimensions any longer.
Take a look at http://www.kirupa.com/forum/archive/index.php/t-256884.html and here is the solution http://usecake.com/lab/find-the-height-and-width-of-a-sprite-with-a-scrollrect.html
Popularity: 31% [?]