(draft) Description: Define how the same task done in Flash would be done using cocos2d [ADDED BY: Robert Payne]: Some of these may have solutions that are easier but I have yet to find any: TIPS:
[ADDED BY: Boon]:
Objective-C and Actionscript 3 (draft)
[ObjC] id is a pointer to any type of object
[AS3] Object
[ObjC] BOOL (values: YES | NO)
[AS3] Boolean (true | false)
[ObjC] nil
[AS3] (undefined | null)
[ObjC] The name of the class (specified in .h or .m) doesn’t have to match with the filename
[AS3] The name of the class HAS to match with the filename
View-based methods
[ObjC] addSubview
[AS3] addChild
[ObjC] bringSubviewToFront, bringSubviewToBack
[AS3] setChildIndex
[ObjC] removeFromSuperview
[AS3] parent.removeChild
[ObjC] exchangeSubviewAtIndex
[AS3] swapChildrenAt
convertPoint:fromView → localToGlobal, globalToLocal
convertPoint:toView → localToGlobal, globalToLocal
convertPoint:toView:nil → localToGlobal
[ObjC] setNeedsDisplay/setNeedsDisplayInRect
[AS3] stage.invalidate
[ObjC] setAnimationEnabled
[AS3] play/stop
[ObjC] UIView::hitTest
[AS3] displayObject.hitTest
[ObjC] UIView::pointInside
[AS3] objectsUnderPoint
[ObjC] userInteractionEnabled
[AS3] mouseEnabled
Dynamic method calling
[ObjC]
if( [obj respondsToSelector:@selector(method)] ) or NSSelectorFromString(method)
[obj performSelector:@selector(method)]; or [obj method];
[AS3]
if (obj.hasOwnProperty(method))
{
obj.method();
}