[pypy-svn] r68952 - in pypy/branch/avm/pypy/translator/avm2: . intrinsic intrinsic/src intrinsic/src/adobe intrinsic/src/adobe/utils intrinsic/src/authoring intrinsic/src/flash intrinsic/src/flash/accessibility intrinsic/src/flash/desktop intrinsic/src/flash/display intrinsic/src/flash/errors intrinsic/src/flash/events intrinsic/src/flash/external intrinsic/src/flash/filters intrinsic/src/flash/geom intrinsic/src/flash/media intrinsic/src/flash/net intrinsic/src/flash/printing intrinsic/src/flash/profiler intrinsic/src/flash/sampler intrinsic/src/flash/system intrinsic/src/flash/text intrinsic/src/flash/text/engine intrinsic/src/flash/trace intrinsic/src/flash/ui intrinsic/src/flash/utils intrinsic/src/flash/xml test

magcius at codespeak.net magcius at codespeak.net
Wed Nov 4 00:51:45 CET 2009


Author: magcius
Date: Wed Nov  4 00:51:35 2009
New Revision: 68952

Added:
   pypy/branch/avm/pypy/translator/avm2/class_.py
   pypy/branch/avm/pypy/translator/avm2/constant.py
   pypy/branch/avm/pypy/translator/avm2/function.py
   pypy/branch/avm/pypy/translator/avm2/genavm.py
   pypy/branch/avm/pypy/translator/avm2/intrinsic/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/autopath.py
   pypy/branch/avm/pypy/translator/avm2/intrinsic/intrgen.py
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/ArgumentError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Array.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Boolean.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Class.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Date.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/DefinitionError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Error.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/EvalError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Function.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Math.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Namespace.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Number.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Object.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/QName.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/RangeError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/ReferenceError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/RegExp.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/SecurityError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/String.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/SyntaxError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/TypeError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/URIError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/UninitializedError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Vector.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/VerifyError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/XML.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/XMLList.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/adobe/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/adobe/utils/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/adobe/utils/CustomActions.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/adobe/utils/ProductManager.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/adobe/utils/XMLUI.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/adobe/utils/package.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/arguments.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/authoring/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/authoring/authObject.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/accessibility/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/accessibility/Accessibility.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/accessibility/AccessibilityImplementation.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/accessibility/AccessibilityProperties.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/desktop/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/desktop/Clipboard.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/desktop/ClipboardFormats.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/desktop/ClipboardTransferMode.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/AVM1Movie.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ActionScriptVersion.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Bitmap.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/BitmapData.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/BitmapDataChannel.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/BlendMode.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/CapsStyle.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ColorCorrection.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ColorCorrectionSupport.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/DisplayObject.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/DisplayObjectContainer.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/FrameLabel.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GradientType.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Graphics.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsBitmapFill.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsEndFill.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsGradientFill.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsPath.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsPathCommand.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsPathWinding.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsShaderFill.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsSolidFill.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsStroke.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsTrianglePath.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/IBitmapDrawable.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/IGraphicsData.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/IGraphicsFill.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/IGraphicsPath.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/IGraphicsStroke.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/InteractiveObject.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/InterpolationMethod.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/JointStyle.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/LineScaleMode.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Loader.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/LoaderInfo.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/MorphShape.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/MovieClip.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/PixelSnapping.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/SWFVersion.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Scene.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Shader.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderData.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderInput.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderJob.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderParameter.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderParameterType.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderPrecision.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Shape.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/SimpleButton.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/SpreadMethod.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Sprite.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Stage.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/StageAlign.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/StageDisplayState.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/StageQuality.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/StageScaleMode.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/TriangleCulling.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/EOFError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/IOError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/IllegalOperationError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/InvalidSWFError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/MemoryError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/ScriptTimeoutError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/StackOverflowError.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/ActivityEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/AsyncErrorEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/ContextMenuEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/DataEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/ErrorEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/Event.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/EventDispatcher.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/EventPhase.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/FocusEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/FullScreenEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/HTTPStatusEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/IEventDispatcher.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/IMEEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/IOErrorEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/KeyboardEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/MouseEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/NetFilterEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/NetStatusEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/ProgressEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/SampleDataEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/SecurityErrorEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/ShaderEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/StatusEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/SyncEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/TextEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/TimerEvent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/WeakFunctionClosure.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/WeakMethodClosure.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/external/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/external/ExternalInterface.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/BevelFilter.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/BitmapFilter.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/BitmapFilterQuality.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/BitmapFilterType.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/BlurFilter.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/ColorMatrixFilter.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/ConvolutionFilter.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/DisplacementMapFilter.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/DisplacementMapFilterMode.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/DropShadowFilter.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/GlowFilter.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/GradientBevelFilter.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/GradientGlowFilter.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/ShaderFilter.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/ColorTransform.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Matrix.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Matrix3D.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Orientation3D.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/PerspectiveProjection.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Point.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Rectangle.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Transform.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Utils3D.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Vector3D.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/Camera.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/ID3Info.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/Microphone.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/Sound.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/SoundChannel.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/SoundCodec.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/SoundLoaderContext.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/SoundMixer.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/SoundTransform.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/Video.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/package.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/DynamicPropertyOutput.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/FileFilter.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/FileReference.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/FileReferenceList.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/IDynamicPropertyOutput.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/IDynamicPropertyWriter.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/LocalConnection.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/NetConnection.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/NetStream.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/NetStreamInfo.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/NetStreamPlayOptions.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/NetStreamPlayTransitions.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/ObjectEncoding.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/Responder.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/SharedObject.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/SharedObjectFlushStatus.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/Socket.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLLoader.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLLoaderDataFormat.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLRequest.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLRequestHeader.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLRequestMethod.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLStream.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLVariables.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/XMLSocket.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/package.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/printing/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/printing/PrintJob.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/printing/PrintJobOptions.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/printing/PrintJobOrientation.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/profiler/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/profiler/package.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/DeleteObjectSample.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/NewObjectSample.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/Sample.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/StackFrame.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/package.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/ApplicationDomain.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/Capabilities.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/FSCommand.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/IME.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/IMEConversionMode.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/JPEGLoaderContext.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/LoaderContext.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/Security.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/SecurityDomain.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/SecurityPanel.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/System.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/package.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/AntiAliasType.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/CSMSettings.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/Font.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/FontStyle.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/FontType.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/GridFitType.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/StaticText.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/StyleSheet.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextColorType.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextDisplayMode.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextExtent.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextField.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextFieldAutoSize.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextFieldType.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextFormat.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextFormatAlign.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextFormatDisplay.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextLineMetrics.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextRenderer.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextRun.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextSnapshot.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/BreakOpportunity.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/CFFHinting.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/ContentElement.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/DigitCase.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/DigitWidth.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/EastAsianJustifier.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/ElementFormat.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/FontDescription.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/FontLookup.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/FontMetrics.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/FontPosture.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/FontWeight.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/GraphicElement.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/GroupElement.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/JustificationStyle.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/Kerning.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/LigatureLevel.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/LineJustification.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/RenderingMode.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/SpaceJustifier.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TabAlignment.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TabStop.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextBaseline.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextBlock.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextElement.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextJustifier.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextLine.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextLineCreationResult.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextLineMirrorRegion.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextLineValidity.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextRotation.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TypographicCase.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/trace/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/trace/Trace.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/ContextMenu.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/ContextMenuBuiltInItems.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/ContextMenuClipboardItems.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/ContextMenuItem.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/KeyLocation.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/Keyboard.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/Mouse.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/MouseCursor.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/ByteArray.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/Dictionary.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/Endian.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/IDataInput.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/IDataOutput.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/IExternalizable.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/ObjectInput.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/ObjectOutput.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/Proxy.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/SetIntervalTimer.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/Timer.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/package.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/XMLDocument.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/XMLNode.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/XMLNodeType.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/XMLParser.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/XMLTag.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/int.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/toplevel.as
   pypy/branch/avm/pypy/translator/avm2/intrinsic/src/uint.as
   pypy/branch/avm/pypy/translator/avm2/metavm.py
   pypy/branch/avm/pypy/translator/avm2/opcodes.py
   pypy/branch/avm/pypy/translator/avm2/test/
   pypy/branch/avm/pypy/translator/avm2/test/__init__.py
   pypy/branch/avm/pypy/translator/avm2/test/autopath.py
   pypy/branch/avm/pypy/translator/avm2/test/bootstrap.py
   pypy/branch/avm/pypy/translator/avm2/test/browsertest.py
   pypy/branch/avm/pypy/translator/avm2/test/harness.py
   pypy/branch/avm/pypy/translator/avm2/test/mylib.py
   pypy/branch/avm/pypy/translator/avm2/test/runtest.py
   pypy/branch/avm/pypy/translator/avm2/test/runtest2.py
   pypy/branch/avm/pypy/translator/avm2/test/simpletest.py
   pypy/branch/avm/pypy/translator/avm2/test/test_backendopt.py
   pypy/branch/avm/pypy/translator/avm2/test/test_bool.py
   pypy/branch/avm/pypy/translator/avm2/test/test_builtin.py
   pypy/branch/avm/pypy/translator/avm2/test/test_carbonpython.py
   pypy/branch/avm/pypy/translator/avm2/test/test_cast.py
   pypy/branch/avm/pypy/translator/avm2/test/test_class.py
   pypy/branch/avm/pypy/translator/avm2/test/test_constant.py
   pypy/branch/avm/pypy/translator/avm2/test/test_cts.py
   pypy/branch/avm/pypy/translator/avm2/test/test_dict.py
   pypy/branch/avm/pypy/translator/avm2/test/test_dotnet.py
   pypy/branch/avm/pypy/translator/avm2/test/test_exception.py
   pypy/branch/avm/pypy/translator/avm2/test/test_float.py
   pypy/branch/avm/pypy/translator/avm2/test/test_harness.py
   pypy/branch/avm/pypy/translator/avm2/test/test_int.py
   pypy/branch/avm/pypy/translator/avm2/test/test_list.py
   pypy/branch/avm/pypy/translator/avm2/test/test_objectmodel.py
   pypy/branch/avm/pypy/translator/avm2/test/test_oo.py
   pypy/branch/avm/pypy/translator/avm2/test/test_op.py
   pypy/branch/avm/pypy/translator/avm2/test/test_overflow.py
   pypy/branch/avm/pypy/translator/avm2/test/test_pbc.py
   pypy/branch/avm/pypy/translator/avm2/test/test_primitive.py
   pypy/branch/avm/pypy/translator/avm2/test/test_query.py
   pypy/branch/avm/pypy/translator/avm2/test/test_range.py
   pypy/branch/avm/pypy/translator/avm2/test/test_runtest.py
   pypy/branch/avm/pypy/translator/avm2/test/test_snippet.py
   pypy/branch/avm/pypy/translator/avm2/test/test_streamio.py
   pypy/branch/avm/pypy/translator/avm2/test/test_string.py
   pypy/branch/avm/pypy/translator/avm2/test/test_tuple.py
   pypy/branch/avm/pypy/translator/avm2/test/test_unicode.py
   pypy/branch/avm/pypy/translator/avm2/test/test_weakref.py
Log:
And new files

Added: pypy/branch/avm/pypy/translator/avm2/class_.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/class_.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,149 @@
+from pypy.rpython.ootypesystem import ootype
+from pypy.translator.cli.node import Node
+from pypy.translator.cli.cts import CTS
+from pypy.translator.oosupport.constant import push_constant
+from pypy.translator.cli.ilgenerator import CLIBaseGenerator
+
+try:
+    set
+except NameError:
+    from sets import Set as set
+
+class Class(Node):
+    def __init__(self, db, INSTANCE, namespace, name):
+        self.db = db
+        self.cts = db.genoo.TypeSystem(db)
+        self.INSTANCE = INSTANCE
+        self.namespace = namespace
+        self.name = name
+
+    def dependencies(self):
+        if not self.is_root(self.INSTANCE):
+            self.db.pending_class(self.INSTANCE._superclass)
+
+    def __hash__(self):
+        return hash(self.INSTANCE)
+
+    def __eq__(self, other):
+        return self.INSTANCE == other.INSTANCE
+
+    def __ne__(self, other):
+        return not self == other
+
+    def is_root(INSTANCE):
+        return INSTANCE._superclass is None
+    is_root = staticmethod(is_root)
+
+    def get_name(self):
+        return self.name
+
+    def __repr__(self):
+        return '<Class %s>' % self.name
+
+    def get_base_class(self):
+        base_class = self.INSTANCE._superclass
+        if self.is_root(base_class):
+            return 'Object'
+        else:
+            return self.db.class_name(base_class)
+
+    def is_abstract(self):
+        return False # XXX
+        
+        # if INSTANCE has an abstract method, the class is abstract
+        method_names = set()
+        for m_name, m_meth in self.INSTANCE._methods.iteritems():
+            if not hasattr(m_meth, 'graph'):
+                return True
+            method_names.add(m_name)
+
+        # if superclasses have abstract methods not overriden by
+        # INSTANCE, the class is abstract
+        abstract_method_names = set()
+        cls = self.INSTANCE._superclass
+        while cls is not None:
+            abstract_method_names.update(cls._methods.keys())
+            cls = cls._superclass
+        not_overriden = abstract_method_names.difference(method_names)
+        if not_overriden:
+            return True
+        
+        return False
+
+    def render(self, ilasm):        
+        if self.is_root(self.INSTANCE):
+            return
+
+        self.ilasm = ilasm
+        self.gen = CLIBaseGenerator(self.db, ilasm)
+
+        if self.namespace:
+            ilasm.begin_namespace(self.namespace)
+
+        ilasm.begin_class(self.name, self.get_base_class(), abstract=self.is_abstract())
+        for f_name, (f_type, f_default) in self.INSTANCE._fields.iteritems():
+            cts_type = self.cts.lltype_to_cts(f_type)
+            f_name = self.cts.escape_name(f_name)
+            if cts_type != CTS.types.void:
+                ilasm.field(f_name, cts_type)
+
+        self._ctor()
+        self._toString()
+
+        for m_name, m_meth in self.INSTANCE._methods.iteritems():
+            if hasattr(m_meth, 'graph'):
+                # if the first argument's type is not a supertype of
+                # this class it means that this method this method is
+                # not really used by the class: don't render it, else
+                # there would be a type mismatch.
+                args =  m_meth.graph.getargs()
+                SELF = args[0].concretetype
+                if not ootype.isSubclass(self.INSTANCE, SELF):
+                    continue
+                f = self.db.genoo.Function(self.db, m_meth.graph, m_name, is_method = True)
+                f.render(ilasm)
+            else:
+                # abstract method
+                METH = m_meth._TYPE
+                arglist = [(self.cts.lltype_to_cts(ARG), 'v%d' % i)
+                           for i, ARG in enumerate(METH.ARGS)
+                           if ARG is not ootype.Void]
+                returntype = self.cts.lltype_to_cts(METH.RESULT)
+                ilasm.begin_function(m_name, arglist, returntype, False, 'virtual') #, 'abstract')
+                ilasm.add_comment('abstract method')
+                if isinstance(METH.RESULT, ootype.OOType):
+                    ilasm.opcode('ldnull')
+                else:
+                    push_constant(self.db, METH.RESULT, 0, self.gen)
+                ilasm.opcode('ret')
+                ilasm.end_function()
+    
+    def _ctor(self):
+        self.ilasm.begin_function('.ctor', [], 'void', False, 'specialname', 'rtspecialname', 'instance')
+        self.ilasm.opcode('ldarg.0')
+        self.ilasm.call('instance void %s::.ctor()' % self.get_base_class())
+        # set default values for fields
+        default_values = self.INSTANCE._fields.copy()
+        default_values.update(self.INSTANCE._overridden_defaults)
+        for f_name, (F_TYPE, f_default) in default_values.iteritems():
+            if getattr(F_TYPE, '_is_value_type', False):
+                continue # we can't set it to null
+            INSTANCE_DEF, _ = self.INSTANCE._lookup_field(f_name)
+            cts_type = self.cts.lltype_to_cts(F_TYPE)
+            f_name = self.cts.escape_name(f_name)
+            if cts_type != CTS.types.void:
+                self.ilasm.opcode('ldarg.0')
+                push_constant(self.db, F_TYPE, f_default, self.gen)
+                class_name = self.db.class_name(INSTANCE_DEF)
+                self.ilasm.set_field((cts_type, class_name, f_name))
+
+        self.ilasm.opcode('ret')
+        self.ilasm.end_function()
+
+    def _toString(self):
+        self.ilasm.begin_function('ToString', [], 'string', False, 'virtual', 'instance', 'default')
+        self.ilasm.opcode('ldarg.0')
+        self.ilasm.call('string class [pypylib]pypy.test.Result::InstanceToPython(object)')
+        self.ilasm.ret()
+        self.ilasm.end_function()
+

Added: pypy/branch/avm/pypy/translator/avm2/constant.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/constant.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,465 @@
+"""
+___________________________________________________________________________
+CLI Constants
+
+This module extends the oosupport/constant.py to be specific to the
+CLI.  Most of the code in this file is in the constant generators, which
+determine how constants are stored and loaded (static fields, lazy
+initialization, etc), but some constant classes have been overloaded or
+extended to allow for special handling.
+
+The CLI implementation is broken into three sections:
+
+* Constant Generators: different generators implementing different
+  techniques for loading constants (Static fields, singleton fields, etc)
+
+* Mixins: mixins are used to add a few CLI-specific methods to each
+  constant class.  Basically, any time I wanted to extend a base class
+  (such as AbstractConst or DictConst), I created a mixin, and then
+  mixed it in to each sub-class of that base-class.
+
+* Subclasses: here are the CLI specific classes.  Eventually, these
+  probably wouldn't need to exist at all (the JVM doesn't have any,
+  for example), or could simply have empty bodies and exist to
+  combine a mixin and the generic base class.  For now, though, they
+  contain the create_pointer() and initialize_data() routines.
+"""
+
+from pypy.translator.oosupport.constant import \
+     push_constant, WeakRefConst, StaticMethodConst, CustomDictConst, \
+     ListConst, ClassConst, InstanceConst, RecordConst, DictConst, \
+     BaseConstantGenerator, AbstractConst, ArrayConst
+from pypy.rpython.ootypesystem import ootype
+from pypy.translator.cli.comparer import EqualityComparer
+from pypy.translator.avm2 import constants, types
+from pypy.rpython.lltypesystem import lltype
+
+CONST_CLASS = types.Avm2PackagedType('pypy.runtime::CONSTANTS')
+
+DEBUG_CONST_INIT = False
+DEBUG_CONST_INIT_VERBOSE = False
+SERIALIZE = False
+
+# ______________________________________________________________________
+# Constant Generators
+#
+# Different generators implementing different techniques for loading
+# constants (Static fields, singleton fields, etc)
+
+class Avm2BaseConstGenerator(BaseConstantGenerator):
+    """
+    Base of all CLI constant generators.  It implements the oosupport
+    constant generator in terms of the CLI interface.
+    """
+
+    def __init__(self, db):
+        BaseConstantGenerator.__init__(self, db)
+        self.cts = db.genoo.TypeSystem(db)
+
+    def _begin_gen_constants(self, gen, all_constants):
+        pass
+
+    def _end_gen_constants(self, gen, numsteps):
+        assert gen.ilasm is self.ilasm
+        self.end_class()
+
+    def begin_class(self):
+        self.ilasm.begin_namespace(CONST_NAMESPACE)
+        self.ilasm.begin_class(CONST_CLASSNAME, beforefieldinit=True)
+
+    def end_class(self):
+        self.ilasm.end_class()
+        self.ilasm.end_namespace()
+
+    def _declare_const(self, gen, const):
+        self.ilasm.field(const.name, const.get_type(), static=True)
+
+    def downcast_constant(self, gen, const, EXPECTED_TYPE):
+        type = self.cts.lltype_to_cts(EXPECTED_TYPE)
+        gen.ilasm.opcode('castclass', type)
+ 
+    def _get_key_for_const(self, value):
+        if isinstance(value, ootype._view) and isinstance(value._inst, ootype._record):
+            return value._inst
+        return BaseConstantGenerator._get_key_for_const(self, value)
+
+    def _create_complex_const(self, value):
+        from pypy.translator.cli.dotnet import _fieldinfo
+
+        if isinstance(value, _fieldinfo):
+            uniq = self.db.unique()
+            return CLIFieldInfoConst(self.db, value.llvalue, uniq)
+        elif isinstance(value, ootype._view) and isinstance(value._inst, ootype._record):
+            self.db.cts.lltype_to_cts(value._inst._TYPE) # record the type of the record
+            return self.record_const(value._inst)
+        else:
+            return BaseConstantGenerator._create_complex_const(self, value)
+
+class FieldConstGenerator(CLIBaseConstGenerator):
+    pass
+
+class StaticFieldConstGenerator(FieldConstGenerator):
+
+    # _________________________________________________________________
+    # OOSupport interface
+    
+    def push_constant(self, gen, const):
+        type_ = const.get_type()
+        gen.ilasm.load_static_constant(type_, CONST_NAMESPACE, CONST_CLASSNAME, const.name)
+        
+    def _push_constant_during_init(self, gen, const):
+        full_name = '%s::%s' % (CONST_CLASS, const.name)
+        gen.ilasm.opcode('ldsfld %s %s' % (const.get_type(), full_name))
+
+    def _store_constant(self, gen, const):
+        type_ = const.get_type()
+        gen.ilasm.store_static_constant(type_, CONST_NAMESPACE, CONST_CLASSNAME, const.name)
+
+    # _________________________________________________________________
+    # CLI interface
+
+    def _declare_step(self, gen, stepnum):
+        gen.ilasm.begin_function(
+            'step%d' % stepnum, [], 'void', False, 'static')
+
+    def _close_step(self, gen, stepnum):
+        gen.ilasm.ret()
+        gen.ilasm.end_function()
+
+    def _end_gen_constants(self, gen, numsteps):
+
+        self.ilasm.begin_function('.cctor', [], 'void', False, 'static',
+                                  'specialname', 'rtspecialname', 'default')
+        self.ilasm.stderr('CONST: initialization starts', DEBUG_CONST_INIT)
+        for i in range(numsteps):
+            self.ilasm.stderr('CONST: step %d of %d' % (i, numsteps),
+                              DEBUG_CONST_INIT)
+            step_name = 'step%d' % i
+            self.ilasm.call('void %s::%s()' % (CONST_CLASS, step_name))
+        self.ilasm.stderr('CONST: initialization completed', DEBUG_CONST_INIT)
+        self.ilasm.ret()
+        self.ilasm.end_function()
+
+        super(StaticFieldConstGenerator, self)._end_gen_constants(
+            gen, numsteps)
+
+class InstanceFieldConstGenerator(FieldConstGenerator):
+    
+    # _________________________________________________________________
+    # OOSupport interface
+    
+    def push_constant(self, gen, const):
+        # load the singleton instance
+        gen.ilasm.opcode('ldsfld class %s %s::Singleton' % (CONST_CLASS, CONST_CLASS))
+        gen.ilasm.opcode('ldfld %s %s::%s' % (const.get_type(), CONST_CLASS, const.name))
+
+    def _push_constant_during_init(self, gen, const):
+        # during initialization, we load the 'this' pointer from our
+        # argument rather than the singleton argument
+        gen.ilasm.opcode('ldarg.0')
+        gen.ilasm.opcode('ldfld %s %s::%s' % (const.get_type(), CONST_CLASS, const.name))
+
+    def _pre_store_constant(self, gen, const):
+        gen.ilasm.opcode('ldarg.0')
+        
+    def _store_constant(self, gen, const):
+        gen.ilasm.set_field((const.get_type(), CONST_CLASS, const.name))
+
+    # _________________________________________________________________
+    # CLI interface
+
+    def _declare_const(self, gen, all_constants):
+        gen.ilasm.field(const.name, const.get_type(), static=False)
+    
+    def _declare_step(self, gen, stepnum):
+        gen.ilasm.begin_function('step%d' % stepnum, [], 'void', False)
+
+    def _close_step(self, gen, stepnum):
+        gen.ilasm.ret()
+        gen.ilasm.end_function()
+
+    def _end_gen_constants(self, gen, numsteps):
+
+        ilasm = gen.ilasm
+
+        ilasm.begin_function('.ctor', [], 'void', False, 'specialname', 'rtspecialname', 'instance')
+        ilasm.opcode('ldarg.0')
+        ilasm.call('instance void object::.ctor()')
+
+        ilasm.opcode('ldarg.0')
+        ilasm.opcode('stsfld class %s %s::Singleton' % (CONST_CLASS, CONST_CLASS))
+        
+        for i in range(numsteps):
+            step_name = 'step%d' % i
+            ilasm.opcode('ldarg.0')
+            ilasm.call('instance void %s::%s()' % (CONST_CLASS, step_name))
+        ilasm.ret()
+        ilasm.end_function()
+
+        # declare&init the Singleton containing the constants
+        ilasm.field('Singleton', 'class %s' % CONST_CLASS, static=True)
+        ilasm.begin_function('.cctor', [], 'void', False, 'static', 'specialname', 'rtspecialname', 'default')
+        if SERIALIZE:
+            self._serialize_ctor()
+        else:
+            self._plain_ctor()
+        ilasm.end_function()
+
+        super(StaticFieldConstGenerator, self)._end_gen_constants(gen, numsteps)
+
+    def _plain_ctor(self):
+        self.ilasm.new('instance void class %s::.ctor()' % CONST_CLASS)
+        self.ilasm.pop()
+        self.ilasm.ret()
+
+    def _serialize_ctor(self):
+        self.ilasm.opcode('ldstr "constants.dat"')
+        self.ilasm.call('object [pypylib]pypy.runtime.Utils::Deserialize(string)')
+        self.ilasm.opcode('dup')
+        self.ilasm.opcode('brfalse initialize')
+        self.ilasm.stderr('Constants deserialized successfully')        
+        self.ilasm.opcode('stsfld class %s %s::Singleton' % (CONST_CLASS, CONST_CLASS))
+        self.ilasm.ret()
+        self.ilasm.label('initialize')
+        self.ilasm.pop()
+        self.ilasm.stderr('Cannot deserialize constants... initialize them!')
+        self.ilasm.new('instance void class %s::.ctor()' % CONST_CLASS)
+        self.ilasm.opcode('ldstr "constants.dat"')
+        self.ilasm.call('void [pypylib]pypy.runtime.Utils::Serialize(object, string)')
+        self.ilasm.ret()
+
+class LazyConstGenerator(StaticFieldConstGenerator):
+    def push_constant(self, ilasm, const):
+        getter_name = '%s::%s' % (CONST_CLASS, 'get_%s' % const.name)
+        ilasm.call('%s %s()' % (const.get_type(), getter_name))
+
+    def _create_pointers(self, gen, all_constants):
+        # overload to do nothing since we handle everything in lazy fashion
+        pass
+
+    def _initialize_data(self, gen, all_constants):
+        # overload to do nothing since we handle everything in lazy fashion
+        pass
+
+    def _declare_const(self, gen, const):
+        # Declare the field
+        super(LazyConstGenerator, self)._declare_const(gen, const)
+
+        # Create the method for accessing the field
+        getter_name = 'get_%s' % const.name
+        type_ = const.get_type()
+        self.ilasm.begin_function(getter_name, [], type_, False, 'static')
+        self.ilasm.load_static_constant(type_, CONST_NAMESPACE, CONST_CLASS, const.name)
+        # if it's already initialized, just return it
+        self.ilasm.opcode('dup')
+        self.ilasm.opcode('brfalse', 'initialize')
+        self.ilasm.opcode('ret')
+        # else, initialize!
+        self.ilasm.label('initialize')
+        self.ilasm.opcode('pop') # discard the null value we know is on the stack
+        const.instantiate(ilasm)
+        self.ilasm.opcode('dup') # two dups because const.init pops the value at the end
+        self.ilasm.opcode('dup')
+        self.ilasm.store_static_constant(type_, CONST_NAMESPACE, CONST_CLASS, const.name)
+        const.init(ilasm)
+        self.ilasm.opcode('ret')
+        self.ilasm.end_function()
+
+# ______________________________________________________________________
+# Mixins
+#
+# Mixins are used to add a few CLI-specific methods to each constant
+# class.  Basically, any time I wanted to extend a base class (such as
+# AbstractConst or DictConst), I created a mixin, and then mixed it in
+# to each sub-class of that base-class.  Kind of awkward.
+
+class CLIBaseConstMixin(object):
+    """ A mix-in with a few extra methods the CLI backend uses """
+    
+    def get_type(self):
+        """ Returns the CLI type for this constant's representation """
+        return self.cts.lltype_to_cts(self.value._TYPE)
+    
+    def push_inline(self, gen, TYPE):
+        """ Overload the oosupport version so that we use the CLI opcode
+        for pushing NULL """
+        assert self.is_null()
+        gen.ilasm.opcode('ldnull')
+
+class CLIDictMixin(CLIBaseConstMixin):
+    def _check_for_void_dict(self, gen):
+        KEYTYPE = self.value._TYPE._KEYTYPE
+        keytype = self.cts.lltype_to_cts(KEYTYPE)
+        keytype_T = self.cts.lltype_to_cts(self.value._TYPE.KEYTYPE_T)
+        VALUETYPE = self.value._TYPE._VALUETYPE
+        valuetype = self.cts.lltype_to_cts(VALUETYPE)
+        valuetype_T = self.cts.lltype_to_cts(self.value._TYPE.VALUETYPE_T)
+        if VALUETYPE is ootype.Void:
+            gen.add_comment('  CLI Dictionary w/ void value')
+            class_name = PYPY_DICT_OF_VOID % keytype
+            for key in self.value._dict:
+                gen.ilasm.opcode('dup')
+                push_constant(self.db, KEYTYPE, key, gen)
+                meth = 'void class %s::ll_set(%s)' % (class_name, keytype_T)
+                gen.ilasm.call_method(meth, False)
+            return True
+        return False
+    
+    def initialize_data(self, constgen, gen):
+        # special case: dict of void, ignore the values
+        if self._check_for_void_dict(gen):
+            return 
+        return super(CLIDictMixin, self).initialize_data(constgen, gen)
+
+# ______________________________________________________________________
+# Constant Classes
+#
+# Here we overload a few methods, and mix in the base classes above.
+# Note that the mix-ins go first so that they overload methods where
+# required.
+#
+# Eventually, these probably wouldn't need to exist at all (the JVM
+# doesn't have any, for example), or could simply have empty bodies
+# and exist to combine a mixin and the generic base class.  For now,
+# though, they contain the create_pointer() and initialize_data()
+# routines.  In order to get rid of them, we would need to implement
+# the generator interface in the CLI.
+
+class CLIRecordConst(CLIBaseConstMixin, RecordConst):
+    def create_pointer(self, gen):
+        self.db.const_count.inc('Record')
+        super(CLIRecordConst, self).create_pointer(gen)
+
+class CLIInstanceConst(CLIBaseConstMixin, InstanceConst):
+    def create_pointer(self, gen):
+        self.db.const_count.inc('Instance')
+        self.db.const_count.inc('Instance', self.OOTYPE())
+        super(CLIInstanceConst, self).create_pointer(gen)
+
+
+class CLIClassConst(CLIBaseConstMixin, ClassConst):
+    def is_inline(self):
+        return True
+
+    def push_inline(self, gen, EXPECTED_TYPE):
+        if not self.is_null():
+            if hasattr(self.value, '_FUNC'):
+                FUNC = self.value._FUNC
+                classname = self.db.record_delegate(FUNC)
+            else:
+                INSTANCE = self.value._INSTANCE
+                classname = self.db.class_name(INSTANCE)
+            gen.ilasm.opcode('ldtoken', classname)
+            gen.ilasm.call('class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)')
+            return
+        super(CLIClassConst, self).push_inline(gen, EXPECTED_TYPE)
+
+class CLIListConst(CLIBaseConstMixin, ListConst):
+
+    def _do_not_initialize(self):
+        # Check if it is a list of all zeroes:
+        try:
+            if self.value._list == [0] * len(self.value._list):
+                return True
+        except:
+            pass
+        return super(CLIListConst, self)._do_not_initialize()
+    
+    def create_pointer(self, gen):
+        self.db.const_count.inc('List')
+        self.db.const_count.inc('List', self.value._TYPE.ITEM)
+        self.db.const_count.inc('List', len(self.value._list))
+        super(CLIListConst, self).create_pointer(gen)
+
+
+class CLIArrayConst(CLIBaseConstMixin, ArrayConst):
+
+    def _do_not_initialize(self):
+        # Check if it is an array of all zeroes:
+        try:
+            if self.value._list == [0] * len(self.value._list):
+                return True
+        except:
+            pass
+        return super(CLIArrayConst, self)._do_not_initialize()
+
+    def _setitem(self, SELFTYPE, gen):
+        gen.array_setitem(SELFTYPE)
+
+
+class CLIDictConst(CLIDictMixin, DictConst):
+    def create_pointer(self, gen):
+        self.db.const_count.inc('Dict')
+        self.db.const_count.inc('Dict', self.value._TYPE._KEYTYPE, self.value._TYPE._VALUETYPE)
+        super(CLIDictConst, self).create_pointer(gen)        
+        
+class CLICustomDictConst(CLIDictMixin, CustomDictConst):
+    def record_dependencies(self):
+        if not self.value:
+            return
+        eq = self.value._dict.key_eq
+        hash = self.value._dict.key_hash
+        self.comparer = EqualityComparer(self.db, self.value._TYPE._KEYTYPE, eq, hash)
+        self.db.pending_node(self.comparer)
+        super(CLICustomDictConst, self).record_dependencies()
+
+    def create_pointer(self, gen):
+        assert not self.is_null()
+        gen.ilasm.new(self.comparer.get_ctor())
+        class_name = self.get_type()
+        gen.ilasm.new('instance void %s::.ctor(class '
+                      '[mscorlib]System.Collections.Generic.IEqualityComparer`1<!0>)'
+                  % class_name)
+        self.db.const_count.inc('CustomDict')
+        self.db.const_count.inc('CustomDict', self.value._TYPE._KEYTYPE, self.value._TYPE._VALUETYPE)
+
+class CLIStaticMethodConst(CLIBaseConstMixin, StaticMethodConst):
+    def create_pointer(self, gen):
+        assert not self.is_null()
+        signature = self.cts.graph_to_signature(self.value.graph)
+        gen.ilasm.opcode('ldnull')
+        gen.ilasm.opcode('ldftn', signature)
+        gen.ilasm.new('instance void class %s::.ctor(object, native int)' % self.delegate_type)
+        self.db.const_count.inc('StaticMethod')
+        
+    def initialize_data(self, constgen, gen):
+        return
+
+        
+class CLIWeakRefConst(CLIBaseConstMixin, WeakRefConst):
+    def create_pointer(self, gen):
+        gen.ilasm.new('instance void %s::.ctor()' % self.get_type())
+        self.db.const_count.inc('WeakRef')
+
+    def get_type(self, include_class=True):
+        return 'class ' + WEAKREF
+    
+    def initialize_data(self, constgen, gen):
+        if self.value is not None:
+            push_constant(self.db, self.value._TYPE, self.value, gen)
+            gen.ilasm.call_method('void %s::ll_set(object)' % self.get_type(), True)
+            return True
+    
+
+class CLIFieldInfoConst(AbstractConst):
+    def __init__(self, db, llvalue, count):
+        AbstractConst.__init__(self, db, llvalue, count)
+        self.name = 'FieldInfo__%d' % count
+    
+    def create_pointer(self, generator):
+        constgen = generator.db.constant_generator
+        const = constgen.record_const(self.value)
+        generator.ilasm.opcode('ldtoken', CONST_CLASS)
+        generator.ilasm.call('class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)')
+        generator.ilasm.opcode('ldstr', '"%s"' % const.name)
+        generator.ilasm.call_method('class [mscorlib]System.Reflection.FieldInfo class [mscorlib]System.Type::GetField(string)', virtual=True)
+
+    def get_type(self):
+        from pypy.translator.cli.cts import CliClassType
+        return CliClassType('mscorlib', 'System.Reflection.FieldInfo')
+
+    def initialize_data(self, constgen, gen):
+        pass
+
+    def record_dependencies(self):
+        self.db.constant_generator.record_const(self.value)

Added: pypy/branch/avm/pypy/translator/avm2/function.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/function.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,183 @@
+from functools import partial
+
+from pypy.objspace.flow import model as flowmodel
+from pypy.rpython.ootypesystem import ootype
+from pypy.rpython.lltypesystem.lltype import Void
+from pypy.translator.oosupport.function import Function as OOFunction
+from pypy.translator.cli.node import Node
+from pypy.translator.avm2 import constants, types
+
+class Function(OOFunction, Node):
+    
+    auto_propagate_exceptions = True
+
+    def __init__(self, *args, **kwargs):
+        OOFunction.__init__(self, *args, **kwargs)
+        
+        if hasattr(self.db.genoo, 'exceptiontransformer'):
+            self.auto_propagate_exceptions = False
+        
+        namespace = getattr(self.graph.func, '_namespace_', None)
+        if namespace:
+            if '.' in namespace:
+                self.namespace, self.classname = namespace.rsplit('.', 1)
+            else:
+                self.namespace = None
+                self.classname = namespace
+        else:
+            self.namespace = None
+            self.classname = None
+
+    def _create_generator(self, ilasm):
+        ilasm.db = self.db
+        return ilasm
+    
+    def record_ll_meta_exc(self, ll_meta_exc):
+        # record the type only if it doesn't belong to a native_class
+        ll_exc = ll_meta_exc._INSTANCE
+        NATIVE_INSTANCE = ll_exc._hints.get('NATIVE_INSTANCE', None)
+        if NATIVE_INSTANCE is None:
+            OOFunction.record_ll_meta_exc(self, ll_meta_exc)
+
+    def begin_render(self):
+        self._set_args()
+        self._set_locals()
+        if self.is_method:
+            self.generator.enter_method(self.name, args[1:])
+        elif self.classname:
+            self.generator.enter_static_method(self.name, args)
+        else:
+            self.generator.enter_function(self.name, args)
+        
+    def end_render(self):
+        if self.generator.scope.islabel:
+            self.generator.exit_scope()
+        self.generator.exit_context()
+        
+    def render_return_block(self, block):
+        return_var = block.inputargs[0]
+        if return_var.concretetype is Void:
+            self.generator.emit('returnvoid')
+        else:
+            self.generator.load(return_var)
+            self.generator.return_stmt()
+
+    def set_label(self, label):
+        return self.generator.set_label(label)
+
+    # def _render_op(self, op):
+    #     #instr_list = self.db.genoo.opcodes.get(op.opname, None)
+    #     #instr_list.render(self.generator, op)
+    #    super(Function, self)._render_op(op)
+
+    def _setup_link(self, link):
+        target = link.target
+        linkvars = []
+        for to_load, to_store in zip(link.args, target.inputargs):
+            if isinstance(to_load, flowmodel.Variable) and to_load.name == to_store.name:
+                continue
+            if to_load.concretetype is ootype.Void:
+                continue
+            linkvars.append((to_load, to_store))
+
+        # after SSI_to_SSA it can happen to have to_load = [a, b] and
+        # to_store = [b, c].  If we store each variable sequentially,
+        # 'b' would be overwritten before being read.  To solve, we
+        # first load all the values on the stack, then store in the
+        # appropriate places.
+
+        if self._trace_enabled():
+            self._trace('link', writeline=True)
+            for to_load, to_store in linkvars:
+                self._trace_value('%s <-- %s' % (to_store, to_load), to_load)
+            self._trace('', writeline=True)
+        
+        for to_load, to_store in linkvars:
+            self.generator.load(to_store)
+            self.generator.load(to_load)
+            self.generator.set_variable()
+
+    
+    # def begin_try(self, cond):
+    #     if cond:
+    #         self.ilasm.begin_try()
+    
+    # def end_try(self, target_label, cond):
+    #     if cond:
+    #         self.ilasm.leave(target_label)
+    #         self.ilasm.end_try()
+    #     else:
+    #         self.ilasm.branch(target_label)
+
+    # def begin_catch(self, llexitcase):
+    #     ll_meta_exc = llexitcase
+    #     ll_exc = ll_meta_exc._INSTANCE
+    #     cts_exc = self.cts.lltype_to_cts(ll_exc)
+    #     self.ilasm.begin_catch(cts_exc.classname())
+
+    # def end_catch(self, target_label):
+    #     self.ilasm.leave(target_label)
+    #     self.ilasm.end_catch()
+
+    # def render_raise_block(self, block):
+    #     exc = block.inputargs[1]
+    #     self.load(exc)
+    #     self.ilasm.opcode('throw')
+
+    # def store_exception_and_link(self, link):
+    #     if self._is_raise_block(link.target):
+    #         # the exception value is on the stack, use it as the 2nd target arg
+    #         assert len(link.args) == 2
+    #         assert len(link.target.inputargs) == 2
+    #         self.store(link.target.inputargs[1])
+    #     else:
+    #         # the exception value is on the stack, store it in the proper place
+    #         if isinstance(link.last_exception, flowmodel.Variable):
+    #             self.ilasm.opcode('dup')
+    #             self.store(link.last_exc_value)
+    #             self.ilasm.call_method(
+    #                 'class [mscorlib]System.Type object::GetType()',
+    #                 virtual=True)
+    #             self.store(link.last_exception)
+    #         else:
+    #             self.store(link.last_exc_value)
+    #         self._setup_link(link)
+
+    # def render_numeric_switch(self, block):
+    #     if block.exitswitch.concretetype in (ootype.SignedLongLong, ootype.UnsignedLongLong):
+    #         # TODO: it could be faster to check is the values fit in
+    #         # 32bit, and perform a cast in that case
+    #         self.render_numeric_switch_naive(block)
+    #         return
+
+    #     cases, min_case, max_case, default = self._collect_switch_cases(block)
+    #     is_sparse = self._is_sparse_switch(cases, min_case, max_case)
+
+    #     naive = (min_case < 0) or is_sparse
+    #     if naive:
+    #         self.render_numeric_switch_naive(block)
+    #         return
+
+    #     targets = []
+    #     for i in xrange(max_case+1):
+    #         link, lbl = cases.get(i, default)
+    #         targets.append(lbl)
+    #     self.generator.load(block.exitswitch)
+    #     self.ilasm.switch(targets)
+    #     self.render_switch_case(*default)
+    #     for link, lbl in cases.itervalues():
+    #         self.render_switch_case(link, lbl)
+
+    # def call_oostring(self, ARGTYPE):
+    #     if isinstance(ARGTYPE, ootype.Instance):
+    #         argtype = self.cts.types.object
+    #     else:
+    #         argtype = self.cts.lltype_to_cts(ARGTYPE)
+    #     self.call_signature('string [pypylib]pypy.runtime.Utils::OOString(%s, int32)' % argtype)
+
+    # def call_oounicode(self, ARGTYPE):
+    #     argtype = self.cts.lltype_to_cts(ARGTYPE)
+    #     self.call_signature('string [pypylib]pypy.runtime.Utils::OOUnicode(%s)' % argtype)
+
+    # Those parts of the generator interface that are function
+    # specific

Added: pypy/branch/avm/pypy/translator/avm2/genavm.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/genavm.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,38 @@
+
+import py
+from pypy.translator.oosupport.genoo import GenOO
+from pypy.translator.avm2.avm1gen import Avm2ilasm
+from pypy.translator.avm2.constant import AVM1ConstGenerator
+from pypy.translator.avm2.database import LowLevelDatabase
+from pypy.translator.avm2.function import Function
+from pypy.translator.avm2.opcodes import opcodes
+from pypy.translator.avm2.types import AVM1TypeSystem
+
+class GenAVM2(GenOO):
+    
+    opcodes = opcodes
+    Function = Function
+    Database = LowLevelDatabase
+    TypeSystem = AVM1TypeSystem
+
+    ConstantGenerator = AVM1ConstGenerator
+    
+    def __init__(self, tmpdir, translator, entrypoint, config=None, exctrans=False):
+        GenOO.__init__(self, tmpdir, translator, entrypoint, config, exctrans)
+        self.const_stat = str(tmpdir.join('const_stat'))
+        self.ilasm = None
+            
+    def create_assembler(self):
+        return AVM1Gen()
+    
+    def generate_source(self):
+        if self.ilasm is None:
+            self.ilasm = self.create_assembler()
+        self.fix_names()
+        self.gen_entrypoint()
+        self.gen_pendings()
+        self.db.gen_constants(self.ilasm)
+
+    # Don't do treebuilding stuff
+    def stack_optimization(self):
+        pass

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/autopath.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/autopath.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,135 @@
+"""
+self cloning, automatic path configuration 
+
+copy this into any subdirectory of pypy from which scripts need 
+to be run, typically all of the test subdirs. 
+The idea is that any such script simply issues
+
+    import autopath
+
+and this will make sure that the parent directory containing "pypy"
+is in sys.path. 
+
+If you modify the master "autopath.py" version (in pypy/tool/autopath.py) 
+you can directly run it which will copy itself on all autopath.py files
+it finds under the pypy root directory. 
+
+This module always provides these attributes:
+
+    pypydir    pypy root directory path 
+    this_dir   directory where this autopath.py resides 
+
+"""
+
+def __dirinfo(part):
+    """ return (partdir, this_dir) and insert parent of partdir
+    into sys.path.  If the parent directories don't have the part
+    an EnvironmentError is raised."""
+
+    import sys, os
+    try:
+        head = this_dir = os.path.realpath(os.path.dirname(__file__))
+    except NameError:
+        head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0]))
+
+    error = None
+    while head:
+        partdir = head
+        head, tail = os.path.split(head)
+        if tail == part:
+            # check if "../py/__init__.py" exists
+            checkfile = os.path.join(partdir, os.pardir, 'py', '__init__.py')
+            if not os.path.exists(checkfile):
+                error = "Cannot find %r" % (os.path.normpath(checkfile),)
+            break
+    else:
+        error = "Cannot find the parent directory %r of the path %r" % (
+            partdir, this_dir)
+    if not error:
+        # check for bogus end-of-line style (e.g. files checked out on
+        # Windows and moved to Unix)
+        f = open(__file__.replace('.pyc', '.py'), 'r')
+        data = f.read()
+        f.close()
+        if data.endswith('\r\n') or data.endswith('\r'):
+            error = ("Bad end-of-line style in the .py files. Typically "
+                     "caused by a zip file or a checkout done on Windows and "
+                     "moved to Unix or vice-versa.")
+    if error:
+        raise EnvironmentError("Invalid source tree - bogus checkout! " +
+                               error)
+    
+    pypy_root = os.path.join(head, '')
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
+
+    munged = {}
+    for name, mod in sys.modules.items():
+        if '.' in name:
+            continue
+        fn = getattr(mod, '__file__', None)
+        if not isinstance(fn, str):
+            continue
+        newname = os.path.splitext(os.path.basename(fn))[0]
+        if not newname.startswith(part + '.'):
+            continue
+        path = os.path.join(os.path.dirname(os.path.realpath(fn)), '')
+        if path.startswith(pypy_root) and newname != part:
+            modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep)
+            if newname != '__init__':
+                modpaths.append(newname)
+            modpath = '.'.join(modpaths)
+            if modpath not in sys.modules:
+                munged[modpath] = mod
+
+    for name, mod in munged.iteritems():
+        if name not in sys.modules:
+            sys.modules[name] = mod
+        if '.' in name:
+            prename = name[:name.rfind('.')]
+            postname = name[len(prename)+1:]
+            if prename not in sys.modules:
+                __import__(prename)
+                if not hasattr(sys.modules[prename], postname):
+                    setattr(sys.modules[prename], postname, mod)
+
+    return partdir, this_dir
+
+def __clone():
+    """ clone master version of autopath.py into all subdirs """
+    from os.path import join, walk
+    if not this_dir.endswith(join('pypy','tool')):
+        raise EnvironmentError("can only clone master version "
+                               "'%s'" % join(pypydir, 'tool',_myname))
+
+
+    def sync_walker(arg, dirname, fnames):
+        if _myname in fnames:
+            fn = join(dirname, _myname)
+            f = open(fn, 'rwb+')
+            try:
+                if f.read() == arg:
+                    print "checkok", fn
+                else:
+                    print "syncing", fn
+                    f = open(fn, 'w')
+                    f.write(arg)
+            finally:
+                f.close()
+    s = open(join(pypydir, 'tool', _myname), 'rb').read()
+    walk(pypydir, sync_walker, s)
+
+_myname = 'autopath.py'
+
+# set guaranteed attributes
+
+pypydir, this_dir = __dirinfo('pypy')
+import py
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
+
+if __name__ == '__main__':
+    __clone()

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/intrgen.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/intrgen.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,161 @@
+
+import autopath
+import os
+import os.path
+
+intrinsic_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "src"))
+
+from pypy.translator.avm2.query import ClassDesc
+
+def get_ootype(t, resolved={}):
+    if "=" in t:
+        return get_ootype(t.split("=")[0].strip(), resolved)
+    if t == "*":
+        return ""
+    elif t == "void":
+        return "ootype.Void"
+    elif t == "int":
+        return "ootype.SignedLongLong"
+    elif t == "uint":
+        return "ootype.UnsignedLongLong"
+    elif t == "Boolean":
+        return "ootype.Bool"
+    elif t == "Number":
+        return "ootype.Float"
+    elif t == "String":
+        return "ootype.String"
+    elif t == "Array":
+        return "ootype.List"
+    elif t.startswith("Vector.<"):
+        return get_ootype(t[len("Vector.<"):-1]) + "[]"
+    elif t in ("Object", "Dictionary"):
+        return "ootype.Dict"
+    return resolved.get(t, t)
+
+def parse_file(file):
+    
+    FullName  = ""
+    ShortName = ""
+    BaseType  = ""
+    Package   = ""
+    Resolved  = {}
+    Methods   = []
+    Fields    = []
+    StaticMethods = []
+    StaticFields  = []
+    
+    for line in file:
+        line = line.strip().strip(";")
+        
+        if line.startswith("package "):
+            Package = line[len("package "):].strip("{")
+        
+        elif line.startswith("import "):
+            resolvedname = line[len("import "):]
+            ns, name = resolvedname.rsplit(".", 1)
+            Resolved[name] = resolvedname
+        
+        elif line.startswith("public class "):
+            line = line[len("public class "):].split()
+            ShortName = line[0]
+            if Package:
+                FullName = "%s.%s" % (Package, ShortName)
+            else:
+                FullName = ShortName
+            
+            if line == "extends":
+                BaseType = get_ootype(line[2], Resolved)
+                
+        elif line.startswith(("public function ", "public static function ")):
+            
+            prop = Methods
+            line = line[len("public "):]
+            
+            if "static" in line:
+                line = line[len("static function "):]
+                prop = StaticMethods
+            else:
+                line = line[len("function "):]
+
+            linearr = line.split()
+            
+            name = linearr[0]
+            if name == ShortName:
+                name = "!CONSTRUCTOR!"
+            
+            arglist = line[line.find("(")+1:]
+            if name == "!CONSTRUCTOR!":
+                rettype = None
+            else:
+                rettype = get_ootype(arglist[arglist.rfind(":")+2:], Resolved)
+                
+            args = [arg for arg in arglist[:arglist.find(")")].split(",")]
+            args = [(get_ootype(arg.strip().split(":")[1], Resolved) if ":" in arg else ("*args" if "..." in arg else arg.strip())) for arg in args]
+
+            if name in ("get", "set"):
+                
+                if prop == StaticMethods:
+                    prop = StaticFields
+                else:
+                    prop = Fields
+                    
+                pname = linearr[1]
+                if name == "set":
+                    type = args[0]
+                elif name == "get":
+                    type = rettype
+                    
+                if (pname, type) not in prop:
+                    prop.append((pname, type))
+            else:
+                prop.append((name, args, rettype))
+            
+        elif line.startswith("public static "):
+            line = line.split()
+            if ":" in line:
+                StaticFields.append((line[3], line[5]))
+            else:
+                StaticFields.append(tuple(line[3].split(":")))
+
+    desc = ClassDesc()
+    desc.FullName = FullName
+    desc.BaseType = BaseType
+    desc.Package  = Package
+    desc.Resolved = Resolved
+    desc.Methods  = Methods
+    desc.Fields   = Fields
+    desc.StaticMethods = StaticMethods
+    desc.StaticFields  = StaticFields
+    
+    return desc
+
+def print_desc(desc):
+    print
+    print "desc = ClassDesc()"
+    print "desc.FullName = %r" % desc.FullName
+    print "desc.BaseType = %r" % desc.BaseType
+    print_tuples("Methods", desc.Methods)
+    print_tuples("StaticMethods", desc.StaticMethods)
+    print_tuples("Fields", desc.Fields)
+    print_tuples("StaticFields", desc.StaticFields)
+    print "types['%s'] = desc" % desc.FullName
+    print "del desc"
+
+def print_tuples(varname, L):
+    if len(L):
+        print "desc.%s = [" % varname
+        for t in L:
+            print "  %s," % repr(t)
+        print "]"
+    else:
+        print "desc.%s = []" % varname
+
+print "# This file has been autogenerated by intrgen.py -- DO NOT EDIT"
+print 
+print "from pypy.translator.avm2.query import ClassDesc"
+print 
+print "types = {}"
+
+for path, dirs, files in os.walk(intrinsic_dir):
+    for filename in files:
+        print_desc(parse_file(open(os.path.join(path, filename))))

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/ArgumentError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/ArgumentError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,11 @@
+package
+{
+	/// The ArgumentError class represents an error that occurs when the arguments supplied in a function do not match the arguments defined for that function.
+	public class ArgumentError extends Error
+	{
+		public static const length : int;
+
+		/// Creates an ArgumentError object.
+		public function ArgumentError (message:* = "", id:* = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Array.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Array.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,79 @@
+package
+{
+	/// The Array class lets you access and manipulate arrays.
+	public class Array extends Object
+	{
+		/// Specifies case-insensitive sorting for the Array class sorting methods.
+		public static const CASEINSENSITIVE : uint;
+		/// Specifies descending sorting for the Array class sorting methods.
+		public static const DESCENDING : uint;
+		/// A non-negative integer specifying the number of elements in the array.
+		public static const length : int;
+		/// Specifies numeric (instead of character-string) sorting for the Array class sorting methods.
+		public static const NUMERIC : uint;
+		/// Specifies that a sort returns an array that consists of array indices.
+		public static const RETURNINDEXEDARRAY : uint;
+		/// Specifies the unique sorting requirement for the Array class sorting methods.
+		public static const UNIQUESORT : uint;
+
+		public function get length () : uint;
+		public function set length (newLength:uint) : void;
+
+		/// Lets you create an array that contains the specified elements.
+		public function Array (...rest);
+
+		/// Concatenates the elements specified in the parameters.
+		public function concat (...rest) : Array;
+
+		/// Executes a test function on each item in the array until an item is reached that returns false for the specified function.
+		public function every (callback:Function, thisObject:* = null) : Boolean;
+
+		/// Executes a test function on each item in the array and constructs a new array for all items that return true for the specified function.
+		public function filter (callback:Function, thisObject:* = null) : Array;
+
+		/// Executes a function on each item in the array.
+		public function forEach (callback:Function, thisObject:* = null) : void;
+
+		/// Searches for an item in an array by using strict equality (===) and returns the index position of the item.
+		public function indexOf (searchElement:*, fromIndex:* = 0) : int;
+
+		/// Converts the elements in an array to strings.
+		public function join (sep:* = null) : String;
+
+		/// Searches for an item in an array, working backward from the last item, and returns the index position of the matching item using strict equality (===).
+		public function lastIndexOf (searchElement:*, fromIndex:* = 2147483647) : int;
+
+		/// Executes a function on each item in an array, and constructs a new array of items corresponding to the results of the function on each item in the original array.
+		public function map (callback:Function, thisObject:* = null) : Array;
+
+		/// Removes the last element from an array and returns the value of that element.
+		public function pop () : *;
+
+		/// Adds one or more elements to the end of an array and returns the new length of the array.
+		public function push (...rest) : uint;
+
+		/// Reverses the array in place.
+		public function reverse () : Array;
+
+		/// Removes the first element from an array and returns that element.
+		public function shift () : *;
+
+		/// Returns a new array that consists of a range of elements from the original array.
+		public function slice (startIndex:* = 0, endIndex:* = 16777215) : Array;
+
+		/// Executes a test function on each item in the array until an item is reached that returns true.
+		public function some (callback:Function, thisObject:* = null) : Boolean;
+
+		/// Sorts the elements in an array.
+		public function sort (...rest) : *;
+
+		/// Sorts the elements in an array according to one or more fields in the array.
+		public function sortOn (names:*, options:* = null) : *;
+
+		/// Adds elements to and removes elements from an array.
+		public function splice (startIndex:int, deleteCount:uint, ...rest) : *;
+
+		/// Adds one or more elements to the beginning of an array and returns the new length of the array.
+		public function unshift (...rest) : uint;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Boolean.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Boolean.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package
+{
+	/// A Boolean object is a data type that can have one of two values, either true or false, used for logical operations.
+	public class Boolean extends Object
+	{
+		public static const length : int;
+
+		/// Creates a Boolean object with the specified value.
+		public function Boolean (value:* = null);
+
+		/// Returns the string representation ("true" or "false") of the Boolean object.
+		public function toString () : String;
+
+		/// Returns true if the value of the specified Boolean object is true; false otherwise.
+		public function valueOf () : Boolean;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Class.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Class.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,11 @@
+package
+{
+	public class Class extends Object
+	{
+		public static const length : int;
+
+		public function get prototype () : *;
+
+		public function Class ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Date.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Date.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,209 @@
+package
+{
+	/// The Date class represents date and time information.
+	public class Date extends Object
+	{
+		public static const length : int;
+
+		/// The day of the month (an integer from 1 to 31) specified by a Date object according to local time.
+		public function get date () : Number;
+		public function set date (value:Number) : void;
+
+		/// The day of the month (an integer from 1 to 31) of a Date object according to universal time (UTC).
+		public function get dateUTC () : Number;
+		public function set dateUTC (value:Number) : void;
+
+		/// The day of the week (0 for Sunday, 1 for Monday, and so on) specified by this Date according to local time.
+		public function get day () : Number;
+
+		/// The day of the week (0 for Sunday, 1 for Monday, and so on) of this Date  according to universal time (UTC).
+		public function get dayUTC () : Number;
+
+		/// The full year (a four-digit number, such as 2000) of a Date object according to local time.
+		public function get fullYear () : Number;
+		public function set fullYear (value:Number) : void;
+
+		/// The four-digit year of a Date object according to universal time (UTC).
+		public function get fullYearUTC () : Number;
+		public function set fullYearUTC (value:Number) : void;
+
+		/// The hour (an integer from 0 to 23) of the day portion of a Date object according to local time.
+		public function get hours () : Number;
+		public function set hours (value:Number) : void;
+
+		/// The hour (an integer from 0 to 23) of the day of a Date object according to universal time (UTC).
+		public function get hoursUTC () : Number;
+		public function set hoursUTC (value:Number) : void;
+
+		/// The milliseconds (an integer from 0 to 999) portion of a Date object according to local time.
+		public function get milliseconds () : Number;
+		public function set milliseconds (value:Number) : void;
+
+		/// The milliseconds (an integer from 0 to 999) portion of a Date object according to universal time (UTC).
+		public function get millisecondsUTC () : Number;
+		public function set millisecondsUTC (value:Number) : void;
+
+		/// The minutes (an integer from 0 to 59) portion of a Date object according to local time.
+		public function get minutes () : Number;
+		public function set minutes (value:Number) : void;
+
+		/// The minutes (an integer from 0 to 59) portion of a Date object according to universal time (UTC).
+		public function get minutesUTC () : Number;
+		public function set minutesUTC (value:Number) : void;
+
+		/// The month (0 for January, 1 for February, and so on) portion of a  Date object according to local time.
+		public function get month () : Number;
+		public function set month (value:Number) : void;
+
+		/// The month (0 [January] to 11 [December]) portion of a Date object according to universal time (UTC).
+		public function get monthUTC () : Number;
+		public function set monthUTC (value:Number) : void;
+
+		/// The seconds (an integer from 0 to 59) portion of a Date object according to local time.
+		public function get seconds () : Number;
+		public function set seconds (value:Number) : void;
+
+		/// The seconds (an integer from 0 to 59) portion of a Date object according to universal time (UTC).
+		public function get secondsUTC () : Number;
+		public function set secondsUTC (value:Number) : void;
+
+		/// The number of milliseconds since midnight January 1, 1970, universal time, for a Date object.
+		public function get time () : Number;
+		public function set time (value:Number) : void;
+
+		/// The difference, in minutes, between universal time (UTC) and the computer's local time.
+		public function get timezoneOffset () : Number;
+
+		/// Constructs a new Date object that holds the specified date and time.
+		public function Date (year:* = null, month:* = null, date:* = null, hours:* = null, minutes:* = null, seconds:* = null, ms:* = null);
+
+		/// Returns the day of the month (an integer from 1 to 31) specified by a Date object according to local time.
+		public function getDate () : Number;
+
+		/// Returns the day of the week (0 for Sunday, 1 for Monday, and so on) specified by this Date according to local time.
+		public function getDay () : Number;
+
+		/// Returns the full year (a four-digit number, such as 2000) of a Date object according to local time.
+		public function getFullYear () : Number;
+
+		/// Returns the hour (an integer from 0 to 23) of the day portion of a Date object according to local time.
+		public function getHours () : Number;
+
+		/// Returns the milliseconds (an integer from 0 to 999) portion of a Date object according to local time.
+		public function getMilliseconds () : Number;
+
+		/// Returns the minutes (an integer from 0 to 59) portion of a Date object according to local time.
+		public function getMinutes () : Number;
+
+		/// Returns the month (0 for January, 1 for February, and so on) portion of this  Date according to local time.
+		public function getMonth () : Number;
+
+		/// Returns the seconds (an integer from 0 to 59) portion of a Date object according to local time.
+		public function getSeconds () : Number;
+
+		/// Returns the number of milliseconds since midnight January 1, 1970, universal time, for a Date object.
+		public function getTime () : Number;
+
+		/// Returns the difference, in minutes, between universal time (UTC) and the computer's local time.
+		public function getTimezoneOffset () : Number;
+
+		/// Returns the day of the month (an integer from 1 to 31) of a Date object, according to universal time (UTC).
+		public function getUTCDate () : Number;
+
+		/// Returns the day of the week (0 for Sunday, 1 for Monday, and so on) of this Date  according to universal time (UTC).
+		public function getUTCDay () : Number;
+
+		/// Returns the four-digit year of a Date object according to universal time (UTC).
+		public function getUTCFullYear () : Number;
+
+		/// Returns the hour (an integer from 0 to 23) of the day of a Date object according to universal time (UTC).
+		public function getUTCHours () : Number;
+
+		/// Returns the milliseconds (an integer from 0 to 999) portion of a Date object according to universal time (UTC).
+		public function getUTCMilliseconds () : Number;
+
+		/// Returns the minutes (an integer from 0 to 59) portion of a Date object according to universal time (UTC).
+		public function getUTCMinutes () : Number;
+
+		/// Returns the month (0 [January] to 11 [December]) portion of a Date object according to universal time (UTC).
+		public function getUTCMonth () : Number;
+
+		/// Returns the seconds (an integer from 0 to 59) portion of a Date object according to universal time (UTC).
+		public function getUTCSeconds () : Number;
+
+		/// Converts a string representing a date into a number equaling the number of milliseconds elapsed since January 1, 1970, UTC.
+		public static function parse (s:*) : Number;
+
+		/// Sets the day of the month, according to local time, and returns the new time in milliseconds.
+		public function setDate (date:* = null) : Number;
+
+		/// Sets the year, according to local time, and returns the new time in milliseconds.
+		public function setFullYear (year:* = null, month:* = null, date:* = null) : Number;
+
+		/// Sets the hour, according to local time, and returns the new time in milliseconds.
+		public function setHours (hour:* = null, min:* = null, sec:* = null, ms:* = null) : Number;
+
+		/// Sets the milliseconds, according to local time, and returns the new time in milliseconds.
+		public function setMilliseconds (ms:* = null) : Number;
+
+		/// Sets the minutes, according to local time, and returns the new time in milliseconds.
+		public function setMinutes (min:* = null, sec:* = null, ms:* = null) : Number;
+
+		/// Sets the month and optionally the day of the month, according to local time, and returns the new time in milliseconds.
+		public function setMonth (month:* = null, date:* = null) : Number;
+
+		/// Sets the seconds, according to local time, and returns the new time in milliseconds.
+		public function setSeconds (sec:* = null, ms:* = null) : Number;
+
+		/// Sets the date in milliseconds since midnight on January 1, 1970, and returns the new time in milliseconds.
+		public function setTime (t:* = null) : Number;
+
+		/// Sets the day of the month, in universal time (UTC), and returns the new time in milliseconds.
+		public function setUTCDate (date:* = null) : Number;
+
+		/// Sets the year, in universal time (UTC), and returns the new time in milliseconds.
+		public function setUTCFullYear (year:* = null, month:* = null, date:* = null) : Number;
+
+		/// Sets the hour, in universal time (UTC), and returns the new time in milliseconds.
+		public function setUTCHours (hour:* = null, min:* = null, sec:* = null, ms:* = null) : Number;
+
+		/// Sets the milliseconds, in universal time (UTC), and returns the new time in milliseconds.
+		public function setUTCMilliseconds (ms:* = null) : Number;
+
+		/// Sets the minutes, in universal time (UTC), and returns the new time in milliseconds.
+		public function setUTCMinutes (min:* = null, sec:* = null, ms:* = null) : Number;
+
+		/// Sets the month, and optionally the day, in universal time(UTC) and returns the new time in milliseconds.
+		public function setUTCMonth (month:* = null, date:* = null) : Number;
+
+		/// Sets the seconds, and optionally the milliseconds, in universal time (UTC) and returns the new time in milliseconds.
+		public function setUTCSeconds (sec:* = null, ms:* = null) : Number;
+
+		/// Returns a string representation of the day and date only, and does not include the time or timezone.
+		public function toDateString () : String;
+
+		/// Returns a String representation of the day and date only, and does not include the time or timezone.
+		public function toLocaleDateString () : String;
+
+		/// Returns a String representation of the day, date, time, given in local time.
+		public function toLocaleString () : String;
+
+		/// Returns a String representation of the time only, and does not include the day, date, year, or timezone.
+		public function toLocaleTimeString () : String;
+
+		/// Returns a String representation of the day, date, time, and timezone.
+		public function toString () : String;
+
+		/// Returns a String representation of the time and timezone only, and does not include the day and date.
+		public function toTimeString () : String;
+
+		/// Returns a String representation of the day, date, and time in universal time (UTC).
+		public function toUTCString () : String;
+
+		/// Returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters.
+		public static function UTC (year:*, month:*, date:* = 1, hours:* = 0, minutes:* = 0, seconds:* = 0, ms:* = 0, ...rest) : Number;
+
+		/// Returns the number of milliseconds since midnight January 1, 1970, universal time, for a Date object.
+		public function valueOf () : Number;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/DefinitionError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/DefinitionError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,11 @@
+package
+{
+	/// The DefinitionError class represents an error that occurs when user code attempts to define an identifier that is already defined.
+	public class DefinitionError extends Error
+	{
+		public static const length : int;
+
+		/// Creates a new DefinitionError object.
+		public function DefinitionError (message:* = "", id:* = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Error.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Error.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,25 @@
+package
+{
+	/// The Error class contains information about an error that occurred in a script.
+	public class Error extends Object
+	{
+		public static const length : int;
+		/// Contains the message associated with the Error object.
+		public var message : *;
+		/// Contains the name of the Error object.
+		public var name : *;
+
+		/// Contains the reference number associated with the specific error message.
+		public function get errorID () : int;
+
+		/// Creates a new Error instance with the specified error message.
+		public function Error (message:* = "", id:* = 0);
+
+		public static function getErrorMessage (index:int) : String;
+
+		/// Returns the call stack for an error in a readable form.
+		public function getStackTrace () : String;
+
+		public static function throwError (type:Class, index:uint, ...rest) : *;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/EvalError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/EvalError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,11 @@
+package
+{
+	/// The EvalError class represents an error that occurs when user code calls the eval() function or attempts to use the new operator with the Function object.
+	public class EvalError extends Error
+	{
+		public static const length : int;
+
+		/// Creates a new EvalError object.
+		public function EvalError (message:* = "", id:* = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Function.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Function.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,21 @@
+package
+{
+	/// A function is the basic unit of code that can be invoked in ActionScript.
+	public class Function extends Object
+	{
+		public static const length : int;
+
+		public function get length () : int;
+
+		public function get prototype () : *;
+		public function set prototype (p:*) : void;
+
+		/// Specifies the object instance on which the Function is called.
+		public function apply (thisArg:* = null, argArray:* = null) : *;
+
+		/// Invokes this Function.
+		public function call (thisArg:* = null, ...rest) : *;
+
+		public function Function ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Math.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Math.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,79 @@
+package
+{
+	/// The Math class contains methods and constants that represent common mathematical functions and values.
+	public class Math extends Object
+	{
+		/// A mathematical constant for the base of natural logarithms, expressed as e.
+		public static const E : Number;
+		/// A mathematical constant for the natural logarithm of 10, expressed as loge10, with an approximate value of 2.302585092994046.
+		public static const LN10 : Number;
+		/// A mathematical constant for the natural logarithm of 2, expressed as loge2, with an approximate value of 0.6931471805599453.
+		public static const LN2 : Number;
+		/// A mathematical constant for the base-10 logarithm of the constant e (Math.E), expressed as log10e, with an approximate value of 0.4342944819032518.
+		public static const LOG10E : Number;
+		/// A mathematical constant for the base-2 logarithm of the constant e, expressed as log2e, with an approximate value of 1.442695040888963387.
+		public static const LOG2E : Number;
+		/// A mathematical constant for the ratio of the circumference of a circle to its diameter, expressed as pi, with a value of 3.141592653589793.
+		public static const PI : Number;
+		/// A mathematical constant for the square root of one-half, with an approximate value of 0.7071067811865476.
+		public static const SQRT1_2 : Number;
+		/// A mathematical constant for the square root of 2, with an approximate value of 1.4142135623730951.
+		public static const SQRT2 : Number;
+
+		/// Returns the absolute value of the specified Number.
+		public static function abs (x:Number) : Number;
+
+		/// Returns the arc cosine, in radians, of the specified Number.
+		public static function acos (x:Number) : Number;
+
+		/// Returns the value, in radians, of the arc sine of the specified Number parameter.
+		public static function asin (x:Number) : Number;
+
+		/// Returns the angle, in radians, whose tangent is specified by parameter val.
+		public static function atan (x:Number) : Number;
+
+		/// Returns the angle of the point y/x in radians, when measured counterclockwise from a circle's x axis.
+		public static function atan2 (y:Number, x:Number) : Number;
+
+		/// Returns the ceiling of the specified number or expression.
+		public static function ceil (x:Number) : Number;
+
+		/// Returns the cosine of the specified angle.
+		public static function cos (x:Number) : Number;
+
+		/// Returns the value of the base of the natural logarithm (e), to the power of the exponent specified in the parameter val.
+		public static function exp (x:Number) : Number;
+
+		/// Returns the floor of the number or expression specified in the parameter val.
+		public static function floor (x:Number) : Number;
+
+		/// Returns the natural logarithm of parameter val.
+		public static function log (x:Number) : Number;
+
+		public function Math ();
+
+		/// Evaluates parameters val1 and val2 and returns the larger value.
+		public static function max (x:Number = null, y:Number = null, ...rest) : Number;
+
+		/// Evaluates parameters val1 and val2 and returns the smaller value.
+		public static function min (x:Number = null, y:Number = null, ...rest) : Number;
+
+		/// Returns val1 to the power of val2.
+		public static function pow (x:Number, y:Number) : Number;
+
+		/// Returns a pseudo-random number n, where 0 <= n < 1.
+		public static function random () : Number;
+
+		/// Returns the value of parameter val rounded up or down to the nearest integer.
+		public static function round (x:Number) : Number;
+
+		/// Returns the sine of the specified angle.
+		public static function sin (x:Number) : Number;
+
+		/// Returns the square root of the specified number.
+		public static function sqrt (x:Number) : Number;
+
+		/// Returns the tangent of the specified angle.
+		public static function tan (x:Number) : Number;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Namespace.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Namespace.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,23 @@
+package
+{
+	/// The Namespace class contains methods and properties for defining and working with namespaces.
+	public class Namespace extends Object
+	{
+		public static const length : *;
+
+		/// The prefix of the namespace.
+		public function get prefix () : *;
+
+		/// The Uniform Resource Identifier (URI) of the namespace.
+		public function get uri () : String;
+
+		/// Creates a Namespace object, given the prefixValue and uriValue.
+		public function Namespace (prefix:* = null, uri:* = null);
+
+		/// Equivalent to the Namespace.uri property.
+		public function toString () : String;
+
+		/// Equivalent to the Namespace.uri property.
+		public function valueOf () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Number.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Number.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,36 @@
+package
+{
+	/// A data type representing an IEEE-754 double-precision floating-point number.
+	public class Number extends Object
+	{
+		public static const length : int;
+		/// The largest representable number (double-precision IEEE-754).
+		public static const MAX_VALUE : Number;
+		/// The smallest representable non-negative, non-zero, number (double-precision IEEE-754).
+		public static const MIN_VALUE : Number;
+		/// The IEEE-754 value representing Not a Number (NaN).
+		public static const NaN : Number;
+		/// Specifies the IEEE-754 value representing negative infinity.
+		public static const NEGATIVE_INFINITY : Number;
+		/// Specifies the IEEE-754 value representing positive infinity.
+		public static const POSITIVE_INFINITY : Number;
+
+		/// Creates a Number with the specified value.
+		public function Number (value:* = 0);
+
+		/// Returns a string representation of the number in exponential notation.
+		public function toExponential (p:* = 0) : String;
+
+		/// Returns a string representation of the number in fixed-point notation.
+		public function toFixed (p:* = 0) : String;
+
+		/// Returns a string representation of the number either in exponential notation or in fixed-point notation.
+		public function toPrecision (p:* = 0) : String;
+
+		/// Returns the string representation of this Number using the specified radix parameter as the numeric base.
+		public function toString (radix:* = 10) : String;
+
+		/// Returns the primitive value type of the specified Number object.
+		public function valueOf () : Number;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Object.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Object.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,24 @@
+package
+{
+	/// The Object class is at the root of the ActionScript class hierarchy.
+	public class Object extends *
+	{
+		/// Indicates whether an object has a specified property defined.
+		public function hasOwnProperty (V:* = null) : Boolean;
+
+		/// Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
+		public function isPrototypeOf (V:* = null) : Boolean;
+
+		/// Creates an Object object and stores a reference to the object's constructor method in the object's constructor property.
+		public function Object ();
+
+		/// Indicates whether the specified property exists and is enumerable.
+		public function propertyIsEnumerable (V:* = null) : Boolean;
+
+		public function toString () : String;
+
+		public function valueOf () : Object;
+
+		public function setPropertyIsEnumerable (name:String, isEnum:Boolean = true) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/QName.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/QName.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,23 @@
+package
+{
+	/// QName objects represent qualified names of XML elements and attributes.
+	public class QName extends Object
+	{
+		public static const length : *;
+
+		/// The local name of the QName object.
+		public function get localName () : String;
+
+		/// The Uniform Resource Identifier (URI) of the QName object.
+		public function get uri () : *;
+
+		/// Creates a QName object that is a copy of another QName object.
+		public function QName (namespace:* = null, name:* = null);
+
+		/// Returns a string composed of the URI, and the local name for the QName object, separated by "::".
+		public function toString () : String;
+
+		/// Returns the QName object.
+		public function valueOf () : QName;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/RangeError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/RangeError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,11 @@
+package
+{
+	/// A RangeError exception is thrown when a numeric value is outside the acceptable range.
+	public class RangeError extends Error
+	{
+		public static const length : int;
+
+		/// Creates a new RangeError object.
+		public function RangeError (message:* = "", id:* = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/ReferenceError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/ReferenceError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,11 @@
+package
+{
+	/// A ReferenceError exception is thrown when a reference to an undefined property is attempted on a sealed (nondynamic) object.
+	public class ReferenceError extends Error
+	{
+		public static const length : int;
+
+		/// Creates a new ReferenceError object.
+		public function ReferenceError (message:* = "", id:* = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/RegExp.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/RegExp.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,39 @@
+package
+{
+	/// The RegExp class lets you work with regular expressions, which are patterns that you can use to perform searches in strings and to replace text in strings.
+	public class RegExp extends Object
+	{
+		public static const length : int;
+
+		/// Specifies whether the dot character (.) in a regular expression pattern matches new-line characters.
+		public function get dotall () : Boolean;
+
+		/// Specifies whether to use extended mode for the regular expression.
+		public function get extended () : Boolean;
+
+		/// Specifies whether to use global matching for the regular expression.
+		public function get global () : Boolean;
+
+		/// Specifies whether the regular expression ignores case sensitivity.
+		public function get ignoreCase () : Boolean;
+
+		/// Specifies the index position in the string at which to start the next search.
+		public function get lastIndex () : int;
+		public function set lastIndex (i:int) : void;
+
+		/// Specifies whether the m (multiline) flag is set.
+		public function get multiline () : Boolean;
+
+		/// Specifies the pattern portion of the regular expression.
+		public function get source () : String;
+
+		/// Performs a search for the regular expression on the given string str.
+		public function exec (s:String = "") : *;
+
+		/// Lets you construct a regular expression from two strings.
+		public function RegExp (pattern:* = null, options:* = null);
+
+		/// Tests for the match of the regular expression in the given string str.
+		public function test (s:String = "") : Boolean;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/SecurityError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/SecurityError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,11 @@
+package
+{
+	/// The SecurityError exception is thrown when some type of security violation takes place.
+	public class SecurityError extends Error
+	{
+		public static const length : int;
+
+		/// Creates a new SecurityError object.
+		public function SecurityError (message:* = "", id:* = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/String.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/String.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,73 @@
+package
+{
+	/// The String class is a data type that represents a string of characters.
+	public class String extends Object
+	{
+		/// An integer specifying the number of characters in the specified String object.
+		public static const length : int;
+
+		public function get length () : int;
+
+		/// Returns the character in the position specified by the index parameter.
+		public function charAt (i:Number = 0) : String;
+
+		/// Returns the numeric Unicode character code of the character at the specified index.
+		public function charCodeAt (i:Number = 0) : Number;
+
+		/// Appends the supplied arguments to the end of the String object, converting them to strings if necessary, and returns the resulting string.
+		public function concat (...rest) : String;
+
+		/// Returns a string comprising the characters represented by the Unicode character codes in the parameters.
+		public static function fromCharCode (...rest) : String;
+
+		/// Searches the string and returns the position of the first occurrence of val found at or after startIndex within the calling string.
+		public function indexOf (s:String = undefined, i:Number = 0) : int;
+
+		/// Searches the string from right to left and returns the index of the last occurrence of val found before startIndex.
+		public function lastIndexOf (s:String = undefined, i:Number = 2147483647) : int;
+
+		/// Compares the sort order of two or more strings and returns the result of the comparison as an integer.
+		public function localeCompare (other:String = null) : int;
+
+		/// Matches the specifed pattern against the string.
+		public function match (p:* = null) : Array;
+
+		/// Matches the specifed pattern against the string and returns a new string in which the first match of pattern is replaced with the content specified by repl.
+		public function replace (p:* = null, repl:* = null) : String;
+
+		/// Searches for the specifed pattern and returns the index of the first matching substring.
+		public function search (p:* = null) : int;
+
+		/// Returns a string that includes the startIndex character and all characters up to, but not including, the endIndex character.
+		public function slice (start:Number = 0, end:Number = 2147483647) : String;
+
+		/// Splits a String object into an array of substrings by dividing it wherever the specified delimiter parameter occurs.
+		public function split (delim:* = null, limit:* = 4294967295) : Array;
+
+		/// Creates a new String object initialized to the specified string.
+		public function String (value:* = "");
+
+		/// Returns a substring consisting of the characters that start at the specified  startIndex and with a length specified by len.
+		public function substr (start:Number = 0, len:Number = 2147483647) : String;
+
+		/// Returns a string consisting of the character specified by startIndex and all characters up to endIndex - 1.
+		public function substring (start:Number = 0, end:Number = 2147483647) : String;
+
+		/// Returns a copy of this string, with all uppercase characters converted to lowercase.
+		public function toLocaleLowerCase () : String;
+
+		/// Returns a copy of this string, with all lowercase characters converted to uppercase.
+		public function toLocaleUpperCase () : String;
+
+		/// Returns a copy of this string, with all uppercase characters converted to lowercase.
+		public function toLowerCase () : String;
+
+		public function toString () : String;
+
+		/// Returns a copy of this string, with all lowercase characters converted to uppercase.
+		public function toUpperCase () : String;
+
+		/// Returns the primitive value of a String instance.
+		public function valueOf () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/SyntaxError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/SyntaxError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,11 @@
+package
+{
+	/// A SyntaxError exception is thrown when a parsing error occurs, for one of the following reasons:.
+	public class SyntaxError extends Error
+	{
+		public static const length : int;
+
+		/// Creates a new SyntaxError object.
+		public function SyntaxError (message:* = "", id:* = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/TypeError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/TypeError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,11 @@
+package
+{
+	/// A TypeError exception is thrown when the actual type of an operand is different from the expected type.
+	public class TypeError extends Error
+	{
+		public static const length : int;
+
+		/// Creates a new TypeError object.
+		public function TypeError (message:* = "", id:* = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/URIError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/URIError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,11 @@
+package
+{
+	/// A URIError exception is thrown when one of the global URI handling functions is used in a way that is incompatible with its definition.
+	public class URIError extends Error
+	{
+		public static const length : int;
+
+		/// Creates a new URIError object.
+		public function URIError (message:* = "", id:* = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/UninitializedError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/UninitializedError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,9 @@
+package
+{
+	public class UninitializedError extends Error
+	{
+		public static const length : int;
+
+		public function UninitializedError (message:* = "", id:* = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Vector.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/Vector.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,75 @@
+package 
+{
+	/// The Vector class lets you access and manipulate a vector - an array whose elements all have the same data type.
+	public class Vector.<T>
+	{
+		/// The range of valid indices available in the Vector.
+		public var length:int;
+
+		/// Indicates whether the length property of the Vector can be changed.
+		public var fixed:Boolean;
+
+		/// [FP10] Creates a Vector with the specified base type.
+		public function Vector (length:uint = 0, fixed:Boolean = false);
+
+		/// [FP10] Concatenates the elements specified in the parameters.
+		public function concat (...args) : Vector.<T>;
+
+		/// [FP10] Executes a test function on each item in the Vector until an item is reached that returns false for the specified function.
+		public function every (callback:Function, thisObject:Object = null) : Boolean;
+
+		/// [FP10] Executes a test function on each item in the Vector and returns a new Vector containing all items that return true for the specified function.
+		public function filter (callback:Function, thisObject:Object = null) : Vector.<T>;
+
+		/// [FP10] Executes a function on each item in the Vector.
+		public function forEach (callback:Function, thisObject:Object = null) : void;
+
+		/// [FP10] Searches for an item in the Vector and returns the index position of the item.
+		public function indexOf (searchElement:T, fromIndex:int = 0) : int;
+
+		/// [FP10] Converts the elements in the Vector to strings.
+		public function join (sep:String = ",") : String;
+
+		/// [FP10] Searches for an item in the Vector, working backward from the specified index position, and returns the index position of the matching item.
+		public function lastIndexOf (searchElement:T, fromIndex:int = 0x7fffffff) : int;
+
+		/// [FP10] Executes a function on each item in the Vector, and returns a new Vector of items corresponding to the results of calling the function on each item in this Vector.
+		public function map (callback:Function, thisObject:Object = null) : Vector.<T>;
+
+		/// [FP10] Removes the last element from the Vector and returns that element.
+		public function pop () : T;
+
+		/// [FP10] Adds one or more elements to the end of the Vector and returns the new length of the Vector.
+		public function push (...args) : uint;
+
+		/// [FP10] Reverses the order of the elements in the Vector.
+		public function reverse () : Vector.<T>;
+
+		/// [FP10] Removes the first element from the Vector and returns that element.
+		public function shift () : T;
+
+		/// [FP10] Returns a new Vector that consists of a range of elements from the original Vector.
+		public function slice (startIndex:int = 0, endIndex:int = 16777215) : Vector.<T>;
+
+		/// [FP10] Executes a test function on each item in the Vector until an item is reached that returns true.
+		public function some (callback:Function, thisObject:Object = null) : Boolean;
+
+		/// [FP10] Sorts the elements in the Vector.
+		public function sort (compareFunction:Function) : Vector.<T>;
+
+		/// [FP10] Adds elements to and removes elements from the Vector.
+		public function splice (startIndex:int, deleteCount:uint, ...items) : Vector.<T>;
+
+		/// [FP10] Returns a string that represents the elements in the Vector.
+		public function toString () : String;
+
+		/// [FP10] Returns a string that represents the elements in the specified Vector.
+		public function toLocaleString () : String;
+
+		/// [FP10] Adds one or more elements to the beginning of the Vector and returns the new length of the Vector.
+		public function unshift (...args) : uint;
+
+	}
+
+}
+

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/VerifyError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/VerifyError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,11 @@
+package
+{
+	/// The VerifyError class represents an error that occurs when a malformed or corrupted SWF file is encountered.
+	public class VerifyError extends Error
+	{
+		public static const length : int;
+
+		/// Creates a new VerifyError object.
+		public function VerifyError (message:* = "", id:* = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/XML.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/XML.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,161 @@
+package
+{
+	/// The XML class contains methods and properties for working with XML objects.
+	public class XML extends Object
+	{
+		/// For XML objects, this method always returns the integer 1.
+		public static const length : *;
+
+		/// Determines whether XML comments are ignored when XML objects parse the source XML data.
+		public static function get ignoreComments () : Boolean;
+		public static function set ignoreComments (newIgnore:Boolean) : void;
+
+		/// Determines whether XML processing instructions are ignored when XML objects parse the source XML data.
+		public static function get ignoreProcessingInstructions () : Boolean;
+		public static function set ignoreProcessingInstructions (newIgnore:Boolean) : void;
+
+		/// Determines whether white space characters at the beginning and end of text nodes are ignored during parsing.
+		public static function get ignoreWhitespace () : Boolean;
+		public static function set ignoreWhitespace (newIgnore:Boolean) : void;
+
+		/// Determines the amount of indentation applied by the toString() and toXMLString() methods when the XML.prettyPrinting property is set to true.
+		public static function get prettyIndent () : int;
+		public static function set prettyIndent (newIndent:int) : void;
+
+		/// Determines whether the toString() and toXMLString() methods normalize white space characters between some tags.
+		public static function get prettyPrinting () : Boolean;
+		public static function set prettyPrinting (newPretty:Boolean) : void;
+
+		/// Adds a namespace to the set of in-scope namespaces for the XML object.
+		public function addNamespace (ns:*) : XML;
+
+		/// Appends the given child to the end of the XML object's properties.
+		public function appendChild (child:*) : XML;
+
+		/// Returns the XML value of the attribute that has the name matching the attributeName parameter.
+		public function attribute (arg:*) : XMLList;
+
+		/// Returns a list of attribute values for the given XML object.
+		public function attributes () : XMLList;
+
+		/// Lists the children of an XML object.
+		public function child (propertyName:*) : XMLList;
+
+		/// Identifies the zero-indexed position of this XML object within the context of its parent.
+		public function childIndex () : int;
+
+		/// Lists the children of the XML object in the sequence in which they appear.
+		public function children () : XMLList;
+
+		/// Lists the properties of the XML object that contain XML comments.
+		public function comments () : XMLList;
+
+		/// Compares the XML object against the given value parameter.
+		public function contains (value:*) : Boolean;
+
+		/// Returns a copy of the given XML object.
+		public function copy () : XML;
+
+		/// Returns an object with the following properties set to the default values: ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, and prettyPrinting.
+		public static function defaultSettings () : Object;
+
+		/// Returns all descendants (children, grandchildren, great-grandchildren, and so on) of the XML object that have the given name parameter.
+		public function descendants (name:* = "*") : XMLList;
+
+		/// Lists the elements of an XML object.
+		public function elements (name:* = "*") : XMLList;
+
+		/// Checks to see whether the XML object contains complex content.
+		public function hasComplexContent () : Boolean;
+
+		/// Checks to see whether the object has the property specified by the p parameter.
+		public function hasOwnProperty (P:* = null) : Boolean;
+
+		/// Checks to see whether the XML object contains simple content.
+		public function hasSimpleContent () : Boolean;
+
+		/// Lists the namespaces for the XML object, based on the object's parent.
+		public function inScopeNamespaces () : Array;
+
+		/// Inserts the given child2 parameter after the child1 parameter in this XML object and returns the resulting object.
+		public function insertChildAfter (child1:*, child2:*) : *;
+
+		/// Inserts the given child2 parameter before the child1 parameter in this XML object and returns the resulting object.
+		public function insertChildBefore (child1:*, child2:*) : *;
+
+		public function length () : int;
+
+		/// Gives the local name portion of the qualified name of the XML object.
+		public function localName () : Object;
+
+		/// Gives the qualified name for the XML object.
+		public function name () : Object;
+
+		/// If no parameter is provided, gives the namespace associated with the qualified name of this XML object.
+		public function namespace (prefix:* = null) : *;
+
+		/// Lists namespace declarations associated with the XML object in the context of its parent.
+		public function namespaceDeclarations () : Array;
+
+		/// Specifies the type of node: text, comment, processing-instruction, attribute, or element.
+		public function nodeKind () : String;
+
+		/// For the XML object and all descendant XML objects, merges adjacent text nodes and eliminates empty text nodes.
+		public function normalize () : XML;
+
+		public function notification () : Function;
+
+		/// Returns the parent of the XML object.
+		public function parent () : *;
+
+		/// Inserts a copy of the provided child object into the XML element before any existing XML properties for that element.
+		public function prependChild (value:*) : XML;
+
+		/// If a name parameter is provided, lists all the children of the XML object that contain processing instructions with that name.
+		public function processingInstructions (name:* = "*") : XMLList;
+
+		/// Checks whether the property p is in the set of properties that can be iterated in a for..in statement applied to the XML object.
+		public function propertyIsEnumerable (P:* = null) : Boolean;
+
+		/// Removes the given namespace for this object and all descendants.
+		public function removeNamespace (ns:*) : XML;
+
+		/// Replaces the properties specified by the propertyName parameter with the given value parameter.
+		public function replace (propertyName:*, value:*) : XML;
+
+		/// Replaces the child properties of the XML object with the specified set of XML properties, provided in the value parameter.
+		public function setChildren (value:*) : XML;
+
+		/// Changes the local name of the XML object to the given name parameter.
+		public function setLocalName (name:*) : void;
+
+		/// Sets the name of the XML object to the given qualified name or attribute name.
+		public function setName (name:*) : void;
+
+		/// Sets the namespace associated with the XML object.
+		public function setNamespace (ns:*) : void;
+
+		public function setNotification (f:Function) : *;
+
+		/// Sets values for the following XML properties: ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, and prettyPrinting.
+		public static function setSettings (o:Object = null) : void;
+
+		/// Retrieves the following properties: ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, and prettyPrinting.
+		public static function settings () : Object;
+
+		/// Returns an XMLList object of all XML properties of the XML object that represent XML text nodes.
+		public function text () : XMLList;
+
+		/// Returns a string representation of the XML object.
+		public function toString () : String;
+
+		/// Returns a string representation of the XML object.
+		public function toXMLString () : String;
+
+		/// Returns the XML object.
+		public function valueOf () : XML;
+
+		/// Creates a new XML object.
+		public function XML (value:* = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/XMLList.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/XMLList.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,110 @@
+package
+{
+	/// The XMLList class contains methods for working with one or more XML elements.
+	public class XMLList extends Object
+	{
+		/// Returns the number of properties in the XMLList object.
+		public static const length : *;
+
+		public function addNamespace (ns:*) : XML;
+
+		public function appendChild (child:*) : XML;
+
+		/// Calls the attribute() method of each XML object and returns an XMLList object of the results.
+		public function attribute (arg:*) : XMLList;
+
+		/// Calls the attributes() method of each XML object and returns an XMLList object of attributes for each XML object.
+		public function attributes () : XMLList;
+
+		/// Calls the child() method of each XML object and returns an XMLList object that contains the results in order.
+		public function child (propertyName:*) : XMLList;
+
+		public function childIndex () : int;
+
+		/// Calls the children() method of each XML object and returns an XMLList object that contains the results.
+		public function children () : XMLList;
+
+		/// Calls the comments() method of each XML object and returns an XMLList of comments.
+		public function comments () : XMLList;
+
+		/// Checks whether the XMLList object contains an XML object that is equal to the given value parameter.
+		public function contains (value:*) : Boolean;
+
+		/// Returns a copy of the given XMLList object.
+		public function copy () : XMLList;
+
+		/// Returns all descendants (children, grandchildren, great-grandchildren, and so on) of the XML object that have the given name parameter.
+		public function descendants (name:* = "*") : XMLList;
+
+		/// Calls the elements() method of each XML object.
+		public function elements (name:* = "*") : XMLList;
+
+		/// Checks whether the XMLList object contains complex content.
+		public function hasComplexContent () : Boolean;
+
+		/// Checks for the property specified by p.
+		public function hasOwnProperty (P:* = null) : Boolean;
+
+		/// Checks whether the XMLList object contains simple content.
+		public function hasSimpleContent () : Boolean;
+
+		public function inScopeNamespaces () : Array;
+
+		public function insertChildAfter (child1:*, child2:*) : *;
+
+		public function insertChildBefore (child1:*, child2:*) : *;
+
+		public function length () : int;
+
+		public function localName () : Object;
+
+		public function name () : Object;
+
+		public function namespace (prefix:* = null) : *;
+
+		public function namespaceDeclarations () : Array;
+
+		public function nodeKind () : String;
+
+		/// Merges adjacent text nodes and eliminates empty text nodes for each of the following: all text nodes in the XMLList, all the XML objects contained in the XMLList, and the descendants of all the XML objects in the XMLList.
+		public function normalize () : XMLList;
+
+		/// Returns the parent of the XMLList object if all items in the XMLList object have the same parent.
+		public function parent () : *;
+
+		public function prependChild (value:*) : XML;
+
+		/// If a name parameter is provided, lists all the children of the XMLList object that contain processing instructions with that name.
+		public function processingInstructions (name:* = "*") : XMLList;
+
+		/// Checks whether the property p is in the set of properties that can be iterated in a for..in statement applied to the XMLList object.
+		public function propertyIsEnumerable (P:* = null) : Boolean;
+
+		public function removeNamespace (ns:*) : XML;
+
+		public function replace (propertyName:*, value:*) : XML;
+
+		public function setChildren (value:*) : XML;
+
+		public function setLocalName (name:*) : void;
+
+		public function setName (name:*) : void;
+
+		public function setNamespace (ns:*) : void;
+
+		/// Calls the text() method of each XML object and returns an XMLList object that contains the results.
+		public function text () : XMLList;
+
+		/// Returns a string representation of all the XML objects in an XMLList object.
+		public function toString () : String;
+
+		/// Returns a string representation of all the XML objects in an XMLList object.
+		public function toXMLString () : String;
+
+		/// Returns the XMLList object.
+		public function valueOf () : XMLList;
+
+		/// Creates a new XMLList object.
+		public function XMLList (value:* = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/adobe/utils/CustomActions.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/adobe/utils/CustomActions.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,20 @@
+package adobe.utils
+{
+	/// The methods of the CustomActions class allow a SWF file playing in the Flash authoring tool to manage any custom actions that are registered with the authoring tool.
+	public class CustomActions extends Object
+	{
+		/// Returns an Array object containing the names of all the custom actions that are registered with the Flash authoring tool.
+		public static function get actionsList () : Array;
+
+		public function CustomActions ();
+
+		/// Reads the contents of the custom action XML definition file named name.
+		public static function getActions (name:String) : String;
+
+		/// Installs a new custom action XML definition file indicated by the name parameter.
+		public static function installActions (name:String, data:String) : void;
+
+		/// Removes the Custom Actions XML definition file named name.
+		public static function uninstallActions (name:String) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/adobe/utils/ProductManager.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/adobe/utils/ProductManager.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,19 @@
+package adobe.utils
+{
+	import flash.events.EventDispatcher;
+
+	public class ProductManager extends EventDispatcher
+	{
+		public function get installed () : Boolean;
+
+		public function get installedVersion () : String;
+
+		public function get running () : Boolean;
+
+		public function download (caption:String = null, fileName:String = null, pathElements:Array = null) : Boolean;
+
+		public function launch (parameters:String = null) : Boolean;
+
+		public function ProductManager (name:String);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/adobe/utils/XMLUI.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/adobe/utils/XMLUI.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,20 @@
+package adobe.utils
+{
+	/// The XMLUI class enables communication with SWF files that are used as custom user interfaces for the Flash authoring tool's extensibility features.
+	public class XMLUI extends Object
+	{
+		/// Makes the current XMLUI dialog box close with an "accept" state.
+		public static function accept () : void;
+
+		/// Makes the current XMLUI dialog box close with a "cancel" state.
+		public static function cancel () : void;
+
+		/// Retrieves the value of the specified property of the current XMLUI dialog box.
+		public static function getProperty (name:String) : String;
+
+		/// Modifies the value of the specified property of the current XMLUI dialog.
+		public static function setProperty (name:String, value:String) : void;
+
+		public function XMLUI ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/adobe/utils/package.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/adobe/utils/package.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,10 @@
+package adobe.utils
+{
+	/// Lets you issue Flash JavaScript API (JSAPI) commands from ActionScript.
+	public function MMExecute (name:String) : String;
+
+	/// [FP10] Notifies an application hosting a SWF command that a command is done and instructs the application to commit or discard the changes submitted by the MMExecute() command.
+	public function MMEndCommand (endStatus:Boolean, notifyString:String) : void;
+
+}
+

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/arguments.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/arguments.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package 
+{
+	/// Context of the executing function.
+	public class arguments 
+	{
+		/// A reference to the currently executing function.
+		public static var callee:Function;
+		
+		/// The number of arguments passed to the function.
+		public static var length:Number;
+	}
+	
+}
\ No newline at end of file

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/authoring/authObject.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/authoring/authObject.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,85 @@
+package authoring
+{
+	import authoring.authObject;
+	import flash.geom.Rectangle;
+	import flash.geom.ColorTransform;
+	import flash.geom.Point;
+	import flash.geom.Matrix3D;
+	import flash.geom.Matrix;
+
+	public class authObject extends Object
+	{
+		public function get FirstChild () : authObject;
+
+		public function get Key () : uint;
+
+		public function get NextSibling () : authObject;
+
+		public static function get offScreenSurfaceRenderingEnabled () : Boolean;
+		public static function set offScreenSurfaceRenderingEnabled (value:Boolean) : void;
+
+		public function get SwfKey () : uint;
+
+		public function get Type () : uint;
+
+		public function authObject (key:uint);
+
+		public function BlendingMode () : String;
+
+		public function Bounds (flags:uint, minFrame:int = -16000, maxFrame:int = 16000) : Rectangle;
+
+		public function CacheAsBitmap () : Boolean;
+
+		public function CenterPoint () : Point;
+
+		public function ColorXForm () : ColorTransform;
+
+		public function EndPosition () : int;
+
+		public function Filters () : Array;
+
+		public function FrameForFrameNumber (frameNum:int) : authObject;
+
+		public function FrameOffset () : int;
+
+		public function FrameType () : uint;
+
+		public function HasEmptyPath () : Boolean;
+
+		public function HasShapeSelection () : Boolean;
+
+		public function IsFloater () : Boolean;
+
+		public function IsPrimitive () : Boolean;
+
+		public function IsSelected () : Boolean;
+
+		public function IsVisible (inThumbnailPreview:Boolean) : Boolean;
+
+		public function LivePreviewSize () : Point;
+
+		public function Locked () : Boolean;
+
+		public function MotionPath () : authObject;
+
+		public function ObjMatrix () : Matrix;
+
+		public function OutlineColor () : uint;
+
+		public function OutlineMode () : Boolean;
+
+		public function RegistrationPoint () : Point;
+
+		public function Scale9Grid () : Rectangle;
+
+		public function StartPosition () : int;
+
+		public function SymbolBehavior () : int;
+
+		public function SymbolMode () : int;
+
+		public function ThreeDMatrix () : Matrix3D;
+
+		public function ThreeDTranslationHandlePoints () : Array;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/accessibility/Accessibility.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/accessibility/Accessibility.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,18 @@
+package flash.accessibility
+{
+	import flash.display.DisplayObject;
+
+	/// The Accessibility class manages communication with screen readers.
+	public class Accessibility extends Object
+	{
+		/// Indicates whether a screen reader is currently active and the player is communicating with it.
+		public static function get active () : Boolean;
+
+		public function Accessibility ();
+
+		public static function sendEvent (source:DisplayObject, childID:uint, eventType:uint, nonHTML:Boolean = false) : void;
+
+		/// Tells Flash Player to apply any accessibility changes made by using the DisplayObject.accessibilityProperties property.
+		public static function updateProperties () : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/accessibility/AccessibilityImplementation.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/accessibility/AccessibilityImplementation.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,36 @@
+package flash.accessibility
+{
+	import flash.geom.Rectangle;
+
+	public class AccessibilityImplementation extends Object
+	{
+		public var errno : uint;
+		public var stub : Boolean;
+
+		public function accDoDefaultAction (childID:uint) : void;
+
+		public function AccessibilityImplementation ();
+
+		public function accLocation (childID:uint) : *;
+
+		public function accSelect (operation:uint, childID:uint) : void;
+
+		public function get_accDefaultAction (childID:uint) : String;
+
+		public function get_accFocus () : uint;
+
+		public function get_accName (childID:uint) : String;
+
+		public function get_accRole (childID:uint) : uint;
+
+		public function get_accSelection () : Array;
+
+		public function get_accState (childID:uint) : uint;
+
+		public function get_accValue (childID:uint) : String;
+
+		public function getChildIDArray () : Array;
+
+		public function isLabeledBy (labelBounds:Rectangle) : Boolean;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/accessibility/AccessibilityProperties.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/accessibility/AccessibilityProperties.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,22 @@
+package flash.accessibility
+{
+	/// The AccessibilityProperties class lets you control the presentation of Flash objects to accessibility aids, such as screen readers.
+	public class AccessibilityProperties extends Object
+	{
+		/// Provides a description for this display object in the accessible presentation.
+		public var description : String;
+		/// If true, causes Flash Player to exclude child objects within this display object from the accessible presentation.
+		public var forceSimple : Boolean;
+		/// Provides a name for this display object in the accessible presentation.
+		public var name : String;
+		/// If true, disables the Flash Player default auto-labeling system.
+		public var noAutoLabeling : Boolean;
+		/// Indicates a keyboard shortcut associated with this display object.
+		public var shortcut : String;
+		/// If true, excludes this display object from accessible presentation.
+		public var silent : Boolean;
+
+		/// Creates a new AccessibilityProperties object.
+		public function AccessibilityProperties ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/desktop/Clipboard.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/desktop/Clipboard.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,37 @@
+package flash.desktop
+{
+	import flash.utils.Dictionary;
+	import flash.desktop.Clipboard;
+	import flash.utils.ByteArray;
+
+	/// The Clipboard class provides a container for transferring data and objects through the clipboard and through drag-and-drop operations (AIR only).
+	public class Clipboard extends Object
+	{
+		/// An array of strings containing the names of the data formats available in this Clipboard object.
+		public function get formats () : Array;
+
+		/// The operating system clipboard.
+		public static function get generalClipboard () : Clipboard;
+
+		/// Deletes all data representations from this Clipboard object.
+		public function clear () : void;
+
+		/// Deletes the data representation for the specified format.
+		public function clearData (format:String) : void;
+
+		/// Creates an empty Clipboard object.
+		public function Clipboard ();
+
+		/// Gets the clipboard data if data in the specified format is present.
+		public function getData (format:String, transferMode:String = "originalPreferred") : Object;
+
+		/// Checks whether data in the specified format exists in this Clipboard object.
+		public function hasFormat (format:String) : Boolean;
+
+		/// Adds a representation of the information to be transferred in the specified data format.
+		public function setData (format:String, data:Object, serializable:Boolean = true) : Boolean;
+
+		/// Adds a reference to a handler function that produces the data for the specified format on demand.
+		public function setDataHandler (format:String, handler:Function, serializable:Boolean = true) : Boolean;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/desktop/ClipboardFormats.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/desktop/ClipboardFormats.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.desktop
+{
+	/// Defines constants for the names of the standard data formats used with the Clipboard class.
+	public class ClipboardFormats extends Object
+	{
+		/// HTML data.
+		public static const HTML_FORMAT : String;
+		/// Rich Text Format data.
+		public static const RICH_TEXT_FORMAT : String;
+		/// String data.
+		public static const TEXT_FORMAT : String;
+
+		public function ClipboardFormats ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/desktop/ClipboardTransferMode.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/desktop/ClipboardTransferMode.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.desktop
+{
+	/// Defines constants for the modes used as values of the transferMode parameter of the Clipboard.getData() method.
+	public class ClipboardTransferMode extends Object
+	{
+		/// The Clipboard object should only return a copy.
+		public static const CLONE_ONLY : String;
+		/// The Clipboard object should return a copy if available and a reference if not.
+		public static const CLONE_PREFERRED : String;
+		/// The Clipboard object should only return a reference.
+		public static const ORIGINAL_ONLY : String;
+		/// The Clipboard object should return a reference if available and a copy if not.
+		public static const ORIGINAL_PREFERRED : String;
+
+		public function ClipboardTransferMode ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/AVM1Movie.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/AVM1Movie.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.display
+{
+	import flash.utils.ByteArray;
+
+	public class AVM1Movie extends DisplayObject
+	{
+		public function addCallback (functionName:String, closure:Function) : void;
+
+		public function AVM1Movie ();
+
+		public function call (functionName:String, ...rest) : *;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ActionScriptVersion.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ActionScriptVersion.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.display
+{
+	/// The ActionScriptVersion class is an enumeration of constant values that indicate the language version of a loaded SWF file.
+	public class ActionScriptVersion extends Object
+	{
+		/// ActionScript language version 2.0 and earlier.
+		public static const ACTIONSCRIPT2 : uint;
+		/// ActionScript language version 3.0.
+		public static const ACTIONSCRIPT3 : uint;
+
+		public function ActionScriptVersion ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Bitmap.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Bitmap.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,23 @@
+package flash.display
+{
+	import flash.display.BitmapData;
+
+	/// The Bitmap class represents display objects that represent bitmap images.
+	public class Bitmap extends DisplayObject
+	{
+		/// The BitmapData object being referenced.
+		public function get bitmapData () : BitmapData;
+		public function set bitmapData (value:BitmapData) : void;
+
+		/// Controls whether or not the Bitmap object is snapped to the nearest pixel.
+		public function get pixelSnapping () : String;
+		public function set pixelSnapping (value:String) : void;
+
+		/// Controls whether or not the bitmap is smoothed when scaled.
+		public function get smoothing () : Boolean;
+		public function set smoothing (value:Boolean) : void;
+
+		/// Initializes a Bitmap object to refer to the specified BitmapData object.
+		public function Bitmap (bitmapData:BitmapData = null, pixelSnapping:String = "auto", smoothing:Boolean = false);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/BitmapData.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/BitmapData.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,122 @@
+package flash.display
+{
+	import flash.display.BitmapData;
+	import flash.geom.Rectangle;
+	import flash.geom.Point;
+	import flash.filters.BitmapFilter;
+	import flash.geom.ColorTransform;
+	import flash.display.IBitmapDrawable;
+	import flash.geom.Matrix;
+	import flash.utils.ByteArray;
+
+	/// The BitmapData class lets you work with the data (pixels) of a Bitmap object.
+	public class BitmapData extends Object implements IBitmapDrawable
+	{
+		/// The height of the bitmap image in pixels.
+		public function get height () : int;
+
+		/// The rectangle that defines the size and location of the bitmap image.
+		public function get rect () : Rectangle;
+
+		/// Defines whether the bitmap image supports per-pixel transparency.
+		public function get transparent () : Boolean;
+
+		/// The width of the bitmap image in pixels.
+		public function get width () : int;
+
+		/// Takes a source image and a filter object and generates the filtered image.
+		public function applyFilter (sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, filter:BitmapFilter) : void;
+
+		/// Creates a BitmapData object with a specified width and height.
+		public function BitmapData (width:int, height:int, transparent:Boolean = true, fillColor:uint = 4294967295);
+
+		/// Returns a new BitmapData object with an exact copy of the original bitmap.
+		public function clone () : BitmapData;
+
+		/// Adjusts the color values in a specified area of a bitmap image by using a ColorTransform object.
+		public function colorTransform (rect:Rectangle, colorTransform:ColorTransform) : void;
+
+		/// Compares two BitmapData objects.
+		public function compare (otherBitmapData:BitmapData) : Object;
+
+		/// Transfers data from one channel of another BitmapData object or the current BitmapData object into a channel of the current BitmapData object.
+		public function copyChannel (sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, sourceChannel:uint, destChannel:uint) : void;
+
+		/// Provides a fast routine to perform pixel manipulation between images with no stretching, rotation, or color effects.
+		public function copyPixels (sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, alphaBitmapData:BitmapData = null, alphaPoint:Point = null, mergeAlpha:Boolean = false) : void;
+
+		/// Frees memory that is used to store the BitmapData object.
+		public function dispose () : void;
+
+		/// Draws the source display object onto the bitmap image, using the Flash Player vector renderer.
+		public function draw (source:IBitmapDrawable, matrix:Matrix = null, colorTransform:ColorTransform = null, blendMode:String = null, clipRect:Rectangle = null, smoothing:Boolean = false) : void;
+
+		/// Fills a rectangular area of pixels with a specified ARGB color.
+		public function fillRect (rect:Rectangle, color:uint) : void;
+
+		/// Performs a flood fill operation on an image starting at a (x, y) coordinate.
+		public function floodFill (x:int, y:int, color:uint) : void;
+
+		/// Determines the destination rectangle that will be affected by the applyFilter() call.
+		public function generateFilterRect (sourceRect:Rectangle, filter:BitmapFilter) : Rectangle;
+
+		/// Determines a rectangular region that either fully encloses all pixels of a specified color within the bitmap image (if the findColor parameter is set to true) or fully encloses all pixels that do not include the specified color (if the findColor parameter is set to false).
+		public function getColorBoundsRect (mask:uint, color:uint, findColor:Boolean = true) : Rectangle;
+
+		/// Returns an integer representing a RGB pixel value from a BitmapData object at a specific point.
+		public function getPixel (x:int, y:int) : uint;
+
+		/// Returns an ARGB color value that contains alpha channel data and RGB data.
+		public function getPixel32 (x:int, y:int) : uint;
+
+		/// Generates a byte array from a rectangular region of pixel data.
+		public function getPixels (rect:Rectangle) : ByteArray;
+
+		/// Generates a vector array from a rectangular region of pixel data.
+		public function getVector (rect:Rectangle) : Vector.<uint>;
+
+		/// Computes a 256 value binary number histogram of a BitmapData object.
+		public function histogram (hRect:Rectangle = null) : Vector.<Vector.<Number>>;
+
+		/// Performs pixel-level hit detection between one bitmap image and a point, rectangle, or other bitmap image.
+		public function hitTest (firstPoint:Point, firstAlphaThreshold:uint, secondObject:Object, secondBitmapDataPoint:Point = null, secondAlphaThreshold:uint = 1) : Boolean;
+
+		/// Locks an image so that any objects that reference the BitmapData object, such as Bitmap objects, are not updated when this BitmapData object changes.
+		public function lock () : void;
+
+		/// Performs per-channel blending from a source image to a destination image.
+		public function merge (sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, redMultiplier:uint, greenMultiplier:uint, blueMultiplier:uint, alphaMultiplier:uint) : void;
+
+		/// Fills an image with pixels representing random noise.
+		public function noise (randomSeed:int, low:uint = 0, high:uint = 255, channelOptions:uint = 7, grayScale:Boolean = false) : void;
+
+		/// Remaps the color channel values in an image that has up to four arrays of color palette data, one for each channel.
+		public function paletteMap (sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, redArray:Array = null, greenArray:Array = null, blueArray:Array = null, alphaArray:Array = null) : void;
+
+		/// Generates a Perlin noise image.
+		public function perlinNoise (baseX:Number, baseY:Number, numOctaves:uint, randomSeed:int, stitch:Boolean, fractalNoise:Boolean, channelOptions:uint = 7, grayScale:Boolean = false, offsets:Array = null) : void;
+
+		/// Performs a pixel dissolve either from a source image to a destination image or by using the same image.
+		public function pixelDissolve (sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, randomSeed:int = 0, numPixels:int = 0, fillColor:uint = 0) : int;
+
+		/// Scrolls an image by a certain (x, y) pixel amount.
+		public function scroll (x:int, y:int) : void;
+
+		/// Sets a single pixel of a BitmapData object.
+		public function setPixel (x:int, y:int, color:uint) : void;
+
+		/// Sets the color and alpha transparency values of a single pixel of a BitmapData object.
+		public function setPixel32 (x:int, y:int, color:uint) : void;
+
+		/// Converts a byte array into a rectangular region of pixel data.
+		public function setPixels (rect:Rectangle, inputByteArray:ByteArray) : void;
+
+		public function setVector (rect:Rectangle, inputVector:Vector.<uint>) : void;
+
+		/// Tests pixel values in an image against a specified threshold and sets pixels that pass the test to new color values.
+		public function threshold (sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, operation:String, threshold:uint, color:uint = 0, mask:uint = 4294967295, copySource:Boolean = false) : uint;
+
+		/// Unlocks an image so that any objects that reference the BitmapData object, such as Bitmap objects, are updated when this BitmapData object changes.
+		public function unlock (changeRect:Rectangle = null) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/BitmapDataChannel.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/BitmapDataChannel.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.display
+{
+	/// The BitmapDataChannel class is an enumeration of constant values that indicate which channel to use: red, blue, green, or alpha transparency.
+	public class BitmapDataChannel extends Object
+	{
+		/// The alpha channel.
+		public static const ALPHA : uint;
+		/// The blue channel.
+		public static const BLUE : uint;
+		/// The green channel.
+		public static const GREEN : uint;
+		/// The red channel.
+		public static const RED : uint;
+
+		public function BitmapDataChannel ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/BlendMode.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/BlendMode.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,39 @@
+package flash.display
+{
+	/// A class that provides constant values for visual blend mode effects.
+	public class BlendMode extends Object
+	{
+		/// Adds the values of the constituent colors of the display object to the colors of its background, applying a ceiling of 0xFF.
+		public static const ADD : String;
+		/// Applies the alpha value of each pixel of the display object to the background.
+		public static const ALPHA : String;
+		/// Selects the darker of the constituent colors of the display object and the colors of the background (the colors with the smaller values).
+		public static const DARKEN : String;
+		/// Compares the constituent colors of the display object with the colors of its background, and subtracts the darker of the values of the two constituent colors from the lighter value.
+		public static const DIFFERENCE : String;
+		/// Erases the background based on the alpha value of the display object.
+		public static const ERASE : String;
+		/// Adjusts the color of each pixel based on the darkness of the display object.
+		public static const HARDLIGHT : String;
+		/// Inverts the background.
+		public static const INVERT : String;
+		/// Forces the creation of a transparency group for the display object.
+		public static const LAYER : String;
+		/// Selects the lighter of the constituent colors of the display object and the colors of the background (the colors with the larger values).
+		public static const LIGHTEN : String;
+		/// Multiplies the values of the display object constituent colors by the constituent colors of the background color, and normalizes by dividing by 0xFF, resulting in darker colors.
+		public static const MULTIPLY : String;
+		/// The display object appears in front of the background.
+		public static const NORMAL : String;
+		/// Adjusts the color of each pixel based on the darkness of the background.
+		public static const OVERLAY : String;
+		/// Multiplies the complement (inverse) of the display object color by the complement of the background color, resulting in a bleaching effect.
+		public static const SCREEN : String;
+		/// Uses a shader to define the blend between objects.
+		public static const SHADER : String;
+		/// Subtracts the values of the constituent colors in the display object from the values of the backgroundcolor, applying a floor of 0.
+		public static const SUBTRACT : String;
+
+		public function BlendMode ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/CapsStyle.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/CapsStyle.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.display
+{
+	/// The CapsStyle class is an enumeration of constant values that specify the caps style to use in drawing lines.
+	public class CapsStyle extends Object
+	{
+		/// Used to specify no caps in the caps parameter of the flash.display.Graphics.lineStyle() method.
+		public static const NONE : String;
+		/// Used to specify round caps in the caps parameter of the flash.display.Graphics.lineStyle() method.
+		public static const ROUND : String;
+		/// Used to specify square caps in the caps parameter of the flash.display.Graphics.lineStyle() method.
+		public static const SQUARE : String;
+
+		public function CapsStyle ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ColorCorrection.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ColorCorrection.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.display
+{
+	/// The ColorCorrection class provides values for the flash.display.Stage.colorCorrection property.
+	public class ColorCorrection extends Object
+	{
+		/// Uses the host's default color correction.
+		public static const DEFAULT : String;
+		/// Turns off color correction regardless of the player host environment.
+		public static const OFF : String;
+		/// Turns on color correction regardless of the player host environment, if available.
+		public static const ON : String;
+
+		public function ColorCorrection ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ColorCorrectionSupport.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ColorCorrectionSupport.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.display
+{
+	/// The ColorCorrectionSupport class provides values for the flash.display.Stage.colorCorrectionSupport property.
+	public class ColorCorrectionSupport extends Object
+	{
+		/// Color correction is supported, but off by default.
+		public static const DEFAULT_OFF : String;
+		/// Color correction is supported, and on by default.
+		public static const DEFAULT_ON : String;
+		/// Color correction is not supported by the host environment.
+		public static const UNSUPPORTED : String;
+
+		public function ColorCorrectionSupport ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/DisplayObject.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/DisplayObject.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,210 @@
+package flash.display
+{
+	import flash.events.EventDispatcher;
+	import flash.display.IBitmapDrawable;
+	import flash.display.DisplayObject;
+	import flash.geom.Point;
+	import flash.geom.Rectangle;
+	import flash.accessibility.AccessibilityProperties;
+	import flash.display.Shader;
+	import flash.display.DisplayObjectContainer;
+	import flash.geom.Vector3D;
+	import flash.geom.Transform;
+	import flash.display.LoaderInfo;
+	import flash.display.Stage;
+
+	/**
+	 * [broadcast event] Dispatched when the display list is about to be updated and rendered.
+	 * @eventType flash.events.Event.RENDER
+	 */
+	[Event(name="render", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when a display object is about to be removed from the display list, either directly or through the removal of a sub tree in which the display object is contained.
+	 * @eventType flash.events.Event.REMOVED_FROM_STAGE
+	 */
+	[Event(name="removedFromStage", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when a display object is about to be removed from the display list.
+	 * @eventType flash.events.Event.REMOVED
+	 */
+	[Event(name="removed", type="flash.events.Event")] 
+
+	/**
+	 * [broadcast event] Dispatched when the playhead is exiting the current frame.
+	 * @eventType flash.events.Event.EXIT_FRAME
+	 */
+	[Event(name="exitFrame", type="flash.events.Event")] 
+
+	/**
+	 * [broadcast event] Dispatched after the constructors of frame display objects have run but before frame scripts have run.
+	 * @eventType flash.events.Event.FRAME_CONSTRUCTED
+	 */
+	[Event(name="frameConstructed", type="flash.events.Event")] 
+
+	/**
+	 * [broadcast event] Dispatched when the playhead is entering a new frame.
+	 * @eventType flash.events.Event.ENTER_FRAME
+	 */
+	[Event(name="enterFrame", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when a display object is added to the on stage display list, either directly or through the addition of a sub tree in which the display object is contained.
+	 * @eventType flash.events.Event.ADDED_TO_STAGE
+	 */
+	[Event(name="addedToStage", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when a display object is added to the display list.
+	 * @eventType flash.events.Event.ADDED
+	 */
+	[Event(name="added", type="flash.events.Event")] 
+
+	/// The DisplayObject class is the base class for all objects that can be placed on the display list.
+	public class DisplayObject extends EventDispatcher implements IBitmapDrawable
+	{
+		/// The current accessibility options for this display object.
+		public function get accessibilityProperties () : AccessibilityProperties;
+		public function set accessibilityProperties (value:AccessibilityProperties) : void;
+
+		/// Indicates the alpha transparency value of the object specified.
+		public function get alpha () : Number;
+		public function set alpha (value:Number) : void;
+
+		/// A value from the BlendMode class that specifies which blend mode to use.
+		public function get blendMode () : String;
+		public function set blendMode (value:String) : void;
+
+		/// Sets a shader that is used for blending the foreground and background.
+		public function set blendShader (value:Shader) : void;
+
+		/// If set to true, Flash Player caches an internal bitmap representation of the display object.
+		public function get cacheAsBitmap () : Boolean;
+		public function set cacheAsBitmap (value:Boolean) : void;
+
+		/// An indexed array that contains each filter object currently associated with the display object.
+		public function get filters () : Array;
+		public function set filters (value:Array) : void;
+
+		/// Indicates the height of the display object, in pixels.
+		public function get height () : Number;
+		public function set height (value:Number) : void;
+
+		/// Returns a LoaderInfo object containing information about loading the file to which this display object belongs.
+		public function get loaderInfo () : LoaderInfo;
+
+		/// The calling display object is masked by the specified mask object.
+		public function get mask () : DisplayObject;
+		public function set mask (value:DisplayObject) : void;
+
+		/// Indicates the x coordinate of the mouse position, in pixels.
+		public function get mouseX () : Number;
+
+		/// Indicates the y coordinate of the mouse position, in pixels.
+		public function get mouseY () : Number;
+
+		/// Indicates the instance name of the DisplayObject.
+		public function get name () : String;
+		public function set name (value:String) : void;
+
+		/// Specifies whether the display object is opaque with a certain background color.
+		public function get opaqueBackground () : Object;
+		public function set opaqueBackground (value:Object) : void;
+
+		/// Indicates the DisplayObjectContainer object that contains this display object.
+		public function get parent () : DisplayObjectContainer;
+
+		/// For a display object in a loaded SWF file, the root property is the top-most display object in the portion of the display list's tree structure represented by that SWF file.
+		public function get root () : DisplayObject;
+
+		/// Indicates the rotation of the DisplayObject instance, in degrees, from its original orientation.
+		public function get rotation () : Number;
+		public function set rotation (value:Number) : void;
+
+		/// Indicates the x-axis rotation of the DisplayObject instance, in degrees, from its original orientation relative to the 3D parent container.
+		public function get rotationX () : Number;
+		public function set rotationX (value:Number) : void;
+
+		/// Indicates the y-axis rotation of the DisplayObject instance, in degrees, from its original orientation relative to the 3D parent container.
+		public function get rotationY () : Number;
+		public function set rotationY (value:Number) : void;
+
+		/// Indicates the z-axis rotation of the DisplayObject instance, in degrees, from its original orientation relative to the 3D parent container.
+		public function get rotationZ () : Number;
+		public function set rotationZ (value:Number) : void;
+
+		/// The current scaling grid that is in effect.
+		public function get scale9Grid () : Rectangle;
+		public function set scale9Grid (innerRectangle:Rectangle) : void;
+
+		/// Indicates the horizontal scale (percentage) of the object as applied from the registration point.
+		public function get scaleX () : Number;
+		public function set scaleX (value:Number) : void;
+
+		/// Indicates the vertical scale (percentage) of an object as applied from the registration point of the object.
+		public function get scaleY () : Number;
+		public function set scaleY (value:Number) : void;
+
+		/// Indicates the depth scale (percentage) of an object as applied from the registration point of the object.
+		public function get scaleZ () : Number;
+		public function set scaleZ (value:Number) : void;
+
+		/// The scroll rectangle bounds of the display object.
+		public function get scrollRect () : Rectangle;
+		public function set scrollRect (value:Rectangle) : void;
+
+		/// The Stage of the display object.
+		public function get stage () : Stage;
+
+		/// An object with properties pertaining to a display object's matrix, color transform, and pixel bounds.
+		public function get transform () : Transform;
+		public function set transform (value:Transform) : void;
+
+		/// Indicates the width of the display object, in pixels.
+		public function get width () : Number;
+		public function set width (value:Number) : void;
+
+		/// Whether or not the display object is visible.
+		public function get visible () : Boolean;
+		public function set visible (value:Boolean) : void;
+
+		/// Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.
+		public function get x () : Number;
+		public function set x (value:Number) : void;
+
+		/// Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.
+		public function get y () : Number;
+		public function set y (value:Number) : void;
+
+		/// Indicates the z coordinate position along the z-axis of the DisplayObject instance relative to the 3D parent container.
+		public function get z () : Number;
+		public function set z (value:Number) : void;
+
+		public function DisplayObject ();
+
+		/// Returns a rectangle that defines the area of the display object relative to the coordinate system of the targetCoordinateSpace object.
+		public function getBounds (targetCoordinateSpace:DisplayObject) : Rectangle;
+
+		/// Returns a rectangle that defines the boundary of the display object, based on the coordinate system defined by the targetCoordinateSpace parameter, excluding any strokes on shapes.
+		public function getRect (targetCoordinateSpace:DisplayObject) : Rectangle;
+
+		/// Converts the point object from Stage (global) coordinates to the display object's (local) coordinates.
+		public function globalToLocal (point:Point) : Point;
+
+		/// Converts a two-dimensional point from the Stage (global) coordinates to a three-dimensional display object's (local) coordinates.
+		public function globalToLocal3D (point:Point) : Vector3D;
+
+		/// Evaluates the display object to see if it overlaps or intersects with the display object passed as a parameter.
+		public function hitTestObject (obj:DisplayObject) : Boolean;
+
+		/// Evaluates the display object to see if it overlaps or intersects with a point specified by x and y.
+		public function hitTestPoint (x:Number, y:Number, shapeFlag:Boolean = false) : Boolean;
+
+		/// Converts a three-dimensional point of the three-dimensional display object's (local) coordinates to a two-dimensional point in the Stage (global) coordinates.
+		public function local3DToGlobal (point3d:Vector3D) : Point;
+
+		/// Converts the point object from the display object's (local) coordinates to the Stage (global) coordinates.
+		public function localToGlobal (point:Point) : Point;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/DisplayObjectContainer.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/DisplayObjectContainer.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,66 @@
+package flash.display
+{
+	import flash.display.DisplayObject;
+	import flash.text.TextSnapshot;
+	import flash.geom.Point;
+
+	/// The DisplayObjectContainer class is the base class for all objects that can serve as display object containers on the display list.
+	public class DisplayObjectContainer extends InteractiveObject
+	{
+		/// Determines whether or not the children of the object are mouse enabled.
+		public function get mouseChildren () : Boolean;
+		public function set mouseChildren (enable:Boolean) : void;
+
+		/// Returns the number of children of this object.
+		public function get numChildren () : int;
+
+		/// Determines whether the children of the object are tab enabled.
+		public function get tabChildren () : Boolean;
+		public function set tabChildren (enable:Boolean) : void;
+
+		/// Returns a TextSnapshot object for this DisplayObjectContainer instance.
+		public function get textSnapshot () : TextSnapshot;
+
+		/// Adds a child object to this DisplayObjectContainer instance.
+		public function addChild (child:DisplayObject) : DisplayObject;
+
+		/// Adds a child object to this DisplayObjectContainer instance.
+		public function addChildAt (child:DisplayObject, index:int) : DisplayObject;
+
+		/// Indicates whether the security restrictions would cause any display objects to be omitted from the list returned by calling the DisplayObjectContainer.getObjectsUnderPoint() method with the specified point point.
+		public function areInaccessibleObjectsUnderPoint (point:Point) : Boolean;
+
+		/// Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance itself.
+		public function contains (child:DisplayObject) : Boolean;
+
+		/// Calling the new DisplayObjectContainer() constructor throws an ArgumentError exception.
+		public function DisplayObjectContainer ();
+
+		/// Returns the child display object instance that exists at the specified index.
+		public function getChildAt (index:int) : DisplayObject;
+
+		/// Returns the child display object that exists with the specified name.
+		public function getChildByName (name:String) : DisplayObject;
+
+		/// Returns the index number of a child DisplayObject instance.
+		public function getChildIndex (child:DisplayObject) : int;
+
+		/// Returns an array of objects that lie under the specified point and are children (or grandchildren, and so on) of this DisplayObjectContainer instance.
+		public function getObjectsUnderPoint (point:Point) : Array;
+
+		/// Removes a child display object from the DisplayObjectContainer instance.
+		public function removeChild (child:DisplayObject) : DisplayObject;
+
+		/// Removes a child display object, at the specified index position, from the DisplayObjectContainer instance.
+		public function removeChildAt (index:int) : DisplayObject;
+
+		/// Changes the index number of an existing child.
+		public function setChildIndex (child:DisplayObject, index:int) : void;
+
+		/// Swaps the z-order (front-to-back order) of the two specified child objects.
+		public function swapChildren (child1:DisplayObject, child2:DisplayObject) : void;
+
+		/// Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child list.
+		public function swapChildrenAt (index1:int, index2:int) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/FrameLabel.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/FrameLabel.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,14 @@
+package flash.display
+{
+	/// The FrameLabel object contains properties that specify a frame number and the corresponding label name.
+	public class FrameLabel extends Object
+	{
+		/// The frame number containing the label.
+		public function get frame () : int;
+
+		/// The name of the label.
+		public function get name () : String;
+
+		public function FrameLabel (name:String, frame:int);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GradientType.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GradientType.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.display
+{
+	/// The GradientType class provides values for the type parameter in the beginGradientFill() and lineGradientStyle() methods of the flash.display.Graphics class.
+	public class GradientType extends Object
+	{
+		/// Value used to specify a linear gradient fill.
+		public static const LINEAR : String;
+		/// Value used to specify a radial gradient fill.
+		public static const RADIAL : String;
+
+		public function GradientType ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Graphics.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Graphics.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,82 @@
+package flash.display
+{
+	import flash.display.Shader;
+	import flash.geom.Matrix;
+	import flash.display.BitmapData;
+	import flash.display.IGraphicsStroke;
+	import flash.display.IGraphicsPath;
+	import flash.display.IGraphicsFill;
+	import flash.display.IGraphicsData;
+	import flash.display.Graphics;
+
+	/// The Graphics class contains a set of methods that you can use to create a vector shape.
+	public class Graphics extends Object
+	{
+		/// Begins a bitmap filled shape.
+		public function beginBitmapFill (bitmap:BitmapData, matrix:Matrix = null, repeat:Boolean = true, smooth:Boolean = false) : void;
+
+		/// Specifies a single-color fill.
+		public function beginFill (color:uint, alpha:Number = 1) : void;
+
+		/// Specifies a gradient fill.
+		public function beginGradientFill (type:String, colors:Array, alphas:Array, ratios:Array, matrix:Matrix = null, spreadMethod:String = "pad", interpolationMethod:String = "rgb", focalPointRatio:Number = 0) : void;
+
+		/// Specifies a shader fill.
+		public function beginShaderFill (shader:Shader, matrix:Matrix = null) : void;
+
+		/// Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.
+		public function clear () : void;
+
+		/// Copies all of drawing commands from the source Graphics object into the calling Graphics object.
+		public function copyFrom (sourceGraphics:Graphics) : void;
+
+		/// Draws a curve from the current drawing position to (anchorX, anchorY) using the control point specified by (controlX, controlY).
+		public function curveTo (controlX:Number, controlY:Number, anchorX:Number, anchorY:Number) : void;
+
+		/// Draws a circle.
+		public function drawCircle (x:Number, y:Number, radius:Number) : void;
+
+		/// Draws an ellipse.
+		public function drawEllipse (x:Number, y:Number, width:Number, height:Number) : void;
+
+		/// Submits a series of IGraphicsData instances for drawing.
+		public function drawGraphicsData (graphicsData:Vector.<IGraphicsData>) : void;
+
+		/// Submits a series of commands for drawing.
+		public function drawPath (commands:Vector.<int>, data:Vector.<Number>, winding:String = "evenOdd") : void;
+
+		/// Draws a round rectangle.
+		public function drawRect (x:Number, y:Number, width:Number, height:Number) : void;
+
+		/// Draws a round rectangle.
+		public function drawRoundRect (x:Number, y:Number, width:Number, height:Number, ellipseWidth:Number, ellipseHeight:Number = null) : void;
+
+		public function drawRoundRectComplex (x:Number, y:Number, width:Number, height:Number, topLeftRadius:Number, topRightRadius:Number, bottomLeftRadius:Number, bottomRightRadius:Number) : void;
+
+		/// Renders a set of triangles, typically to distort bitmaps and give them a three-dimensional appearance.
+		public function drawTriangles (vertices:Vector.<Number>, indices:Vector.<int> = null, uvtData:Vector.<Number> = null, culling:String = "none") : void;
+
+		/// Applies a fill to the lines and curves.
+		public function endFill () : void;
+
+		public function Graphics ();
+
+		/// Specifies a bitmap to use for the line stroke when drawing lines.
+		public function lineBitmapStyle (bitmap:BitmapData, matrix:Matrix = null, repeat:Boolean = true, smooth:Boolean = false) : void;
+
+		/// Specifies a gradient to use for the stroke when drawing lines.
+		public function lineGradientStyle (type:String, colors:Array, alphas:Array, ratios:Array, matrix:Matrix = null, spreadMethod:String = "pad", interpolationMethod:String = "rgb", focalPointRatio:Number = 0) : void;
+
+		/// Specifies a shader to use for the line stroke when drawing lines.
+		public function lineShaderStyle (shader:Shader, matrix:Matrix = null) : void;
+
+		/// Specifies a line style that Flash uses for drawing lines.
+		public function lineStyle (thickness:Number = null, color:uint = 0, alpha:Number = 1, pixelHinting:Boolean = false, scaleMode:String = "normal", caps:String = null, joints:String = null, miterLimit:Number = 3) : void;
+
+		/// Draws a line from the current drawing position to (x, y).
+		public function lineTo (x:Number, y:Number) : void;
+
+		/// Moves the current drawing position to (x, y).
+		public function moveTo (x:Number, y:Number) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsBitmapFill.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsBitmapFill.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,21 @@
+package flash.display
+{
+	import flash.geom.Matrix;
+	import flash.display.BitmapData;
+
+	/// Defines a bitmap fill.
+	public class GraphicsBitmapFill extends Object implements IGraphicsFill, IGraphicsData
+	{
+		/// A transparent or opaque bitmap image.
+		public var bitmapData : BitmapData;
+		/// A matrix object (of the flash.geom.Matrix class) that defines transformations on the bitmap.
+		public var matrix : Matrix;
+		/// Specifies whether to repeat the bitmap image in a tiled pattern.
+		public var repeat : Boolean;
+		/// Specifies whether to apply a smoothing algorithm to the bitmap image.
+		public var smooth : Boolean;
+
+		/// Creates a new GraphicsBitmapFill object.
+		public function GraphicsBitmapFill (bitmapData:BitmapData = null, matrix:Matrix = null, repeat:Boolean = true, smooth:Boolean = false);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsEndFill.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsEndFill.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,9 @@
+package flash.display
+{
+	/// Indicates the end of a graphics fill.
+	public class GraphicsEndFill extends Object implements IGraphicsFill, IGraphicsData
+	{
+		/// Creates an object to use with the Graphics.drawGraphicsData() method to end the fill, explicitly.
+		public function GraphicsEndFill ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsGradientFill.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsGradientFill.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,34 @@
+package flash.display
+{
+	import flash.geom.Matrix;
+
+	/// Defines a gradient fill.
+	public class GraphicsGradientFill extends Object implements IGraphicsFill, IGraphicsData
+	{
+		/// An array of alpha values for the corresponding colors in the colors array.
+		public var alphas : Array;
+		/// An array of RGB hexadecimal color values to use in the gradient.
+		public var colors : Array;
+		/// A number that controls the location of the focal point of the gradient.
+		public var focalPointRatio : Number;
+		/// A transformation matrix as defined by the Matrix class.
+		public var matrix : Matrix;
+		/// An array of color distribution ratios.
+		public var ratios : Array;
+
+		/// A value from the InterpolationMethod class that specifies which value to use.
+		public function get interpolationMethod () : String;
+		public function set interpolationMethod (value:String) : void;
+
+		/// A value from the SpreadMethod class that specifies which spread method to use.
+		public function get spreadMethod () : String;
+		public function set spreadMethod (value:String) : void;
+
+		/// A value from the GradientType class that specifies which gradient type to use.
+		public function get type () : String;
+		public function set type (value:String) : void;
+
+		/// Creates a new GraphicsGradientFill object.
+		public function GraphicsGradientFill (type:String = "linear", colors:Array = null, alphas:Array = null, ratios:Array = null, matrix:* = null, spreadMethod:* = "pad", interpolationMethod:String = "rgb", focalPointRatio:Number = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsPath.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsPath.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,33 @@
+package flash.display
+{
+	/// A collection of drawing commands and the coordinate parameters for those commands.
+	public class GraphicsPath extends Object implements IGraphicsPath, IGraphicsData
+	{
+		/// The Vector of drawing commands as integers representing the path.
+		public var commands : Vector.<int>;
+		/// The Vector of Numbers containing the parameters used with the drawing commands.
+		public var data : Vector.<Number>;
+
+		/// Specifies the winding rule using a value defined in the GraphicsPathWinding class.
+		public function get winding () : String;
+		public function set winding (value:String) : void;
+
+		/// Adds a new "curveTo" command to the commands vector and new coordinates to the data vector.
+		public function curveTo (controlX:Number, controlY:Number, anchorX:Number, anchorY:Number) : void;
+
+		/// Creates a new GraphicsPath object.
+		public function GraphicsPath (commands:Vector.<int> = null, data:Vector.<Number> = null, winding:String = "evenOdd");
+
+		/// Adds a new "lineTo" command to the commands vector and new coordinates to the data vector.
+		public function lineTo (x:Number, y:Number) : void;
+
+		/// Adds a new "moveTo" command to the commands vector and new coordinates to the data vector.
+		public function moveTo (x:Number, y:Number) : void;
+
+		/// Adds a new "wideLineTo" command to the commands vector and new coordinates to the data vector.
+		public function wideLineTo (x:Number, y:Number) : void;
+
+		/// Adds a new "wideMoveTo" command to the commands vector and new coordinates to the data vector.
+		public function wideMoveTo (x:Number, y:Number) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsPathCommand.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsPathCommand.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,21 @@
+package flash.display
+{
+	/// Defines the values to use for specifying path-drawing commands.
+	public class GraphicsPathCommand extends Object
+	{
+		/// Specifies a drawing command that draws a curve from the current drawing position to the x- and y-coordinates specified in the data vector, using a control point.
+		public static const CURVE_TO : int;
+		/// Specifies a drawing command that draws a line from the current drawing position to the x- and y-coordinates specified in the data vector.
+		public static const LINE_TO : int;
+		/// Specifies a drawing command that moves the current drawing position to the x- and y-coordinates specified in the data vector.
+		public static const MOVE_TO : int;
+		/// Represents the default "do nothing" command.
+		public static const NO_OP : int;
+		/// Specifies a "line to" drawing command, but uses two sets of coordinates (four values) instead of one set.
+		public static const WIDE_LINE_TO : int;
+		/// Specifies a "move to" drawing command, but uses two sets of coordinates (four values) instead of one set.
+		public static const WIDE_MOVE_TO : int;
+
+		public function GraphicsPathCommand ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsPathWinding.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsPathWinding.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.display
+{
+	/// The GraphicsPathWinding class provides values for the flash.display.GraphicsPath.winding property and the flash.display.Graphics.drawPath() methodto determine the direction to draw a path.
+	public class GraphicsPathWinding extends Object
+	{
+		/// Establishes the even-odd winding type.
+		public static const EVEN_ODD : String;
+		/// Establishes the non-zero winding type.
+		public static const NON_ZERO : String;
+
+		public function GraphicsPathWinding ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsShaderFill.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsShaderFill.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.display
+{
+	import flash.geom.Matrix;
+	import flash.display.Shader;
+
+	/// Defines a shader fill.
+	public class GraphicsShaderFill extends Object implements IGraphicsFill, IGraphicsData
+	{
+		/// A matrix object (of the flash.geom.Matrix class), which you can use to define transformations on the shader.
+		public var matrix : Matrix;
+		/// The shader to use for the fill.
+		public var shader : Shader;
+
+		/// Creates a new GraphicsShaderFill object.
+		public function GraphicsShaderFill (shader:Shader = null, matrix:Matrix = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsSolidFill.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsSolidFill.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,14 @@
+package flash.display
+{
+	/// Defines a solid fill.
+	public class GraphicsSolidFill extends Object implements IGraphicsFill, IGraphicsData
+	{
+		/// Indicates the alpha transparency value of the fill.
+		public var alpha : Number;
+		/// The color of the fill.
+		public var color : uint;
+
+		/// Creates a new GraphicsSolidFill object.
+		public function GraphicsSolidFill (color:uint = 0, alpha:Number = 1);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsStroke.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsStroke.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,32 @@
+package flash.display
+{
+	import flash.display.IGraphicsFill;
+
+	/// Defines a line style or stroke.
+	public class GraphicsStroke extends Object implements IGraphicsStroke, IGraphicsData
+	{
+		/// Specifies the instance containing data for filling a stroke.
+		public var fill : IGraphicsFill;
+		/// Indicates the limit at which a miter is cut off.
+		public var miterLimit : Number;
+		/// Specifies whether to hint strokes to full pixels.
+		public var pixelHinting : Boolean;
+		/// Indicates the thickness of the line in points; valid values are 0-255.
+		public var thickness : Number;
+
+		/// Specifies the type of caps at the end of lines.
+		public function get caps () : String;
+		public function set caps (value:String) : void;
+
+		/// Specifies the type of joint appearance used at angles.
+		public function get joints () : String;
+		public function set joints (value:String) : void;
+
+		/// Specifies the stroke thickness scaling.
+		public function get scaleMode () : String;
+		public function set scaleMode (value:String) : void;
+
+		/// Creates a new GraphicsStroke object.
+		public function GraphicsStroke (thickness:Number = NaN, pixelHinting:Boolean = false, scaleMode:String = "normal", caps:String = "none", joints:String = "round", miterLimit:Number = 3, fill:IGraphicsFill = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsTrianglePath.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/GraphicsTrianglePath.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,20 @@
+package flash.display
+{
+	/// Defines an ordered set of triangles that can be rendered using either (u,v) fill coordinates or a normal fill.
+	public class GraphicsTrianglePath extends Object implements IGraphicsPath, IGraphicsData
+	{
+		/// A Vector of integers or indexes, where every three indexes define a triangle.
+		public var indices : Vector.<int>;
+		/// A Vector of normalized coordinates used to apply texture mapping.
+		public var uvtData : Vector.<Number>;
+		/// A Vector of Numbers where each pair of numbers is treated as a point (an x, y pair).
+		public var vertices : Vector.<Number>;
+
+		/// Specifies whether to render triangles that face in a given direction.
+		public function get culling () : String;
+		public function set culling (value:String) : void;
+
+		/// Creates a new GraphicsTrianglePath object.
+		public function GraphicsTrianglePath (vertices:Vector.<Number> = null, indices:Vector.<int> = null, uvtData:Vector.<Number> = null, culling:String = "none");
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/IBitmapDrawable.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/IBitmapDrawable.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,6 @@
+package flash.display
+{
+	public interface IBitmapDrawable
+	{
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/IGraphicsData.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/IGraphicsData.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,6 @@
+package flash.display
+{
+	public interface IGraphicsData
+	{
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/IGraphicsFill.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/IGraphicsFill.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,6 @@
+package flash.display
+{
+	public interface IGraphicsFill
+	{
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/IGraphicsPath.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/IGraphicsPath.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,6 @@
+package flash.display
+{
+	public interface IGraphicsPath
+	{
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/IGraphicsStroke.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/IGraphicsStroke.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,6 @@
+package flash.display
+{
+	public interface IGraphicsStroke
+	{
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/InteractiveObject.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/InteractiveObject.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,183 @@
+package flash.display
+{
+	import flash.accessibility.AccessibilityImplementation;
+	import flash.ui.ContextMenu;
+
+	/**
+	 * Dispatched when the value of the object's tabIndex property changes.
+	 * @eventType flash.events.Event.TAB_INDEX_CHANGE
+	 */
+	[Event(name="tabIndexChange", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when the object's tabEnabled flag changes.
+	 * @eventType flash.events.Event.TAB_ENABLED_CHANGE
+	 */
+	[Event(name="tabEnabledChange", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when the value of the object's tabChildren flag changes.
+	 * @eventType flash.events.Event.TAB_CHILDREN_CHANGE
+	 */
+	[Event(name="tabChildrenChange", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when the user releases a key.
+	 * @eventType flash.events.KeyboardEvent.KEY_UP
+	 */
+	[Event(name="keyUp", type="flash.events.KeyboardEvent")] 
+
+	/**
+	 * Dispatched when the user presses a key.
+	 * @eventType flash.events.KeyboardEvent.KEY_DOWN
+	 */
+	[Event(name="keyDown", type="flash.events.KeyboardEvent")] 
+
+	/**
+	 * Dispatched when the user moves a pointing device over an InteractiveObject instance.
+	 * @eventType flash.events.MouseEvent.ROLL_OVER
+	 */
+	[Event(name="rollOver", type="flash.events.MouseEvent")] 
+
+	/**
+	 * Dispatched when the user moves a pointing device away from an InteractiveObject instance.
+	 * @eventType flash.events.MouseEvent.ROLL_OUT
+	 */
+	[Event(name="rollOut", type="flash.events.MouseEvent")] 
+
+	/**
+	 * Dispatched when a mouse wheel is spun over an InteractiveObject instance in the Flash Player window.
+	 * @eventType flash.events.MouseEvent.MOUSE_WHEEL
+	 */
+	[Event(name="mouseWheel", type="flash.events.MouseEvent")] 
+
+	/**
+	 * Dispatched when a user releases the pointing device button over an InteractiveObject instance in the Flash Player window.
+	 * @eventType flash.events.MouseEvent.MOUSE_UP
+	 */
+	[Event(name="mouseUp", type="flash.events.MouseEvent")] 
+
+	/**
+	 * Dispatched when the user moves a pointing device over an InteractiveObject instance in the Flash Player window.
+	 * @eventType flash.events.MouseEvent.MOUSE_OVER
+	 */
+	[Event(name="mouseOver", type="flash.events.MouseEvent")] 
+
+	/**
+	 * Dispatched when the user moves a pointing device away from an InteractiveObject instance.
+	 * @eventType flash.events.MouseEvent.MOUSE_OUT
+	 */
+	[Event(name="mouseOut", type="flash.events.MouseEvent")] 
+
+	/**
+	 * Dispatched when a user moves the pointing device while it is over an InteractiveObject.
+	 * @eventType flash.events.MouseEvent.MOUSE_MOVE
+	 */
+	[Event(name="mouseMove", type="flash.events.MouseEvent")] 
+
+	/**
+	 * Dispatched when a user presses the pointing device button over an InteractiveObject instance in the Flash Player window.
+	 * @eventType flash.events.MouseEvent.MOUSE_DOWN
+	 */
+	[Event(name="mouseDown", type="flash.events.MouseEvent")] 
+
+	/**
+	 * Dispatched when a user presses and releases the main button of a pointing device twice in rapid succession over the same InteractiveObject when that object's doubleClickEnabled flag is set to true.
+	 * @eventType flash.events.MouseEvent.DOUBLE_CLICK
+	 */
+	[Event(name="doubleClick", type="flash.events.MouseEvent")] 
+
+	/**
+	 * Dispatched when a user presses and releases the main button of the user's pointing device over the same InteractiveObject.
+	 * @eventType flash.events.MouseEvent.CLICK
+	 */
+	[Event(name="click", type="flash.events.MouseEvent")] 
+
+	/**
+	 * Dispatched when the user attempts to change focus by using a pointer device.
+	 * @eventType flash.events.FocusEvent.MOUSE_FOCUS_CHANGE
+	 */
+	[Event(name="mouseFocusChange", type="flash.events.FocusEvent")] 
+
+	/**
+	 * Dispatched when the user attempts to change focus by using keyboard navigation.
+	 * @eventType flash.events.FocusEvent.KEY_FOCUS_CHANGE
+	 */
+	[Event(name="keyFocusChange", type="flash.events.FocusEvent")] 
+
+	/**
+	 * Dispatched after a display object loses focus.
+	 * @eventType flash.events.FocusEvent.FOCUS_OUT
+	 */
+	[Event(name="focusOut", type="flash.events.FocusEvent")] 
+
+	/**
+	 * Dispatched after a display object gains focus.
+	 * @eventType flash.events.FocusEvent.FOCUS_IN
+	 */
+	[Event(name="focusIn", type="flash.events.FocusEvent")] 
+
+	/**
+	 * Dispatched when the user activates the platform specific accelerator key combination for a select all operation or selects 'Select All' from the text context menu.
+	 * @eventType flash.events.Event.SELECT_ALL
+	 */
+	[Event(name="selectAll", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when the user activates the platform specific accelerator key combination for a paste operation or selects 'Paste' from the text context menu.
+	 * @eventType flash.events.Event.PASTE
+	 */
+	[Event(name="paste", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when the user activates the platform specific accelerator key combination for a cut operation or selects 'Cut' from the text context menu.
+	 * @eventType flash.events.Event.CUT
+	 */
+	[Event(name="cut", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when the user activates the platform specific accelerator key combination for a copy operation or selects 'Copy' from the text context menu.
+	 * @eventType flash.events.Event.COPY
+	 */
+	[Event(name="copy", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when the user selects 'Clear' (or 'Delete') from the text context menu.
+	 * @eventType flash.events.Event.CLEAR
+	 */
+	[Event(name="clear", type="flash.events.Event")] 
+
+	/// The InteractiveObject class is the abstract base class for all display objects with which the user can interact, using the mouse and keyboard.
+	public class InteractiveObject extends DisplayObject
+	{
+		public function get accessibilityImplementation () : AccessibilityImplementation;
+		public function set accessibilityImplementation (value:AccessibilityImplementation) : void;
+
+		/// Specifies the context menu associated with this object.
+		public function get contextMenu () : ContextMenu;
+		public function set contextMenu (cm:ContextMenu) : void;
+
+		/// Specifies whether the object receives doubleClick events.
+		public function get doubleClickEnabled () : Boolean;
+		public function set doubleClickEnabled (enabled:Boolean) : void;
+
+		/// Specifies whether this object displays a focus rectangle.
+		public function get focusRect () : Object;
+		public function set focusRect (focusRect:Object) : void;
+
+		/// Specifies whether this object receives mouse messages.
+		public function get mouseEnabled () : Boolean;
+		public function set mouseEnabled (enabled:Boolean) : void;
+
+		/// Specifies whether this object is in the tab order.
+		public function get tabEnabled () : Boolean;
+		public function set tabEnabled (enabled:Boolean) : void;
+
+		/// Specifies the tab ordering of objects in a SWF file.
+		public function get tabIndex () : int;
+		public function set tabIndex (index:int) : void;
+
+		/// Calling the new InteractiveObject() constructor throws an ArgumentError exception.
+		public function InteractiveObject ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/InterpolationMethod.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/InterpolationMethod.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.display
+{
+	/// The InterpolationMethod class provides values for the interpolationMethod parameter in the Graphics.beginGradientFill() and Graphics.lineGradientStyle() methods.
+	public class InterpolationMethod extends Object
+	{
+		/// Specifies that the linear RGB interpolation method should be used.
+		public static const LINEAR_RGB : String;
+		/// Specifies that the RGB interpolation method should be used.
+		public static const RGB : String;
+
+		public function InterpolationMethod ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/JointStyle.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/JointStyle.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.display
+{
+	/// The JointStyle class is an enumeration of constant values that specify the joint style to use in drawing lines.
+	public class JointStyle extends Object
+	{
+		/// Specifies beveled joints in the joints parameter of the flash.display.Graphics.lineStyle() method.
+		public static const BEVEL : String;
+		/// Specifies mitered joints in the joints parameter of the flash.display.Graphics.lineStyle() method.
+		public static const MITER : String;
+		/// Specifies round joints in the joints parameter of the flash.display.Graphics.lineStyle() method.
+		public static const ROUND : String;
+
+		public function JointStyle ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/LineScaleMode.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/LineScaleMode.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.display
+{
+	/// The LineScaleMode class provides values for the scaleMode parameter in the Graphics.lineStyle() method.
+	public class LineScaleMode extends Object
+	{
+		/// With this setting used as the scaleMode parameter of the lineStyle() method, the thickness of the line scales only vertically.
+		public static const HORIZONTAL : String;
+		/// With this setting used as the scaleMode parameter of the lineStyle() method, the thickness of the line never scales.
+		public static const NONE : String;
+		/// With this setting used as the scaleMode parameter of the lineStyle() method, the thickness of the line always scales when the object is scaled (the default).
+		public static const NORMAL : String;
+		/// With this setting used as the scaleMode parameter of the lineStyle() method, the thickness of the line scales only horizontally.
+		public static const VERTICAL : String;
+
+		public function LineScaleMode ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Loader.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Loader.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,48 @@
+package flash.display
+{
+	import flash.display.LoaderInfo;
+	import flash.net.URLRequest;
+	import flash.system.ApplicationDomain;
+	import flash.system.SecurityDomain;
+	import flash.system.LoaderContext;
+	import flash.display.DisplayObject;
+	import flash.utils.ByteArray;
+
+	/// The Loader class is used to load SWF files or image (JPG, PNG, or GIF) files.
+	public class Loader extends DisplayObjectContainer
+	{
+		/// Contains the root display object of the SWF file or image (JPG, PNG, or GIF) file that was loaded by using the load() or loadBytes() methods.
+		public function get content () : DisplayObject;
+
+		/// Returns a LoaderInfo object corresponding to the object being loaded.
+		public function get contentLoaderInfo () : LoaderInfo;
+
+		public function addChild (child:DisplayObject) : DisplayObject;
+
+		public function addChildAt (child:DisplayObject, index:int) : DisplayObject;
+
+		/// Cancels a load() method operation that is currently in progress for the Loader instance.
+		public function close () : void;
+
+		/// Loads a SWF file or image file into a DisplayObject that is a child of this Loader instance.
+		public function load (request:URLRequest, context:LoaderContext = null) : void;
+
+		/// Loads from binary data stored in a ByteArray object.
+		public function loadBytes (bytes:ByteArray, context:LoaderContext = null) : void;
+
+		/// Creates a Loader object that you can use to load files, such as SWF, JPEG, GIF, or PNG files.
+		public function Loader ();
+
+		public function removeChild (child:DisplayObject) : DisplayObject;
+
+		public function removeChildAt (index:int) : DisplayObject;
+
+		public function setChildIndex (child:DisplayObject, index:int) : void;
+
+		/// Removes a child of this Loader object that was loaded by using the load() method.
+		public function unload () : void;
+
+		/// Attempts to unload child SWF file contents and stops the execution of commands from loaded SWF files.
+		public function unloadAndStop (gc:Boolean = true) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/LoaderInfo.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/LoaderInfo.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,120 @@
+package flash.display
+{
+	import flash.events.EventDispatcher;
+	import flash.display.LoaderInfo;
+	import flash.events.Event;
+	import flash.utils.ByteArray;
+	import flash.system.ApplicationDomain;
+	import flash.display.Loader;
+	import flash.display.DisplayObject;
+
+	/**
+	 * Dispatched when a network request is made over HTTP and Flash Player can detect the HTTP status code.
+	 * @eventType flash.events.HTTPStatusEvent.HTTP_STATUS
+	 */
+	[Event(name="httpStatus", type="flash.events.HTTPStatusEvent")] 
+
+	/**
+	 * Dispatched by a LoaderInfo object whenever a loaded object is removed by using the unload() method of the Loader object, or when a second load is performed by the same Loader object and the original content is removed prior to the load beginning.
+	 * @eventType flash.events.Event.UNLOAD
+	 */
+	[Event(name="unload", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when data is received as the download operation progresses.
+	 * @eventType flash.events.ProgressEvent.PROGRESS
+	 */
+	[Event(name="progress", type="flash.events.ProgressEvent")] 
+
+	/**
+	 * Dispatched when a load operation starts.
+	 * @eventType flash.events.Event.OPEN
+	 */
+	[Event(name="open", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when an input or output error occurs that causes a load operation to fail.
+	 * @eventType flash.events.IOErrorEvent.IO_ERROR
+	 */
+	[Event(name="ioError", type="flash.events.IOErrorEvent")] 
+
+	/**
+	 * Dispatched when the properties and methods of a loaded SWF file are accessible and ready for use.
+	 * @eventType flash.events.Event.INIT
+	 */
+	[Event(name="init", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when data has loaded successfully.
+	 * @eventType flash.events.Event.COMPLETE
+	 */
+	[Event(name="complete", type="flash.events.Event")] 
+
+	/// The LoaderInfo class provides information about a loaded SWF file or a loaded image file (JPEG, GIF, or PNG).
+	public class LoaderInfo extends EventDispatcher
+	{
+		/// The ActionScript version of the loaded SWF file.
+		public function get actionScriptVersion () : uint;
+
+		/// When an external SWF file is loaded, all ActionScript 3.0 definitions contained in the loaded class are stored in the applicationDomain property.
+		public function get applicationDomain () : ApplicationDomain;
+
+		/// The bytes associated with a LoaderInfo object.
+		public function get bytes () : ByteArray;
+
+		/// The number of bytes that are loaded for the media.
+		public function get bytesLoaded () : uint;
+
+		/// The number of compressed bytes in the entire media file.
+		public function get bytesTotal () : uint;
+
+		/// Expresses the trust relationship from content (child) to the Loader (parent).
+		public function get childAllowsParent () : Boolean;
+
+		/// The loaded object associated with this LoaderInfo object.
+		public function get content () : DisplayObject;
+
+		/// The MIME type of the loaded file.
+		public function get contentType () : String;
+
+		/// The nominal frame rate, in frames per second, of the loaded SWF file.
+		public function get frameRate () : Number;
+
+		/// The nominal height of the loaded file.
+		public function get height () : int;
+
+		/// The Loader object associated with this LoaderInfo object.
+		public function get loader () : Loader;
+
+		/// The URL of the SWF file that initiated the loading of the media described by this LoaderInfo object.
+		public function get loaderURL () : String;
+
+		/// An object that contains name-value pairs that represent the parameters provided to the loaded SWF file.
+		public function get parameters () : Object;
+
+		/// Expresses the trust relationship from Loader (parent) to the content (child).
+		public function get parentAllowsChild () : Boolean;
+
+		/// Expresses the domain relationship between the loader and the content: true if they have the same origin domain; false otherwise.
+		public function get sameDomain () : Boolean;
+
+		/// An EventDispatcher instance that can be used to exchange events across security boundaries.
+		public function get sharedEvents () : EventDispatcher;
+
+		/// The file format version of the loaded SWF file.
+		public function get swfVersion () : uint;
+
+		/// The URL of the media being loaded.
+		public function get url () : String;
+
+		/// The nominal width of the loaded content.
+		public function get width () : int;
+
+		public function dispatchEvent (event:Event) : Boolean;
+
+		/// Returns the LoaderInfo object associated with a SWF file defined as an object.
+		public static function getLoaderInfoByDefinition (object:Object) : LoaderInfo;
+
+		public function LoaderInfo ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/MorphShape.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/MorphShape.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,7 @@
+package flash.display
+{
+	public class MorphShape extends DisplayObject
+	{
+		public function MorphShape ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/MovieClip.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/MovieClip.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,70 @@
+package flash.display
+{
+	import flash.display.Scene;
+
+	/// The MovieClip class inherits from the following classes: Sprite, DisplayObjectContainer, InteractiveObject, DisplayObject, and EventDispatcher.
+	public class MovieClip extends Sprite
+	{
+		/// Specifies the number of the frame in which the playhead is located in the timeline of the MovieClip instance.
+		public function get currentFrame () : int;
+
+		/// The label at the current frame in the timeline of the MovieClip instance.
+		public function get currentFrameLabel () : String;
+
+		/// The current label in which the playhead is located in the timeline of the MovieClip instance.
+		public function get currentLabel () : String;
+
+		/// Returns an array of FrameLabel objects from the current scene.
+		public function get currentLabels () : Array;
+
+		/// The current scene in which the playhead is located in the timeline of the MovieClip instance.
+		public function get currentScene () : Scene;
+
+		/// A Boolean value that indicates whether a movie clip is enabled.
+		public function get enabled () : Boolean;
+		public function set enabled (value:Boolean) : void;
+
+		/// The number of frames that are loaded from a streaming SWF file.
+		public function get framesLoaded () : int;
+
+		/// An array of Scene objects, each listing the name, the number of frames, and the frame labels for a scene in the MovieClip instance.
+		public function get scenes () : Array;
+
+		/// The total number of frames in the MovieClip instance.
+		public function get totalFrames () : int;
+
+		/// Indicates whether other display objects that are SimpleButton or MovieClip objects can receive mouse release events.
+		public function get trackAsMenu () : Boolean;
+		public function set trackAsMenu (value:Boolean) : void;
+
+		/// [Undocumented] Takes a collection of frame (zero-based) - method pairs that associates a method with a frame on the timeline.
+		public function addFrameScript (frame:int, method:Function) : void;
+
+		/// Starts playing the SWF file at the specified frame.
+		public function gotoAndPlay (frame:Object, scene:String = null) : void;
+
+		/// Brings the playhead to the specified frame of the movie clip and stops it there.
+		public function gotoAndStop (frame:Object, scene:String = null) : void;
+
+		/// Creates a new MovieClip instance.
+		public function MovieClip ();
+
+		/// Sends the playhead to the next frame and stops it.
+		public function nextFrame () : void;
+
+		/// Moves the playhead to the next scene of the MovieClip instance.
+		public function nextScene () : void;
+
+		/// Moves the playhead in the timeline of the movie clip.
+		public function play () : void;
+
+		/// Sends the playhead to the previous frame and stops it.
+		public function prevFrame () : void;
+
+		/// Moves the playhead to the previous scene of the MovieClip instance.
+		public function prevScene () : void;
+
+		/// Stops the playhead in the movie clip.
+		public function stop () : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/PixelSnapping.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/PixelSnapping.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.display
+{
+	/// The PixelSnapping class is an enumeration of constant values for setting the pixel snapping options by using the pixelSnapping property of a Bitmap object.
+	public class PixelSnapping extends Object
+	{
+		/// A constant value used in the pixelSnapping property of a Bitmap object to specify that the bitmap image is always snapped to the nearest pixel, independent of any transformation.
+		public static const ALWAYS : String;
+		/// A constant value used in the pixelSnapping property of a Bitmap object to specify that the bitmap image is snapped to the nearest pixel if it is drawn with no rotation or skew and it is drawn at a scale factor of 99.9% to 100.1%.
+		public static const AUTO : String;
+		/// A constant value used in the pixelSnapping property of a Bitmap object to specify that no pixel snapping occurs.
+		public static const NEVER : String;
+
+		public function PixelSnapping ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/SWFVersion.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/SWFVersion.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,29 @@
+package flash.display
+{
+	/// The SWFVersion class is an enumeration of constant values that indicate the file format version of a loaded SWF file.
+	public class SWFVersion extends Object
+	{
+		/// SWF file format version 1.0.
+		public static const FLASH1 : uint;
+		/// SWF file format version 10.0.
+		public static const FLASH10 : uint;
+		/// SWF file format version 2.0.
+		public static const FLASH2 : uint;
+		/// SWF file format version 3.0.
+		public static const FLASH3 : uint;
+		/// SWF file format version 4.0.
+		public static const FLASH4 : uint;
+		/// SWF file format version 5.0.
+		public static const FLASH5 : uint;
+		/// SWF file format version 6.0.
+		public static const FLASH6 : uint;
+		/// SWF file format version 7.0.
+		public static const FLASH7 : uint;
+		/// SWF file format version 8.0.
+		public static const FLASH8 : uint;
+		/// SWF file format version 9.0.
+		public static const FLASH9 : uint;
+
+		public function SWFVersion ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Scene.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Scene.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.display
+{
+	/// The Scene class includes properties for identifying the name, labels, and number of frames in a scene.
+	public class Scene extends Object
+	{
+		/// An array of FrameLabel objects for the scene.
+		public function get labels () : Array;
+
+		/// The name of the scene.
+		public function get name () : String;
+
+		/// The number of frames in the scene.
+		public function get numFrames () : int;
+
+		public function Scene (name:String, labels:Array, numFrames:int);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Shader.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Shader.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,23 @@
+package flash.display
+{
+	import flash.utils.ByteArray;
+	import flash.display.ShaderData;
+
+	/// A Shader instance represents a pixel shader in ActionScript.
+	public class Shader extends Object
+	{
+		/// The raw shader bytecode for this Shader instance.
+		public function set byteCode (code:ByteArray) : void;
+
+		/// Provides access to parameters, input images, and metadata for the Shader instance.
+		public function get data () : ShaderData;
+		public function set data (p:ShaderData) : void;
+
+		/// The precision of math operations performed by the shader.
+		public function get precisionHint () : String;
+		public function set precisionHint (p:String) : void;
+
+		/// Creates a new Shader instance.
+		public function Shader (code:ByteArray = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderData.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderData.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,11 @@
+package flash.display
+{
+	import flash.utils.ByteArray;
+
+	/// A ShaderData object contains properties representing any parameters and inputs for a shader kernel, as well as properties containing any metadata specified for the shader.
+	public class ShaderData extends Object
+	{
+		/// Creates a ShaderData instance.
+		public function ShaderData (byteCode:ByteArray);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderInput.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderInput.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,27 @@
+package flash.display
+{
+	/// A ShaderInput instance represents a single input image for a shader kernel.
+	public class ShaderInput extends Object
+	{
+		/// The number of channels that a shader input expects.
+		public function get channels () : int;
+
+		/// The height of the shader input.
+		public function get height () : int;
+		public function set height (value:int) : void;
+
+		/// The zero-based index of the input in the shader, indicating the order of the input definitions in the shader.
+		public function get index () : int;
+
+		/// The input data that is used when the shader executes.
+		public function get input () : Object;
+		public function set input (input:Object) : void;
+
+		/// The width of the shader input.
+		public function get width () : int;
+		public function set width (value:int) : void;
+
+		/// Creates a ShaderInput instance.
+		public function ShaderInput ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderJob.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderJob.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,43 @@
+package flash.display
+{
+	import flash.events.EventDispatcher;
+	import flash.display.Shader;
+
+	/**
+	 * Dispatched when the ShaderJob finishes processing the data using the shader.
+	 * @eventType flash.events.ShaderEvent.COMPLETE
+	 */
+	[Event(name="complete", type="flash.events.ShaderEvent")] 
+
+	/// A ShaderJob instance is used to execute a shader operation in the background.
+	public class ShaderJob extends EventDispatcher
+	{
+		/// The height of the result data in the target if it is a ByteArray or Vector.<Number> instance.
+		public function get height () : int;
+		public function set height (v:int) : void;
+
+		/// The progress of a running shader.
+		public function get progress () : Number;
+
+		/// The shader that's used for the operation.
+		public function get shader () : Shader;
+		public function set shader (s:Shader) : void;
+
+		/// The object into which the result of the shader operation is written.
+		public function get target () : Object;
+		public function set target (s:Object) : void;
+
+		/// The width of the result data in the target if it is a ByteArray or Vector.<Number> instance.
+		public function get width () : int;
+		public function set width (v:int) : void;
+
+		/// Cancels the currently running shader operation.
+		public function cancel () : void;
+
+		/// A ShaderJob instance is used to execute a shader operation in the background.
+		public function ShaderJob (shader:Shader = null, target:Object = null, width:int = 0, height:int = 0);
+
+		/// Starts a background shader operation.
+		public function start (waitForCompletion:Boolean = false) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderParameter.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderParameter.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,19 @@
+package flash.display
+{
+	/// A ShaderParameter instance represents a single input parameter of a shader kernel.
+	public class ShaderParameter extends Object
+	{
+		/// The zero-based index of the parameter.
+		public function get index () : int;
+
+		/// The data type of the parameter as defined in the shader.
+		public function get type () : String;
+
+		/// The value or values that are passed in as the parameter value to the shader.
+		public function get value () : Array;
+		public function set value (v:Array) : void;
+
+		/// Creates a ShaderParameter instance.
+		public function ShaderParameter ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderParameterType.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderParameterType.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,39 @@
+package flash.display
+{
+	/// This class defines the constants that represent the possible values for the ShaderParameter class's type property.
+	public class ShaderParameterType extends Object
+	{
+		/// Indicates that the shader parameter is defined as a bool value, equivalent to a single Boolean instance in ActionScript.
+		public static const BOOL : String;
+		/// Indicates that the shader parameter is defined as a bool2 value, equivalent to an Array of two Boolean instances in ActionScript.
+		public static const BOOL2 : String;
+		/// Indicates that the shader parameter is defined as a bool3 value, equivalent to an Array of three Boolean instances in ActionScript.
+		public static const BOOL3 : String;
+		/// Indicates that the shader parameter is defined as a bool4 value, equivalent to an Array of four Boolean instances in ActionScript.
+		public static const BOOL4 : String;
+		/// Indicates that the shader parameter is defined as a float value, equivalent to a single Number instance in ActionScript.
+		public static const FLOAT : String;
+		/// Indicates that the shader parameter is defined as a float2 value, equivalent to an Array of two Number instances in ActionScript.
+		public static const FLOAT2 : String;
+		/// Indicates that the shader parameter is defined as a float3 value, equivalent to an Array of three Number instances in ActionScript.
+		public static const FLOAT3 : String;
+		/// Indicates that the shader parameter is defined as a float4 value, equivalent to an Array of four Number instances in ActionScript.
+		public static const FLOAT4 : String;
+		/// Indicates that the shader parameter is defined as an int value, equivalent to a single int or uint instance in ActionScript.
+		public static const INT : String;
+		/// Indicates that the shader parameter is defined as an int2 value, equivalent to an Array of two int or uint instances in ActionScript.
+		public static const INT2 : String;
+		/// Indicates that the shader parameter is defined as an int3 value, equivalent to an Array of three int or uint instances in ActionScript.
+		public static const INT3 : String;
+		/// Indicates that the shader parameter is defined as an int4 value, equivalent to an Array of four int or uint instances in ActionScript.
+		public static const INT4 : String;
+		/// Indicates that the shader parameter is defined as a float2x2 value, equivalent to a 2-by-2 matrix.
+		public static const MATRIX2X2 : String;
+		/// Indicates that the shader parameter is defined as a float3x3 value, equivalent to a 3-by-3 matrix.
+		public static const MATRIX3X3 : String;
+		/// Indicates that the shader parameter is defined as a float4x4 value, equivalent to a 4-by-4 matrix.
+		public static const MATRIX4X4 : String;
+
+		public function ShaderParameterType ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderPrecision.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/ShaderPrecision.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.display
+{
+	/// This class defines the constants that represent the possible values for the Shader class's precisionHint property.
+	public class ShaderPrecision extends Object
+	{
+		/// Represents fast precision mode.
+		public static const FAST : String;
+		/// Represents full precision mode.
+		public static const FULL : String;
+
+		public function ShaderPrecision ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Shape.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Shape.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,14 @@
+package flash.display
+{
+	import flash.display.Graphics;
+
+	/// The Shape class is used to create lightweight shapes by using the ActionScript drawing application program interface (API).
+	public class Shape extends DisplayObject
+	{
+		/// Specifies the Graphics object belonging to this Shape object, where vector drawing commands can occur.
+		public function get graphics () : Graphics;
+
+		/// Creates a new Shape object.
+		public function Shape ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/SimpleButton.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/SimpleButton.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,44 @@
+package flash.display
+{
+	import flash.display.DisplayObject;
+	import flash.media.SoundTransform;
+
+	/// The SimpleButton class lets you control all instances of button symbols in a SWF file.
+	public class SimpleButton extends InteractiveObject
+	{
+		/// Specifies a display object that is used as the visual object for the button "Down" state - the state that the button is in when the user clicks the hitTestState object.
+		public function get downState () : DisplayObject;
+		public function set downState (value:DisplayObject) : void;
+
+		/// A Boolean value that specifies whether a button is enabled.
+		public function get enabled () : Boolean;
+		public function set enabled (value:Boolean) : void;
+
+		/// Specifies a display object that is used as the hit testing object for the button.
+		public function get hitTestState () : DisplayObject;
+		public function set hitTestState (value:DisplayObject) : void;
+
+		/// Specifies a display object that is used as the visual object for the button over state - the state that the button is in when the mouse is positioned over the button.
+		public function get overState () : DisplayObject;
+		public function set overState (value:DisplayObject) : void;
+
+		/// The SoundTransform object assigned to this button.
+		public function get soundTransform () : SoundTransform;
+		public function set soundTransform (sndTransform:SoundTransform) : void;
+
+		/// Indicates whether other display objects that are SimpleButton or MovieClip objects can receive mouse release events.
+		public function get trackAsMenu () : Boolean;
+		public function set trackAsMenu (value:Boolean) : void;
+
+		/// Specifies a display object that is used as the visual object for the button up state - the state that the button is in when the mouse is not positioned over the button.
+		public function get upState () : DisplayObject;
+		public function set upState (value:DisplayObject) : void;
+
+		/// A Boolean value that, when set to true, indicates whether Flash Player displays the hand cursor when the mouse rolls over a button.
+		public function get useHandCursor () : Boolean;
+		public function set useHandCursor (value:Boolean) : void;
+
+		/// Creates a new SimpleButton instance.
+		public function SimpleButton (upState:DisplayObject = null, overState:DisplayObject = null, downState:DisplayObject = null, hitTestState:DisplayObject = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/SpreadMethod.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/SpreadMethod.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.display
+{
+	/// The SpreadMethod class provides values for the spreadMethod parameter in the beginGradientFill() and lineGradientStyle() methods of the Graphics class.
+	public class SpreadMethod extends Object
+	{
+		/// Specifies that the gradient use the pad spread method.
+		public static const PAD : String;
+		/// Specifies that the gradient use the reflect spread method.
+		public static const REFLECT : String;
+		/// Specifies that the gradient use the repeat spread method.
+		public static const REPEAT : String;
+
+		public function SpreadMethod ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Sprite.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Sprite.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,45 @@
+package flash.display
+{
+	import flash.display.DisplayObject;
+	import flash.media.SoundTransform;
+	import flash.display.Sprite;
+	import flash.display.Graphics;
+	import flash.geom.Rectangle;
+
+	/// The Sprite class is a basic display list building block: a display list node that can display graphics and can also contain children.
+	public class Sprite extends DisplayObjectContainer
+	{
+		/// Specifies the button mode of this sprite.
+		public function get buttonMode () : Boolean;
+		public function set buttonMode (value:Boolean) : void;
+
+		/// Specifies the display object over which the sprite is being dragged, or on which the sprite was dropped.
+		public function get dropTarget () : DisplayObject;
+
+		/// Specifies the Graphics object that belongs to this sprite where vector drawing commands can occur.
+		public function get graphics () : Graphics;
+
+		/// Designates another sprite to serve as the hit area for a sprite.
+		public function get hitArea () : Sprite;
+		public function set hitArea (value:Sprite) : void;
+
+		/// Controls sound within this sprite.
+		public function get soundTransform () : SoundTransform;
+		public function set soundTransform (sndTransform:SoundTransform) : void;
+
+		/// A Boolean value that indicates whether the pointing hand (hand cursor) appears when the mouse rolls over a sprite in which the buttonMode property is set to true.
+		public function get useHandCursor () : Boolean;
+		public function set useHandCursor (value:Boolean) : void;
+
+		/// Creates a new Sprite instance.
+		public function Sprite ();
+
+		/// Lets the user drag the specified sprite.
+		public function startDrag (lockCenter:Boolean = false, bounds:Rectangle = null) : void;
+
+		/// Ends the startDrag() method.
+		public function stopDrag () : void;
+
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Stage.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/Stage.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,204 @@
+package flash.display
+{
+	import flash.display.DisplayObject;
+	import flash.geom.Rectangle;
+	import flash.text.TextSnapshot;
+	import flash.display.InteractiveObject;
+	import flash.accessibility.AccessibilityImplementation;
+	import flash.accessibility.AccessibilityProperties;
+	import flash.events.Event;
+	import flash.ui.ContextMenu;
+	import flash.geom.Transform;
+
+	/**
+	 * Dispatched when the Stage object enters, or leaves, full-screen mode.
+	 * @eventType flash.events.FullScreenEvent.FULL_SCREEN
+	 */
+	[Event(name="fullScreen", type="flash.events.FullScreenEvent")] 
+
+	/**
+	 * Dispatched when the scaleMode property of the Stage object is set to StageScaleMode.NO_SCALE and the SWF file is resized.
+	 * @eventType flash.events.Event.RESIZE
+	 */
+	[Event(name="resize", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched by the Stage object when the mouse pointer moves out of the stage area.
+	 * @eventType flash.events.Event.MOUSE_LEAVE
+	 */
+	[Event(name="mouseLeave", type="flash.events.Event")] 
+
+	/// The Stage class represents the main drawing area.
+	public class Stage extends DisplayObjectContainer
+	{
+		public function set accessibilityImplementation (value:AccessibilityImplementation) : void;
+
+		public function set accessibilityProperties (value:AccessibilityProperties) : void;
+
+		/// A value from the StageAlign class that specifies the alignment of the stage in Flash Player or the browser.
+		public function get align () : String;
+		public function set align (value:String) : void;
+
+		public function set alpha (value:Number) : void;
+
+		public function set blendMode (value:String) : void;
+
+		public function set cacheAsBitmap (value:Boolean) : void;
+
+		/// Controls Flash Player color correction for displays.
+		public function get colorCorrection () : String;
+		public function set colorCorrection (value:String) : void;
+
+		/// Specifies whether Flash Player is running on an operating system that supports color correction and whether the color profile of the main (primary) monitor can be read and understood by Flash Player.
+		public function get colorCorrectionSupport () : String;
+
+		public function set contextMenu (value:ContextMenu) : void;
+
+		/// A value from the StageDisplayState class that specifies which display state to use.
+		public function get displayState () : String;
+		public function set displayState (value:String) : void;
+
+		public function set filters (value:Array) : void;
+
+		/// The interactive object with keyboard focus; or null if focus is not set or if the focused object belongs to a security sandbox to which the calling object does not have access.
+		public function get focus () : InteractiveObject;
+		public function set focus (newFocus:InteractiveObject) : void;
+
+		public function set focusRect (value:Object) : void;
+
+		/// Gets and sets the frame rate of the stage.
+		public function get frameRate () : Number;
+		public function set frameRate (value:Number) : void;
+
+		/// Returns the height of the monitor that will be used when going to full screen size, if that state is entered immediately.
+		public function get fullScreenHeight () : uint;
+
+		/// Sets Flash Player to scale a specific region of the stage to full-screen mode.
+		public function get fullScreenSourceRect () : Rectangle;
+		public function set fullScreenSourceRect (value:Rectangle) : void;
+
+		/// Returns the width of the monitor that will be used when going to full screen size, if that state is entered immediately.
+		public function get fullScreenWidth () : uint;
+
+		/// Indicates the height of the display object, in pixels.
+		public function get height () : Number;
+		public function set height (value:Number) : void;
+
+		public function set mask (value:DisplayObject) : void;
+
+		/// Determines whether or not the children of the object are mouse enabled.
+		public function get mouseChildren () : Boolean;
+		public function set mouseChildren (value:Boolean) : void;
+
+		public function set mouseEnabled (value:Boolean) : void;
+
+		public function set name (value:String) : void;
+
+		/// Returns the number of children of this object.
+		public function get numChildren () : int;
+
+		public function set opaqueBackground (value:Object) : void;
+
+		/// A value from the StageQuality class that specifies which rendering quality is used.
+		public function get quality () : String;
+		public function set quality (value:String) : void;
+
+		public function set rotation (value:Number) : void;
+
+		public function set rotationX (value:Number) : void;
+
+		public function set rotationY (value:Number) : void;
+
+		public function set rotationZ (value:Number) : void;
+
+		public function set scale9Grid (value:Rectangle) : void;
+
+		/// A value from the StageScaleMode class that specifies which scale mode to use.
+		public function get scaleMode () : String;
+		public function set scaleMode (value:String) : void;
+
+		public function set scaleX (value:Number) : void;
+
+		public function set scaleY (value:Number) : void;
+
+		public function set scaleZ (value:Number) : void;
+
+		public function set scrollRect (value:Rectangle) : void;
+
+		/// Specifies whether to show or hide the default items in the Flash Player context menu.
+		public function get showDefaultContextMenu () : Boolean;
+		public function set showDefaultContextMenu (value:Boolean) : void;
+
+		/// Specifies whether or not objects display a glowing border when they have focus.
+		public function get stageFocusRect () : Boolean;
+		public function set stageFocusRect (on:Boolean) : void;
+
+		/// The current height, in pixels, of the Stage.
+		public function get stageHeight () : int;
+		public function set stageHeight (value:int) : void;
+
+		/// Specifies the current width, in pixels, of the Stage.
+		public function get stageWidth () : int;
+		public function set stageWidth (value:int) : void;
+
+		/// Determines whether the children of the object are tab enabled.
+		public function get tabChildren () : Boolean;
+		public function set tabChildren (value:Boolean) : void;
+
+		public function set tabEnabled (value:Boolean) : void;
+
+		public function set tabIndex (value:int) : void;
+
+		/// Returns a TextSnapshot object for this DisplayObjectContainer instance.
+		public function get textSnapshot () : TextSnapshot;
+
+		public function set transform (value:Transform) : void;
+
+		/// Indicates the width of the display object, in pixels.
+		public function get width () : Number;
+		public function set width (value:Number) : void;
+
+		public function set visible (value:Boolean) : void;
+
+		public function set x (value:Number) : void;
+
+		public function set y (value:Number) : void;
+
+		public function set z (value:Number) : void;
+
+		/// Adds a child DisplayObject instance to this DisplayObjectContainer instance.
+		public function addChild (child:DisplayObject) : DisplayObject;
+
+		/// Adds a child DisplayObject instance to this DisplayObjectContainer instance.
+		public function addChildAt (child:DisplayObject, index:int) : DisplayObject;
+
+		/// Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
+		public function addEventListener (type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false) : void;
+
+		/// Dispatches an event into the event flow.
+		public function dispatchEvent (event:Event) : Boolean;
+
+		/// Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
+		public function hasEventListener (type:String) : Boolean;
+
+		/// Signals Flash Player to update properties of display objects on the next opportunity it has to refresh the Stage.
+		public function invalidate () : void;
+
+		/// Determines whether the Stage.focus property would return null for security reasons.
+		public function isFocusInaccessible () : Boolean;
+
+		/// Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer.
+		public function removeChildAt (index:int) : DisplayObject;
+
+		/// Changes the position of an existing child in the display object container.
+		public function setChildIndex (child:DisplayObject, index:int) : void;
+
+		public function Stage ();
+
+		/// Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child list.
+		public function swapChildrenAt (index1:int, index2:int) : void;
+
+		/// Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
+		public function willTrigger (type:String) : Boolean;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/StageAlign.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/StageAlign.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,25 @@
+package flash.display
+{
+	/// The StageAlign class provides constant values to use for the Stage.align property.
+	public class StageAlign extends Object
+	{
+		/// Specifies that the Stage is aligned at the bottom.
+		public static const BOTTOM : String;
+		/// Specifies that the Stage is aligned in the bottom-left corner.
+		public static const BOTTOM_LEFT : String;
+		/// Specifies that the Stage is aligned in the bottom-right corner.
+		public static const BOTTOM_RIGHT : String;
+		/// Specifies that the Stage is aligned on the left.
+		public static const LEFT : String;
+		/// Specifies that the Stage is aligned to the right.
+		public static const RIGHT : String;
+		/// Specifies that the Stage is aligned at the top.
+		public static const TOP : String;
+		/// Specifies that the Stage is aligned in the top-left corner.
+		public static const TOP_LEFT : String;
+		/// Specifies that the Stage is aligned in the top-right corner.
+		public static const TOP_RIGHT : String;
+
+		public function StageAlign ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/StageDisplayState.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/StageDisplayState.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.display
+{
+	/// The StageDisplayState class provides values for the Stage.displayState property.
+	public class StageDisplayState extends Object
+	{
+		/// Specifies that the Stage is in full-screen mode.
+		public static const FULL_SCREEN : String;
+		/// Specifies that the Stage is in normal mode.
+		public static const NORMAL : String;
+
+		public function StageDisplayState ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/StageQuality.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/StageQuality.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.display
+{
+	/// The StageQuality class provides values for the Stage.quality property.
+	public class StageQuality extends Object
+	{
+		/// Specifies very high rendering quality: graphics are anti-aliased using a 4 x 4 pixel grid and bitmaps are always smoothed.
+		public static const BEST : String;
+		/// Specifies high rendering quality: graphics are anti-aliased using a 4 x 4 pixel grid, and bitmaps are smoothed if the movie is static.
+		public static const HIGH : String;
+		/// Specifies low rendering quality: graphics are not anti-aliased, and bitmaps are not smoothed.
+		public static const LOW : String;
+		/// Specifies medium rendering quality: graphics are anti-aliased using a 2 x 2 pixel grid, but bitmaps are not smoothed.
+		public static const MEDIUM : String;
+
+		public function StageQuality ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/StageScaleMode.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/StageScaleMode.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.display
+{
+	/// The StageScaleMode class provides values for the Stage.scaleMode property.
+	public class StageScaleMode extends Object
+	{
+		/// Specifies that the entire application be visible in the specified area without trying to preserve the original aspect ratio.
+		public static const EXACT_FIT : String;
+		/// Specifies that the entire application fill the specified area, without distortion but possibly with some cropping, while maintaining the original aspect ratio of the application.
+		public static const NO_BORDER : String;
+		/// Specifies that the size of the application be fixed, so that it remains unchanged even as the size of the player window changes.
+		public static const NO_SCALE : String;
+		/// Specifies that the entire application be visible in the specified area without distortion while maintaining the original aspect ratio of the application.
+		public static const SHOW_ALL : String;
+
+		public function StageScaleMode ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/TriangleCulling.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/display/TriangleCulling.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.display
+{
+	/// Defines codes for culling algorithms that determine which triangles not to render when drawing triangle paths.
+	public class TriangleCulling extends Object
+	{
+		/// Specifies culling of all triangles facing toward the current view point.
+		public static const NEGATIVE : String;
+		/// Specifies no culling.
+		public static const NONE : String;
+		/// Specifies culling of all triangles facing away from the current view point.
+		public static const POSITIVE : String;
+
+		public function TriangleCulling ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/EOFError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/EOFError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,9 @@
+package flash.errors
+{
+	/// An EOFError exception is thrown when you attempt to read past the end of the available data.
+	public class EOFError extends IOError
+	{
+		/// Creates a new EOFError object.
+		public function EOFError (message:String = "", id:int = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/IOError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/IOError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,9 @@
+package flash.errors
+{
+	/// The IOError exception is thrown when some type of input or output failure occurs.
+	public class IOError extends Error
+	{
+		/// Creates a new IOError object.
+		public function IOError (message:String = "", id:int = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/IllegalOperationError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/IllegalOperationError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,9 @@
+package flash.errors
+{
+	/// The IllegalOperationError exception is thrown when a method is not implemented or the implementation doesn't cover the current usage.
+	public class IllegalOperationError extends Error
+	{
+		/// Creates a new IllegalOperationError object.
+		public function IllegalOperationError (message:String = "", id:int = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/InvalidSWFError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/InvalidSWFError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,7 @@
+package flash.errors
+{
+	public class InvalidSWFError extends Error
+	{
+		public function InvalidSWFError (message:String = "", id:int = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/MemoryError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/MemoryError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,9 @@
+package flash.errors
+{
+	/// The MemoryError exception is thrown when a memory allocation request fails.
+	public class MemoryError extends Error
+	{
+		/// Creates a new MemoryError object.
+		public function MemoryError (message:String = "", id:int = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/ScriptTimeoutError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/ScriptTimeoutError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,9 @@
+package flash.errors
+{
+	/// The ScriptTimeoutError exception is thrown when the script timeout interval is reached.
+	public class ScriptTimeoutError extends Error
+	{
+		/// Creates a new ScriptTimeoutError object.
+		public function ScriptTimeoutError (message:String = "", id:int = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/StackOverflowError.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/errors/StackOverflowError.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,9 @@
+package flash.errors
+{
+	/// ActionScript throws a StackOverflowError exception when the stack available to the script is exhausted.
+	public class StackOverflowError extends Error
+	{
+		/// Creates a new StackOverflowError object.
+		public function StackOverflowError (message:String = "", id:int = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/ActivityEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/ActivityEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,24 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// A Camera or Microphone object dispatches an ActivityEvent object whenever a camera or microphone reports that it has become active or inactive.
+	public class ActivityEvent extends Event
+	{
+		/// The ActivityEvent.ACTIVITY constant defines the value of the type property of an activity event object.
+		public static const ACTIVITY : String = "activity";
+
+		/// Indicates whether the device is activating (true) or deactivating (false).
+		public function get activating () : Boolean;
+		public function set activating (value:Boolean) : void;
+
+		/// Constructor for ActivityEvent objects.
+		public function ActivityEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, activating:Boolean = false);
+
+		/// Creates a copy of an ActivityEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Returns a string that contains all the properties of the ActivityEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/AsyncErrorEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/AsyncErrorEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,22 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// Flash Player dispatches an AsyncErrorEvent when an exception is thrown from native asynchronous code, which could be from, for example, LocalConnection, NetConnection, SharedObject, or NetStream.
+	public class AsyncErrorEvent extends ErrorEvent
+	{
+		/// The AsyncErrorEvent.ASYNC_ERROR constant defines the value of the type property of an asyncError event object.
+		public static const ASYNC_ERROR : String = "asyncError";
+		/// The exception that was thrown.
+		public var error : Error;
+
+		/// Constructor for AsyncErrorEvent objects.
+		public function AsyncErrorEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, text:String = "", error:Error = null);
+
+		/// Creates a copy of the AsyncErrorEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Returns a string that contains all the properties of the AsyncErrorEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/ContextMenuEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/ContextMenuEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,35 @@
+package flash.events
+{
+	import flash.display.InteractiveObject;
+	import flash.events.Event;
+
+	/// Flash Player dispatches ContextMenuEvent objects when a user generates or interacts with the context menu.
+	public class ContextMenuEvent extends Event
+	{
+		/// Defines the value of the type property of a menuItemSelect event object.
+		public static const MENU_ITEM_SELECT : String = "menuItemSelect";
+		/// Defines the value of the type property of a menuSelect event object.
+		public static const MENU_SELECT : String = "menuSelect";
+
+		/// The display list object to which the menu is attached.
+		public function get contextMenuOwner () : InteractiveObject;
+		public function set contextMenuOwner (value:InteractiveObject) : void;
+
+		/// Indicates whether the mouseTarget property was set to null for security reasons.
+		public function get isMouseTargetInaccessible () : Boolean;
+		public function set isMouseTargetInaccessible (value:Boolean) : void;
+
+		/// The display list object on which the user right-clicked to display the context menu.
+		public function get mouseTarget () : InteractiveObject;
+		public function set mouseTarget (value:InteractiveObject) : void;
+
+		/// Creates a copy of the ContextMenuEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for ContextMenuEvent objects.
+		public function ContextMenuEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, mouseTarget:InteractiveObject = null, contextMenuOwner:InteractiveObject = null);
+
+		/// Returns a string that contains all the properties of the ContextMenuEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/DataEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/DataEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,26 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// Flash Player dispatches DataEvent objects when raw data has completed loading into Flash Player.
+	public class DataEvent extends TextEvent
+	{
+		/// Defines the value of the type property of a data event object.
+		public static const DATA : String = "data";
+		/// Defines the value of the type property of an uploadCompleteData event object.
+		public static const UPLOAD_COMPLETE_DATA : String = "uploadCompleteData";
+
+		/// The raw data loaded into Flash Player.
+		public function get data () : String;
+		public function set data (value:String) : void;
+
+		/// Creates a copy of the DataEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for DataEvent objects.
+		public function DataEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, data:String = "");
+
+		/// Returns a string that contains all the properties of the DataEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/ErrorEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/ErrorEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,20 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// Flash Player dispatches ErrorEvent objects when an error causes a network operation to fail.
+	public class ErrorEvent extends TextEvent
+	{
+		/// Defines the value of the type property of an error event object.
+		public static const ERROR : String = "error";
+
+		/// Creates a copy of the ErrorEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for ErrorEvent objects.
+		public function ErrorEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, text:String = "");
+
+		/// Returns a string that contains all the properties of the ErrorEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/Event.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/Event.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,117 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// The Event class is used as the base class for the creation of Event objects, which are passed as parameters to event listeners when an event occurs.
+	public class Event extends Object
+	{
+		/// The Event.ACTIVATE constant defines the value of the type property of an activate event object.
+		public static const ACTIVATE : String = "activate";
+		/// The Event.ADDED constant defines the value of the type property of an added event object.
+		public static const ADDED : String = "added";
+		/// The Event.ADDED_TO_STAGE constant defines the value of the type property of an addedToStage event object.
+		public static const ADDED_TO_STAGE : String = "addedToStage";
+		/// The Event.CANCEL constant defines the value of the type property of a cancel event object.
+		public static const CANCEL : String = "cancel";
+		/// The Event.CHANGE constant defines the value of the type property of a change event object.
+		public static const CHANGE : String = "change";
+		/// Defines the value of the type property of a clear event object.
+		public static const CLEAR : String = "clear";
+		/// The Event.CLOSE constant defines the value of the type property of a close event object.
+		public static const CLOSE : String = "close";
+		/// The Event.COMPLETE constant defines the value of the type property of a complete event object.
+		public static const COMPLETE : String = "complete";
+		/// The Event.CONNECT constant defines the value of the type property of a connect event object.
+		public static const CONNECT : String = "connect";
+		/// Defines the value of the type property of a copy event object.
+		public static const COPY : String = "copy";
+		/// Defines the value of the type property of a cut event object.
+		public static const CUT : String = "cut";
+		/// The Event.DEACTIVATE constant defines the value of the type property of a deactivate event object.
+		public static const DEACTIVATE : String = "deactivate";
+		/// The Event.ENTER_FRAME constant defines the value of the type property of an enterFrame event object.
+		public static const ENTER_FRAME : String = "enterFrame";
+		/// Defines the value of the type property of an exitFrame event object.
+		public static const EXIT_FRAME : String = "exitFrame";
+		/// Defines the value of the type property of an frameConstructed event object.
+		public static const FRAME_CONSTRUCTED : String = "frameConstructed";
+		/// The Event.FULL_SCREEN constant defines the value of the type property of a fullScreen event object.
+		public static const FULLSCREEN : String = "fullscreen";
+		/// The Event.ID3 constant defines the value of the type property of an id3 event object.
+		public static const ID3 : String = "id3";
+		/// The Event.INIT constant defines the value of the type property of an init event object.
+		public static const INIT : String = "init";
+		/// The Event.MOUSE_LEAVE constant defines the value of the type property of a mouseLeave event object.
+		public static const MOUSE_LEAVE : String = "mouseLeave";
+		/// The Event.OPEN constant defines the value of the type property of an open event object.
+		public static const OPEN : String = "open";
+		/// Defines the value of the type property of a paste event object.
+		public static const PASTE : String = "paste";
+		/// The Event.REMOVED constant defines the value of the type property of a removed event object.
+		public static const REMOVED : String = "removed";
+		/// The Event.REMOVED_FROM_STAGE constant defines the value of the type property of a removedFromStage event object.
+		public static const REMOVED_FROM_STAGE : String = "removedFromStage";
+		/// The Event.RENDER constant defines the value of the type property of a render event object.
+		public static const RENDER : String = "render";
+		/// The Event.RESIZE constant defines the value of the type property of a resize event object.
+		public static const RESIZE : String = "resize";
+		/// The Event.SCROLL constant defines the value of the type property of a scroll event object.
+		public static const SCROLL : String = "scroll";
+		/// The Event.SELECT constant defines the value of the type property of a select event object.
+		public static const SELECT : String = "select";
+		/// Defines the value of the type property of a selectAll event object.
+		public static const SELECT_ALL : String = "selectAll";
+		/// The Event.SOUND_COMPLETE constant defines the value of the type property of a soundComplete event object.
+		public static const SOUND_COMPLETE : String = "soundComplete";
+		/// The Event.TAB_CHILDREN_CHANGE constant defines the value of the type property of a tabChildrenChange event object.
+		public static const TAB_CHILDREN_CHANGE : String = "tabChildrenChange";
+		/// The Event.TAB_ENABLED_CHANGE constant defines the value of the type property of a tabEnabledChange event object.
+		public static const TAB_ENABLED_CHANGE : String = "tabEnabledChange";
+		/// The Event.TAB_INDEX_CHANGE constant defines the value of the type property of a tabIndexChange event object.
+		public static const TAB_INDEX_CHANGE : String = "tabIndexChange";
+		/// The Event.UNLOAD constant defines the value of the type property of an unload event object.
+		public static const UNLOAD : String = "unload";
+
+		/// Indicates whether an event is a bubbling event.
+		public function get bubbles () : Boolean;
+
+		/// Indicates whether the behavior associated with the event can be prevented.
+		public function get cancelable () : Boolean;
+
+		/// The object that is actively processing the Event object with an event listener.
+		public function get currentTarget () : Object;
+
+		/// The current phase in the event flow.
+		public function get eventPhase () : uint;
+
+		/// The event target.
+		public function get target () : Object;
+
+		/// The type of event.
+		public function get type () : String;
+
+		/// Duplicates an instance of an Event subclass.
+		public function clone () : Event;
+
+		/// Used to create new Event object.
+		public function Event (type:String, bubbles:Boolean = false, cancelable:Boolean = false);
+
+		/// A utility function for implementing the toString() method in custom ActionScript 3.0 Event classes.
+		public function formatToString (className:String, ...rest) : String;
+
+		/// Checks whether the preventDefault() method has been called on the event.
+		public function isDefaultPrevented () : Boolean;
+
+		/// Cancels an event's default behavior if that behavior can be canceled.
+		public function preventDefault () : void;
+
+		/// Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow.
+		public function stopImmediatePropagation () : void;
+
+		/// Prevents processing of any event listeners in nodes subsequent to the current node in the event flow.
+		public function stopPropagation () : void;
+
+		/// Returns a string containing all the properties of the Event object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/EventDispatcher.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/EventDispatcher.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,41 @@
+package flash.events
+{
+	import flash.events.Event;
+	import flash.events.IEventDispatcher;
+
+	/**
+	 * [broadcast event] Dispatched when Flash Player loses operating system focus and is becoming inactive.
+	 * @eventType flash.events.Event.DEACTIVATE
+	 */
+	[Event(name="deactivate", type="flash.events.Event")] 
+
+	/**
+	 * [broadcast event] Dispatched when Flash Player gains operating system focus and becomes active.
+	 * @eventType flash.events.Event.ACTIVATE
+	 */
+	[Event(name="activate", type="flash.events.Event")] 
+
+	/// The EventDispatcher class implements the IEventDispatcher interface and is the base class for the DisplayObject class.
+	public class EventDispatcher extends Object implements IEventDispatcher
+	{
+		/// Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
+		public function addEventListener (type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false) : void;
+
+		/// Dispatches an event into the event flow.
+		public function dispatchEvent (event:Event) : Boolean;
+
+		/// Aggregates an instance of the EventDispatcher class.
+		public function EventDispatcher (target:IEventDispatcher = null);
+
+		/// Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
+		public function hasEventListener (type:String) : Boolean;
+
+		/// Removes a listener from the EventDispatcher object.
+		public function removeEventListener (type:String, listener:Function, useCapture:Boolean = false) : void;
+
+		public function toString () : String;
+
+		/// Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
+		public function willTrigger (type:String) : Boolean;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/EventPhase.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/EventPhase.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.events
+{
+	/// The EventPhase class provides values for the eventPhase property of the Event class.
+	public class EventPhase extends Object
+	{
+		/// The target phase, which is the second phase of the event flow.
+		public static const AT_TARGET : uint;
+		/// The bubbling phase, which is the third phase of the event flow.
+		public static const BUBBLING_PHASE : uint;
+		/// The capturing phase, which is the first phase of the event flow.
+		public static const CAPTURING_PHASE : uint;
+
+		public function EventPhase ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/FocusEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/FocusEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,43 @@
+package flash.events
+{
+	import flash.display.InteractiveObject;
+	import flash.events.Event;
+
+	/// Flash Player dispatches FocusEvent objects when the user changes the focus from one object in the display list to another.
+	public class FocusEvent extends Event
+	{
+		/// Defines the value of the type property of a focusIn event object.
+		public static const FOCUS_IN : String = "focusIn";
+		/// Defines the value of the type property of a focusOut event object.
+		public static const FOCUS_OUT : String = "focusOut";
+		/// Defines the value of the type property of a keyFocusChange event object.
+		public static const KEY_FOCUS_CHANGE : String = "keyFocusChange";
+		/// Defines the value of the type property of a mouseFocusChange event object.
+		public static const MOUSE_FOCUS_CHANGE : String = "mouseFocusChange";
+
+		/// Indicates whether the relatedObject property was set to null for security reasons.
+		public function get isRelatedObjectInaccessible () : Boolean;
+		public function set isRelatedObjectInaccessible (value:Boolean) : void;
+
+		/// The key code value of the key pressed to trigger a keyFocusChange event.
+		public function get keyCode () : uint;
+		public function set keyCode (value:uint) : void;
+
+		/// A reference to the complementary InteractiveObject instance that is affected by the change in focus.
+		public function get relatedObject () : InteractiveObject;
+		public function set relatedObject (value:InteractiveObject) : void;
+
+		/// Indicates whether the Shift key modifier is activated, in which case the value is true.
+		public function get shiftKey () : Boolean;
+		public function set shiftKey (value:Boolean) : void;
+
+		/// Creates a copy of the FocusEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for FocusEvent objects.
+		public function FocusEvent (type:String, bubbles:Boolean = true, cancelable:Boolean = false, relatedObject:InteractiveObject = null, shiftKey:Boolean = false, keyCode:uint = 0);
+
+		/// Returns a string that contains all the properties of the FocusEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/FullScreenEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/FullScreenEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,23 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// Flash Player dispatches a FullScreenEvent object whenever the Stage enters or leaves full-screen display mode.
+	public class FullScreenEvent extends ActivityEvent
+	{
+		/// The FullScreenEvent.FULL_SCREEN constant defines the value of the type property of a fullScreen event object.
+		public static const FULL_SCREEN : String = "fullScreen";
+
+		/// Indicates whether the Stage object is in full-screen mode (true) or not (false).
+		public function get fullScreen () : Boolean;
+
+		/// Creates a copy of a FullScreenEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for FullScreenEvent objects.
+		public function FullScreenEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, fullScreen:Boolean = false);
+
+		/// Returns a string that contains all the properties of the FullScreenEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/HTTPStatusEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/HTTPStatusEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,23 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// The application dispatches HTTPStatusEvent objects when a network request returns an HTTPstatus code.
+	public class HTTPStatusEvent extends Event
+	{
+		/// The HTTPStatusEvent.HTTP_STATUS constant defines the value of the type property of a httpStatus event object.
+		public static const HTTP_STATUS : String = "httpStatus";
+
+		/// The HTTP status code returned by the server.
+		public function get status () : int;
+
+		/// Creates a copy of the HTTPStatusEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for HTTPStatusEvent objects.
+		public function HTTPStatusEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, status:int = 0);
+
+		/// Returns a string that contains all the properties of the HTTPStatusEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/IEventDispatcher.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/IEventDispatcher.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,23 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// The IEventDispatcher interface defines methods for adding or removing event listeners, checks whether specific types of event listeners are registered, and dispatches events.
+	public interface IEventDispatcher
+	{
+		/// Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
+		public function addEventListener (type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false) : void;
+
+		/// Dispatches an event into the event flow.
+		public function dispatchEvent (event:Event) : Boolean;
+
+		/// Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
+		public function hasEventListener (type:String) : Boolean;
+
+		/// Removes a listener from the EventDispatcher object.
+		public function removeEventListener (type:String, listener:Function, useCapture:Boolean = false) : void;
+
+		/// Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
+		public function willTrigger (type:String) : Boolean;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/IMEEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/IMEEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,20 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// Flash Player dispatches IMEEvent objects when a user enters text using an input method editor (IME).
+	public class IMEEvent extends TextEvent
+	{
+		/// Defines the value of the type property of an imeComposition event object.
+		public static const IME_COMPOSITION : String = "imeComposition";
+
+		/// Creates a copy of the IMEEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for IMEEvent objects.
+		public function IMEEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, text:String = "");
+
+		/// Returns a string that contains all the properties of the IMEEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/IOErrorEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/IOErrorEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,23 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// Flash Player dispatches an IOErrorEvent object when an error causes a send or load operation to fail.
+	public class IOErrorEvent extends ErrorEvent
+	{
+		public static const DISK_ERROR : String = "diskError";
+		/// Defines the value of the type property of an ioError event object.
+		public static const IO_ERROR : String = "ioError";
+		public static const NETWORK_ERROR : String = "networkError";
+		public static const VERIFY_ERROR : String = "verifyError";
+
+		/// Creates a copy of the IOErrorEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for IOErrorEvent objects.
+		public function IOErrorEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, text:String = "");
+
+		/// Returns a string that contains all the properties of the IOErrorEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/KeyboardEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/KeyboardEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,49 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// Flash Player dispatches KeyboardEvent objects in response to user input through a keyboard.
+	public class KeyboardEvent extends Event
+	{
+		/// Defines the value of the type property of a keyDown event object.
+		public static const KEY_DOWN : String = "keyDown";
+		/// Defines the value of the type property of a keyUp event object.
+		public static const KEY_UP : String = "keyUp";
+
+		/// Indicates whether the Alt key is active (true) or inactive (false).
+		public function get altKey () : Boolean;
+		public function set altKey (value:Boolean) : void;
+
+		/// Contains the character code value of the key pressed or released.
+		public function get charCode () : uint;
+		public function set charCode (value:uint) : void;
+
+		/// Indicates whether the Control key is active (true) or inactive (false).
+		public function get ctrlKey () : Boolean;
+		public function set ctrlKey (value:Boolean) : void;
+
+		/// The key code value of the key pressed or released.
+		public function get keyCode () : uint;
+		public function set keyCode (value:uint) : void;
+
+		/// Indicates the location of the key on the keyboard.
+		public function get keyLocation () : uint;
+		public function set keyLocation (value:uint) : void;
+
+		/// Indicates whether the Shift key modifier is active (true) or inactive (false).
+		public function get shiftKey () : Boolean;
+		public function set shiftKey (value:Boolean) : void;
+
+		/// Creates a copy of the KeyboardEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for KeyboardEvent objects.
+		public function KeyboardEvent (type:String, bubbles:Boolean = true, cancelable:Boolean = false, charCode:uint = 0, keyCode:uint = 0, keyLocation:uint = 0, ctrlKey:Boolean = false, altKey:Boolean = false, shiftKey:Boolean = false);
+
+		/// Returns a string that contains all the properties of the KeyboardEvent object.
+		public function toString () : String;
+
+		/// Instructs Flash Player to render after processing of this event completes, if the display list has been modified
+		public function updateAfterEvent () : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/MouseEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/MouseEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,84 @@
+package flash.events
+{
+	import flash.display.InteractiveObject;
+	import flash.events.Event;
+
+	/// Flash Player dispatches MouseEvent objects into the event flow whenever mouse events occur.
+	public class MouseEvent extends Event
+	{
+		/// Defines the value of the type property of a click event object.
+		public static const CLICK : String = "click";
+		/// Defines the value of the type property of a doubleClick event object.
+		public static const DOUBLE_CLICK : String = "doubleClick";
+		/// Defines the value of the type property of a mouseDown event object.
+		public static const MOUSE_DOWN : String = "mouseDown";
+		/// Defines the value of the type property of a mouseMove event object.
+		public static const MOUSE_MOVE : String = "mouseMove";
+		/// Defines the value of the type property of a mouseOut event object.
+		public static const MOUSE_OUT : String = "mouseOut";
+		/// Defines the value of the type property of a mouseOver event object.
+		public static const MOUSE_OVER : String = "mouseOver";
+		/// Defines the value of the type property of a mouseUp event object.
+		public static const MOUSE_UP : String = "mouseUp";
+		/// Defines the value of the type property of a mouseWheel event object.
+		public static const MOUSE_WHEEL : String = "mouseWheel";
+		/// Defines the value of the type property of a rollOut event object.
+		public static const ROLL_OUT : String = "rollOut";
+		/// Defines the value of the type property of a rollOver event object.
+		public static const ROLL_OVER : String = "rollOver";
+
+		/// Indicates whether the Alt key is active (true) or inactive (false).
+		public function get altKey () : Boolean;
+		public function set altKey (value:Boolean) : void;
+
+		/// Indicates whether the primary mouse button is pressed (true) or not (false).
+		public function get buttonDown () : Boolean;
+		public function set buttonDown (value:Boolean) : void;
+
+		/// Indicates whether the Control key is active (true) or inactive (false).
+		public function get ctrlKey () : Boolean;
+		public function set ctrlKey (value:Boolean) : void;
+
+		/// Indicates how many lines should be scrolled for each unit the user rotates the mouse wheel.
+		public function get delta () : int;
+		public function set delta (value:int) : void;
+
+		/// Indicates whether the relatedObject property was set to null for security reasons.
+		public function get isRelatedObjectInaccessible () : Boolean;
+		public function set isRelatedObjectInaccessible (value:Boolean) : void;
+
+		/// The horizontal coordinate at which the event occurred relative to the containing sprite.
+		public function get localX () : Number;
+		public function set localX (value:Number) : void;
+
+		/// The vertical coordinate at which the event occurred relative to the containing sprite.
+		public function get localY () : Number;
+		public function set localY (value:Number) : void;
+
+		/// A reference to a display list object that is related to the event.
+		public function get relatedObject () : InteractiveObject;
+		public function set relatedObject (value:InteractiveObject) : void;
+
+		/// Indicates whether the Shift key is active (true) or inactive (false).
+		public function get shiftKey () : Boolean;
+		public function set shiftKey (value:Boolean) : void;
+
+		/// The horizontal coordinate at which the event occurred in global Stage coordinates.
+		public function get stageX () : Number;
+
+		/// The vertical coordinate at which the event occurred in global Stage coordinates.
+		public function get stageY () : Number;
+
+		/// Creates a copy of the MouseEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for MouseEvent objects.
+		public function MouseEvent (type:String, bubbles:Boolean = true, cancelable:Boolean = false, localX:Number = null, localY:Number = null, relatedObject:InteractiveObject = null, ctrlKey:Boolean = false, altKey:Boolean = false, shiftKey:Boolean = false, buttonDown:Boolean = false, delta:int = 0);
+
+		/// Returns a string that contains all the properties of the MouseEvent object.
+		public function toString () : String;
+
+		/// Instructs Flash Player to render after processing of this event completes, if the display list has been modified.
+		public function updateAfterEvent () : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/NetFilterEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/NetFilterEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.events
+{
+	import flash.utils.ByteArray;
+	import flash.events.Event;
+
+	public class NetFilterEvent extends Event
+	{
+		public var data : ByteArray;
+		public var header : ByteArray;
+
+		public function clone () : Event;
+
+		public function NetFilterEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, header:ByteArray = null, data:ByteArray = null);
+
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/NetStatusEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/NetStatusEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,24 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// Flash Player dispatches NetStatusEvent objects when a NetConnection, NetStream, orSharedObject object reports its status.
+	public class NetStatusEvent extends Event
+	{
+		/// Defines the value of the type property of a netStatus event object.
+		public static const NET_STATUS : String = "netStatus";
+
+		/// An object with properties that describe the object's status or error condition.
+		public function get info () : Object;
+		public function set info (value:Object) : void;
+
+		/// Creates a copy of the NetStatusEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for NetStatusEvent objects.
+		public function NetStatusEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, info:Object = null);
+
+		/// Returns a string that contains all the properties of the NetStatusEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/ProgressEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/ProgressEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,30 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// Flash Player dispatches ProgressEvent objects when a load operation has begun or a socket has received data.
+	public class ProgressEvent extends Event
+	{
+		/// Defines the value of the type property of a progress event object.
+		public static const PROGRESS : String = "progress";
+		/// Defines the value of the type property of a socketData event object.
+		public static const SOCKET_DATA : String = "socketData";
+
+		/// The number of items or bytes loaded when the listener processes the event.
+		public function get bytesLoaded () : uint;
+		public function set bytesLoaded (value:uint) : void;
+
+		/// The total number of items or bytes that will be loaded if the loading process succeeds.
+		public function get bytesTotal () : uint;
+		public function set bytesTotal (value:uint) : void;
+
+		/// Creates a copy of the ProgressEvent object and sets each property's value to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for ProgressEvent objects.
+		public function ProgressEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, bytesLoaded:uint = 0, bytesTotal:uint = 0);
+
+		/// Returns a string that contains all the properties of the ProgressEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/SampleDataEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/SampleDataEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,28 @@
+package flash.events
+{
+	import flash.utils.ByteArray;
+	import flash.events.Event;
+
+	/// Dispatched when the player requests new audio data.
+	public class SampleDataEvent extends Event
+	{
+		public static const SAMPLE_DATA : String = "sampleData";
+
+		/// The data in the audio stream.
+		public function get data () : ByteArray;
+		public function set data (thedata:ByteArray) : void;
+
+		/// The position of the data in the audio stream.
+		public function get position () : Number;
+		public function set position (theposition:Number) : void;
+
+		/// Creates a copy of the SampleDataEvent object and sets each property's value to match that of the original.
+		public function clone () : Event;
+
+		/// Creates an event object that contains information about audio data events.
+		public function SampleDataEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, theposition:Number = 0, thedata:ByteArray = null);
+
+		/// Returns a string that contains all the properties of the SampleDataEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/SecurityErrorEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/SecurityErrorEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,20 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// Flash Player dispatches SecurityErrorEvent objects to report the occurrence of a security error.
+	public class SecurityErrorEvent extends ErrorEvent
+	{
+		/// The SecurityErrorEvent.SECURITY_ERROR constant defines the value of the type property of a securityError event object.
+		public static const SECURITY_ERROR : String = "securityError";
+
+		/// Creates a copy of the SecurityErrorEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for SecurityErrorEvent objects.
+		public function SecurityErrorEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, text:String = "");
+
+		/// Returns a string that contains all the properties of the SecurityErrorEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/ShaderEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/ShaderEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,34 @@
+package flash.events
+{
+	import flash.utils.ByteArray;
+	import flash.display.BitmapData;
+	import flash.events.Event;
+
+	/// A ShaderEvent is dispatched when a shader operation launched from a ShaderJob finishes.
+	public class ShaderEvent extends Event
+	{
+		/// Defines the value of the type property of a complete event object.
+		public static const COMPLETE : String = "complete";
+
+		/// The BitmapData object that was passed to the ShaderJob.start() method.
+		public function get bitmapData () : BitmapData;
+		public function set bitmapData (bmpData:BitmapData) : void;
+
+		/// The ByteArray object that was passed to the ShaderJob.start() method.
+		public function get byteArray () : ByteArray;
+		public function set byteArray (bArray:ByteArray) : void;
+
+		/// The Vector.<Number> object that was passed to the ShaderJob.start() method.
+		public function get vector () : Vector.<Number>;
+		public function set vector (v:Vector.<Number>) : void;
+
+		/// Creates a copy of the ShaderEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Creates a ShaderEvent object to pass to event listeners.
+		public function ShaderEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, bitmap:BitmapData = null, array:ByteArray = null, vector:Vector.<Number> = null);
+
+		/// Returns a string that contains all the properties of the ShaderEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/StatusEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/StatusEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,28 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// Flash Player dispatches StatusEvent objects when a device, such as a camera or microphone, or an object such as a LocalConnection object reports its status.
+	public class StatusEvent extends Event
+	{
+		/// Defines the value of the type property of a status event object.
+		public static const STATUS : String = "status";
+
+		/// A description of the object's status.
+		public function get code () : String;
+		public function set code (value:String) : void;
+
+		/// The category of the message, such as "status", "warning" or "error".
+		public function get level () : String;
+		public function set level (value:String) : void;
+
+		/// Creates a copy of the StatusEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for StatusEvent objects.
+		public function StatusEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, code:String = "", level:String = "");
+
+		/// Returns a string that contains all the properties of the StatusEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/SyncEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/SyncEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,24 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// Flash Player dispatches SyncEvent objects when a remote SharedObject instance has been updated by the server.
+	public class SyncEvent extends Event
+	{
+		/// Defines the value of the type property of a sync event object.
+		public static const SYNC : String = "sync";
+
+		/// An array of objects; each object contains properties that describe the changed members of a remote shared object.
+		public function get changeList () : Array;
+		public function set changeList (value:Array) : void;
+
+		/// Creates a copy of the SyncEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for SyncEvent objects.
+		public function SyncEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, changeList:Array = null);
+
+		/// Returns a string that contains all the properties of the SyncEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/TextEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/TextEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,26 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// Flash Player dispatches TextEvent objects when a user enters text in a text field or clicks a hyperlink in an HTML-enabled text field.
+	public class TextEvent extends Event
+	{
+		/// Defines the value of the type property of a link event object.
+		public static const LINK : String = "link";
+		/// Defines the value of the type property of a textInput event object.
+		public static const TEXT_INPUT : String = "textInput";
+
+		/// For a textInput event, the character or sequence of characters entered by the user.
+		public function get text () : String;
+		public function set text (value:String) : void;
+
+		/// Creates a copy of the TextEvent object and sets the value of each property to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for TextEvent objects.
+		public function TextEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, text:String = "");
+
+		/// Returns a string that contains all the properties of the TextEvent object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/TimerEvent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/TimerEvent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,25 @@
+package flash.events
+{
+	import flash.events.Event;
+
+	/// Flash Player dispatches TimerEvent objects whenever a Timer object reaches the interval specified by the Timer.delay property.
+	public class TimerEvent extends Event
+	{
+		/// Defines the value of the type property of a timer event object.
+		public static const TIMER : String = "timer";
+		/// Defines the value of the type property of a timerComplete event object.
+		public static const TIMER_COMPLETE : String = "timerComplete";
+
+		/// Creates a copy of the TimerEvent object and sets each property's value to match that of the original.
+		public function clone () : Event;
+
+		/// Constructor for TimerEvent objects.
+		public function TimerEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false);
+
+		/// Returns a string that contains all the properties of the TimerEvent object.
+		public function toString () : String;
+
+		/// Instructs Flash Player to render after processing of this event completes, if the display list has been modified.
+		public function updateAfterEvent () : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/WeakFunctionClosure.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/WeakFunctionClosure.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,7 @@
+package flash.events
+{
+	public class WeakFunctionClosure extends Object
+	{
+		public function WeakFunctionClosure ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/WeakMethodClosure.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/events/WeakMethodClosure.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,7 @@
+package flash.events
+{
+	public class WeakMethodClosure extends Object
+	{
+		public function WeakMethodClosure ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/external/ExternalInterface.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/external/ExternalInterface.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,23 @@
+package flash.external
+{
+	/// The ExternalInterface class is the External API, an application programming interface that enables straightforward communication between ActionScript and the Flash Player container - for example, an HTML page with JavaScript.
+	public class ExternalInterface extends Object
+	{
+		/// Indicates whether the external interface should attempt to pass ActionScript exceptions to the current browser and JavaScript exceptions to Flash Player.
+		public static var marshallExceptions : Boolean;
+
+		/// Indicates whether this player is in a container that offers an external interface.
+		public static function get available () : Boolean;
+
+		/// Returns the id attribute of the object tag in Internet Explorer, or the name attribute of the embed tag in Netscape.
+		public static function get objectID () : String;
+
+		/// Registers an ActionScript method as callable from the container.
+		public static function addCallback (functionName:String, closure:Function) : void;
+
+		/// Calls a function in the container.
+		public static function call (functionName:String, ...rest) : *;
+
+		public function ExternalInterface ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/BevelFilter.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/BevelFilter.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,62 @@
+package flash.filters
+{
+	import flash.filters.BitmapFilter;
+
+	/// The BevelFilter class lets you add a bevel effect to display objects.
+	public class BevelFilter extends BitmapFilter
+	{
+		/// The angle of the bevel.
+		public function get angle () : Number;
+		public function set angle (value:Number) : void;
+
+		/// The amount of horizontal blur, in pixels.
+		public function get blurX () : Number;
+		public function set blurX (value:Number) : void;
+
+		/// The amount of vertical blur, in pixels.
+		public function get blurY () : Number;
+		public function set blurY (value:Number) : void;
+
+		/// The offset distance of the bevel.
+		public function get distance () : Number;
+		public function set distance (value:Number) : void;
+
+		/// The alpha transparency value of the highlight color.
+		public function get highlightAlpha () : Number;
+		public function set highlightAlpha (value:Number) : void;
+
+		/// The highlight color of the bevel.
+		public function get highlightColor () : uint;
+		public function set highlightColor (value:uint) : void;
+
+		/// Applies a knockout effect (true), which effectively makes the object's fill transparent and reveals the background color of the document.
+		public function get knockout () : Boolean;
+		public function set knockout (value:Boolean) : void;
+
+		/// The number of times to apply the filter.
+		public function get quality () : int;
+		public function set quality (value:int) : void;
+
+		/// The alpha transparency value of the shadow color.
+		public function get shadowAlpha () : Number;
+		public function set shadowAlpha (value:Number) : void;
+
+		/// The shadow color of the bevel.
+		public function get shadowColor () : uint;
+		public function set shadowColor (value:uint) : void;
+
+		/// The strength of the imprint or spread.
+		public function get strength () : Number;
+		public function set strength (value:Number) : void;
+
+		/// The placement of the bevel on the object.
+		public function get type () : String;
+		public function set type (value:String) : void;
+
+		/// Initializes a new BevelFilter instance with the specified parameters.
+		public function BevelFilter (distance:Number = 4, angle:Number = 45, highlightColor:uint = 16777215, highlightAlpha:Number = 1, shadowColor:uint = 0, shadowAlpha:Number = 1, blurX:Number = 4, blurY:Number = 4, strength:Number = 1, quality:int = 1, type:String = "inner", knockout:Boolean = false);
+
+		/// Returns a copy of this filter object.
+		public function clone () : BitmapFilter;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/BitmapFilter.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/BitmapFilter.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.filters
+{
+	import flash.filters.BitmapFilter;
+
+	/// The BitmapFilter class is the base class for all image filter effects.
+	public class BitmapFilter extends Object
+	{
+		public function BitmapFilter ();
+
+		/// A copy of the BitmapFilter object.
+		public function clone () : BitmapFilter;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/BitmapFilterQuality.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/BitmapFilterQuality.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.filters
+{
+	/// The BitmapFilterQuality class contains values to set the rendering quality of a BitmapFilter object.
+	public class BitmapFilterQuality extends Object
+	{
+		/// Defines the high quality filter setting.
+		public static const HIGH : int;
+		/// Defines the low quality filter setting.
+		public static const LOW : int;
+		/// Defines the medium quality filter setting.
+		public static const MEDIUM : int;
+
+		public function BitmapFilterQuality ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/BitmapFilterType.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/BitmapFilterType.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.filters
+{
+	/// The BitmapFilterType class contains values to set the type of a BitmapFilter.
+	public class BitmapFilterType extends Object
+	{
+		/// Defines the setting that applies a filter to the entire area of an object.
+		public static const FULL : String;
+		/// Defines the setting that applies a filter to the inner area of an object.
+		public static const INNER : String;
+		/// Defines the setting that applies a filter to the outer area of an object.
+		public static const OUTER : String;
+
+		public function BitmapFilterType ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/BlurFilter.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/BlurFilter.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,26 @@
+package flash.filters
+{
+	import flash.filters.BitmapFilter;
+
+	/// The BlurFilter class lets you apply a blur visual effect to display objects.
+	public class BlurFilter extends BitmapFilter
+	{
+		/// The amount of horizontal blur.
+		public function get blurX () : Number;
+		public function set blurX (value:Number) : void;
+
+		/// The amount of vertical blur.
+		public function get blurY () : Number;
+		public function set blurY (value:Number) : void;
+
+		/// The number of times to perform the blur.
+		public function get quality () : int;
+		public function set quality (value:int) : void;
+
+		/// Initializes the filter.
+		public function BlurFilter (blurX:Number = 4, blurY:Number = 4, quality:int = 1);
+
+		/// Returns a copy of this filter object.
+		public function clone () : BitmapFilter;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/ColorMatrixFilter.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/ColorMatrixFilter.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,18 @@
+package flash.filters
+{
+	import flash.filters.BitmapFilter;
+
+	/// The ColorMatrixFilter class lets you apply a 4 x 5 matrix transformation on the RGBA color and alpha valuesof every pixel in the input image to produce a result with a new set of RGBA color and alpha values.
+	public class ColorMatrixFilter extends BitmapFilter
+	{
+		/// An array of 20 items for 4 x 5 color transform.
+		public function get matrix () : Array;
+		public function set matrix (value:Array) : void;
+
+		/// Returns a copy of this filter object.
+		public function clone () : BitmapFilter;
+
+		/// Initializes a new ColorMatrixFilter instance.
+		public function ColorMatrixFilter (matrix:Array = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/ConvolutionFilter.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/ConvolutionFilter.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,50 @@
+package flash.filters
+{
+	import flash.filters.BitmapFilter;
+
+	/// The ConvolutionFilter class applies a matrix convolution filter effect.
+	public class ConvolutionFilter extends BitmapFilter
+	{
+		/// The alpha transparency value of the substitute color.
+		public function get alpha () : Number;
+		public function set alpha (value:Number) : void;
+
+		/// The amount of bias to add to the result of the matrix transformation.
+		public function get bias () : Number;
+		public function set bias (value:Number) : void;
+
+		/// Indicates whether the image should be clamped.
+		public function get clamp () : Boolean;
+		public function set clamp (value:Boolean) : void;
+
+		/// The hexadecimal color to substitute for pixels that are off the source image.
+		public function get color () : uint;
+		public function set color (value:uint) : void;
+
+		/// The divisor used during matrix transformation.
+		public function get divisor () : Number;
+		public function set divisor (value:Number) : void;
+
+		/// An array of values used for matrix transformation.
+		public function get matrix () : Array;
+		public function set matrix (value:Array) : void;
+
+		/// The x dimension of the matrix (the number of columns in the matrix).
+		public function get matrixX () : Number;
+		public function set matrixX (value:Number) : void;
+
+		/// The y dimension of the matrix (the number of rows in the matrix).
+		public function get matrixY () : Number;
+		public function set matrixY (value:Number) : void;
+
+		/// Indicates if the alpha channel is preserved without the filter effect or if the convolution filter is applied to the alpha channel as well as the color channels.
+		public function get preserveAlpha () : Boolean;
+		public function set preserveAlpha (value:Boolean) : void;
+
+		/// Returns a copy of this filter object.
+		public function clone () : BitmapFilter;
+
+		/// Initializes a ConvolutionFilter instance with the specified parameters.
+		public function ConvolutionFilter (matrixX:Number = 0, matrixY:Number = 0, matrix:Array = null, divisor:Number = 1, bias:Number = 0, preserveAlpha:Boolean = true, clamp:Boolean = true, color:uint = 0, alpha:Number = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/DisplacementMapFilter.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/DisplacementMapFilter.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,52 @@
+package flash.filters
+{
+	import flash.filters.BitmapFilter;
+	import flash.geom.Point;
+	import flash.display.BitmapData;
+
+	/// The DisplacementMapFilter class uses the pixel values from the specified BitmapData object (called the displacement map image) to perform a displacement of an object.
+	public class DisplacementMapFilter extends BitmapFilter
+	{
+		/// Specifies the alpha transparency value to use for out-of-bounds displacements.
+		public function get alpha () : Number;
+		public function set alpha (value:Number) : void;
+
+		/// Specifies what color to use for out-of-bounds displacements.
+		public function get color () : uint;
+		public function set color (value:uint) : void;
+
+		/// Describes which color channel to use in the map image to displace the x result.
+		public function get componentX () : uint;
+		public function set componentX (value:uint) : void;
+
+		/// Describes which color channel to use in the map image to displace the y result.
+		public function get componentY () : uint;
+		public function set componentY (value:uint) : void;
+
+		/// A BitmapData object containing the displacement map data.
+		public function get mapBitmap () : BitmapData;
+		public function set mapBitmap (value:BitmapData) : void;
+
+		/// A value that contains the offset of the upper-left corner of the target display object from the upper-left corner of the map image.
+		public function get mapPoint () : Point;
+		public function set mapPoint (value:Point) : void;
+
+		/// The mode for the filter.
+		public function get mode () : String;
+		public function set mode (value:String) : void;
+
+		/// The multiplier to use to scale the x displacement result from the map calculation.
+		public function get scaleX () : Number;
+		public function set scaleX (value:Number) : void;
+
+		/// The multiplier to use to scale the y displacement result from the map calculation.
+		public function get scaleY () : Number;
+		public function set scaleY (value:Number) : void;
+
+		/// Returns a copy of this filter object.
+		public function clone () : BitmapFilter;
+
+		/// Initializes a DisplacementMapFilter instance.
+		public function DisplacementMapFilter (mapBitmap:BitmapData = null, mapPoint:Point = null, componentX:uint = 0, componentY:uint = 0, scaleX:Number = 0, scaleY:Number = 0, mode:String = "wrap", color:uint = 0, alpha:Number = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/DisplacementMapFilterMode.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/DisplacementMapFilterMode.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.filters
+{
+	/// The DisplacementMapFilterMode class provides values for the mode propertyof the DisplacementMapFilter class.
+	public class DisplacementMapFilterMode extends Object
+	{
+		/// Clamps the displacement value to the edge of the source image.
+		public static const CLAMP : String;
+		/// If the displacement value is outside the image, substitutes the values in the color and alpha properties.
+		public static const COLOR : String;
+		/// If the displacement value is out of range, ignores the displacement and uses the source pixel.
+		public static const IGNORE : String;
+		/// Wraps the displacement value to the other side of the source image.
+		public static const WRAP : String;
+
+		public function DisplacementMapFilterMode ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/DropShadowFilter.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/DropShadowFilter.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,58 @@
+package flash.filters
+{
+	import flash.filters.BitmapFilter;
+
+	/// The DropShadowFilter class lets you add a drop shadow to display objects.
+	public class DropShadowFilter extends BitmapFilter
+	{
+		/// The alpha transparency value for the shadow color.
+		public function get alpha () : Number;
+		public function set alpha (value:Number) : void;
+
+		/// The angle of the shadow.
+		public function get angle () : Number;
+		public function set angle (value:Number) : void;
+
+		/// The amount of horizontal blur.
+		public function get blurX () : Number;
+		public function set blurX (value:Number) : void;
+
+		/// The amount of vertical blur.
+		public function get blurY () : Number;
+		public function set blurY (value:Number) : void;
+
+		/// The color of the shadow.
+		public function get color () : uint;
+		public function set color (value:uint) : void;
+
+		/// The offset distance for the shadow, in pixels.
+		public function get distance () : Number;
+		public function set distance (value:Number) : void;
+
+		/// Indicates whether or not the object is hidden.
+		public function get hideObject () : Boolean;
+		public function set hideObject (value:Boolean) : void;
+
+		/// Indicates whether or not the shadow is an inner shadow.
+		public function get inner () : Boolean;
+		public function set inner (value:Boolean) : void;
+
+		/// Applies a knockout effect (true), which effectively makes the object's fill transparent and reveals the background color of the document.
+		public function get knockout () : Boolean;
+		public function set knockout (value:Boolean) : void;
+
+		/// The number of times to apply the filter.
+		public function get quality () : int;
+		public function set quality (value:int) : void;
+
+		/// The strength of the imprint or spread.
+		public function get strength () : Number;
+		public function set strength (value:Number) : void;
+
+		/// Returns a copy of this filter object.
+		public function clone () : BitmapFilter;
+
+		/// Creates a new DropShadowFilter instance with the specified parameters.
+		public function DropShadowFilter (distance:Number = 4, angle:Number = 45, color:uint = 0, alpha:Number = 1, blurX:Number = 4, blurY:Number = 4, strength:Number = 1, quality:int = 1, inner:Boolean = false, knockout:Boolean = false, hideObject:Boolean = false);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/GlowFilter.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/GlowFilter.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,46 @@
+package flash.filters
+{
+	import flash.filters.BitmapFilter;
+
+	/// The GlowFilter class lets you apply a glow effect to display objects.
+	public class GlowFilter extends BitmapFilter
+	{
+		/// The alpha transparency value for the color.
+		public function get alpha () : Number;
+		public function set alpha (value:Number) : void;
+
+		/// The amount of horizontal blur.
+		public function get blurX () : Number;
+		public function set blurX (value:Number) : void;
+
+		/// The amount of vertical blur.
+		public function get blurY () : Number;
+		public function set blurY (value:Number) : void;
+
+		/// The color of the glow.
+		public function get color () : uint;
+		public function set color (value:uint) : void;
+
+		/// Specifies whether the glow is an inner glow.
+		public function get inner () : Boolean;
+		public function set inner (value:Boolean) : void;
+
+		/// Specifies whether the object has a knockout effect.
+		public function get knockout () : Boolean;
+		public function set knockout (value:Boolean) : void;
+
+		/// The number of times to apply the filter.
+		public function get quality () : int;
+		public function set quality (value:int) : void;
+
+		/// The strength of the imprint or spread.
+		public function get strength () : Number;
+		public function set strength (value:Number) : void;
+
+		/// Returns a copy of this filter object.
+		public function clone () : BitmapFilter;
+
+		/// Initializes a new GlowFilter instance with the specified parameters.
+		public function GlowFilter (color:uint = 16711680, alpha:Number = 1, blurX:Number = 6, blurY:Number = 6, strength:Number = 2, quality:int = 1, inner:Boolean = false, knockout:Boolean = false);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/GradientBevelFilter.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/GradientBevelFilter.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,58 @@
+package flash.filters
+{
+	import flash.filters.BitmapFilter;
+
+	/// The GradientBevelFilter class lets you apply a gradient bevel effect to display objects.
+	public class GradientBevelFilter extends BitmapFilter
+	{
+		/// An array of alpha transparency values for the corresponding colors in the colors array.
+		public function get alphas () : Array;
+		public function set alphas (value:Array) : void;
+
+		/// The angle, in degrees.
+		public function get angle () : Number;
+		public function set angle (value:Number) : void;
+
+		/// The amount of horizontal blur.
+		public function get blurX () : Number;
+		public function set blurX (value:Number) : void;
+
+		/// The amount of vertical blur.
+		public function get blurY () : Number;
+		public function set blurY (value:Number) : void;
+
+		/// An array of RGB hexadecimal color values to use in the gradient.
+		public function get colors () : Array;
+		public function set colors (value:Array) : void;
+
+		/// The offset distance.
+		public function get distance () : Number;
+		public function set distance (value:Number) : void;
+
+		/// Specifies whether the object has a knockout effect.
+		public function get knockout () : Boolean;
+		public function set knockout (value:Boolean) : void;
+
+		/// The number of times to apply the filter.
+		public function get quality () : int;
+		public function set quality (value:int) : void;
+
+		/// An array of color distribution ratios for the corresponding colors in the colors array.
+		public function get ratios () : Array;
+		public function set ratios (value:Array) : void;
+
+		/// The strength of the imprint or spread.
+		public function get strength () : Number;
+		public function set strength (value:Number) : void;
+
+		/// The placement of the bevel effect.
+		public function get type () : String;
+		public function set type (value:String) : void;
+
+		/// Returns a copy of this filter object.
+		public function clone () : BitmapFilter;
+
+		/// Initializes the filter with the specified parameters.
+		public function GradientBevelFilter (distance:Number = 4, angle:Number = 45, colors:Array = null, alphas:Array = null, ratios:Array = null, blurX:Number = 4, blurY:Number = 4, strength:Number = 1, quality:int = 1, type:String = "inner", knockout:Boolean = false);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/GradientGlowFilter.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/GradientGlowFilter.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,58 @@
+package flash.filters
+{
+	import flash.filters.BitmapFilter;
+
+	/// The GradientGlowFilter class lets you apply a gradient glow effect to display objects.
+	public class GradientGlowFilter extends BitmapFilter
+	{
+		/// An array of alpha transparency values for the corresponding colors in the colors array.
+		public function get alphas () : Array;
+		public function set alphas (value:Array) : void;
+
+		/// The angle, in degrees.
+		public function get angle () : Number;
+		public function set angle (value:Number) : void;
+
+		/// The amount of horizontal blur.
+		public function get blurX () : Number;
+		public function set blurX (value:Number) : void;
+
+		/// The amount of vertical blur.
+		public function get blurY () : Number;
+		public function set blurY (value:Number) : void;
+
+		/// An array of colors that defines a gradient.
+		public function get colors () : Array;
+		public function set colors (value:Array) : void;
+
+		/// The offset distance of the glow.
+		public function get distance () : Number;
+		public function set distance (value:Number) : void;
+
+		/// Specifies whether the object has a knockout effect.
+		public function get knockout () : Boolean;
+		public function set knockout (value:Boolean) : void;
+
+		/// The number of times to apply the filter.
+		public function get quality () : int;
+		public function set quality (value:int) : void;
+
+		/// An array of color distribution ratios for the corresponding colors in the colors array.
+		public function get ratios () : Array;
+		public function set ratios (value:Array) : void;
+
+		/// The strength of the imprint or spread.
+		public function get strength () : Number;
+		public function set strength (value:Number) : void;
+
+		/// The placement of the filter effect.
+		public function get type () : String;
+		public function set type (value:String) : void;
+
+		/// Returns a copy of this filter object.
+		public function clone () : BitmapFilter;
+
+		/// Initializes the filter with the specified parameters.
+		public function GradientGlowFilter (distance:Number = 4, angle:Number = 45, colors:Array = null, alphas:Array = null, ratios:Array = null, blurX:Number = 4, blurY:Number = 4, strength:Number = 1, quality:int = 1, type:String = "inner", knockout:Boolean = false);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/ShaderFilter.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/filters/ShaderFilter.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,32 @@
+package flash.filters
+{
+	import flash.geom.Rectangle;
+	import flash.display.Shader;
+
+	/// The ShaderFilter class applies a filter by executing a shader on the object being filtered.
+	public class ShaderFilter extends BitmapFilter
+	{
+		/// The growth in pixels on the bottom side of the target object.
+		public function get bottomExtension () : int;
+		public function set bottomExtension (v:int) : void;
+
+		/// The growth in pixels on the left side of the target object.
+		public function get leftExtension () : int;
+		public function set leftExtension (v:int) : void;
+
+		/// The growth in pixels on the right side of the target object.
+		public function get rightExtension () : int;
+		public function set rightExtension (v:int) : void;
+
+		/// The shader to use for this filter.
+		public function get shader () : Shader;
+		public function set shader (shader:Shader) : void;
+
+		/// The growth in pixels on the top side of the target object.
+		public function get topExtension () : int;
+		public function set topExtension (v:int) : void;
+
+		/// Creates a new shader filter.
+		public function ShaderFilter (shader:Shader = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/ColorTransform.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/ColorTransform.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,38 @@
+package flash.geom
+{
+	import flash.geom.ColorTransform;
+
+	/// The ColorTransform class lets you adjust the color values in a display object.
+	public class ColorTransform extends Object
+	{
+		/// A decimal value that is multiplied with the alpha transparency channel value.
+		public var alphaMultiplier : Number;
+		/// A number from -255 to 255 that is added to the alpha transparency channel value after it has been multiplied by the alphaMultiplier value.
+		public var alphaOffset : Number;
+		/// A decimal value that is multiplied with the blue channel value.
+		public var blueMultiplier : Number;
+		/// A number from -255 to 255 that is added to the blue channel value after it has been multiplied by the blueMultiplier value.
+		public var blueOffset : Number;
+		/// A decimal value that is multiplied with the green channel value.
+		public var greenMultiplier : Number;
+		/// A number from -255 to 255 that is added to the green channel value after it has been multiplied by the greenMultiplier value.
+		public var greenOffset : Number;
+		/// A decimal value that is multiplied with the red channel value.
+		public var redMultiplier : Number;
+		/// A number from -255 to 255 that is added to the red channel value after it has been multiplied by the redMultiplier value.
+		public var redOffset : Number;
+
+		/// The RGB color value for a ColorTransform object.
+		public function get color () : uint;
+		public function set color (newColor:uint) : void;
+
+		/// Creates a ColorTransform object for a display object.
+		public function ColorTransform (redMultiplier:Number = 1, greenMultiplier:Number = 1, blueMultiplier:Number = 1, alphaMultiplier:Number = 1, redOffset:Number = 0, greenOffset:Number = 0, blueOffset:Number = 0, alphaOffset:Number = 0);
+
+		/// Concatenates the ColorTranform object specified by the second parameter with the current ColorTransform object and sets the current object as the result, which is an additive combination of the two color transformations.
+		public function concat (second:ColorTransform) : void;
+
+		/// Formats and returns a string that describes all of the properties of the ColorTransform object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Matrix.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Matrix.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,61 @@
+package flash.geom
+{
+	import flash.geom.Matrix;
+	import flash.geom.Point;
+
+	/// The Matrix class represents a transformation matrix that determines how to map points from one coordinate space to another.
+	public class Matrix extends Object
+	{
+		/// The value that affects the positioning of pixels along the x axis when scaling or rotating an image.
+		public var a : Number;
+		/// The value that affects the positioning of pixels along the y axis when rotating or skewing an image.
+		public var b : Number;
+		/// The value that affects the positioning of pixels along the x axis when rotating or skewing an image.
+		public var c : Number;
+		/// The value that affects the positioning of pixels along the y axis when scaling or rotating an image.
+		public var d : Number;
+		/// The distance by which to translate each point along the x axis.
+		public var tx : Number;
+		/// The distance by which to translate each point along the y axis.
+		public var ty : Number;
+
+		/// Returns a new Matrix object that is a copy of the current matrix.
+		public function clone () : Matrix;
+
+		/// Concatenates a matrix with the current matrix, effectively combining the geometric effects of the two.
+		public function concat (m:Matrix) : void;
+
+		/// Creates a Matrix with scaling, rotation, and translation values.
+		public function createBox (scaleX:Number, scaleY:Number, rotation:Number = 0, tx:Number = 0, ty:Number = 0) : void;
+
+		/// Creates the specific style of matrix expected by the beginGradientFill() method of the Graphics class.
+		public function createGradientBox (width:Number, height:Number, rotation:Number = 0, tx:Number = 0, ty:Number = 0) : void;
+
+		/// Given a point in the pretransform coordinate space, returns the coordinates of that point after the transformation occurs.
+		public function deltaTransformPoint (point:Point) : Point;
+
+		/// Sets each matrix property to a value that causes a null transformation.
+		public function identity () : void;
+
+		/// Performs the opposite transformation of the original matrix.
+		public function invert () : void;
+
+		/// Creates a new two-dimensional Matrix object.
+		public function Matrix (a:Number = 1, b:Number = 0, c:Number = 0, d:Number = 1, tx:Number = 0, ty:Number = 0);
+
+		/// Applies a rotation transformation to the Matrix object.
+		public function rotate (angle:Number) : void;
+
+		/// Applies a scaling transformation to the matrix.
+		public function scale (sx:Number, sy:Number) : void;
+
+		/// Returns a text value listing the properties of this Matrix object.
+		public function toString () : String;
+
+		/// Returns the result of a geometric transformation to a Point object.
+		public function transformPoint (point:Point) : Point;
+
+		/// A transformation that moves an object along the x and y axes.
+		public function translate (dx:Number, dy:Number) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Matrix3D.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Matrix3D.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,83 @@
+package flash.geom
+{
+	import flash.geom.Matrix3D;
+	import flash.geom.Vector3D;
+
+	/// The Matrix3D class represents a transformation matrix that determines the position and orientation of the three-dimensional display object.
+	public class Matrix3D extends Object
+	{
+		/// A Number that determines whether a matrix is invertible.
+		public function get determinant () : Number;
+
+		/// A Vector3D object that holds the position, the three-dimensional coordinate (x,y,z) of a display object within the transformation's frame of reference.
+		public function get position () : Vector3D;
+		public function set position (pos:Vector3D) : void;
+
+		/// A Vector of 16 Numbers, where every four elements can be a row or a column of a 4x4 matrix.
+		public function get rawData () : Vector.<Number>;
+		public function set rawData (v:Vector.<Number>) : void;
+
+		/// Appends the matrix by multiplying another Matrix3D object by the current Matrix3D object.
+		public function append (lhs:Matrix3D) : void;
+
+		/// Appends an incremental rotation to a Matrix3D object.
+		public function appendRotation (degrees:Number, axis:Vector3D, pivotPoint:Vector3D = null) : void;
+
+		/// Appends an incremental scale change along the x, y, and z axes to a Matrix3D object.
+		public function appendScale (xScale:Number, yScale:Number, zScale:Number) : void;
+
+		/// Appends an incremental translation, a repositioning along the x, y, and z axes, to a Matrix3D object.
+		public function appendTranslation (x:Number, y:Number, z:Number) : void;
+
+		/// Returns a new Matrix3D object that is an exact copy of the current Matrix3D object.
+		public function clone () : Matrix3D;
+
+		/// Returns the transformation matrix's translation, rotation, and scale settings as a Vector of three Vector3D objects.
+		public function decompose (orientationStyle:String = "eulerAngles") : Vector.<Vector3D>;
+
+		/// Uses the transformation matrix without its translation elements to transform a Vector3D object from one space coordinate to another.
+		public function deltaTransformVector (v:Vector3D) : Vector3D;
+
+		/// Converts the current matrix to an identity or unit matrix.
+		public function identity () : void;
+
+		/// Interpolates a display object a percent point closer to a target display object.
+		public static function interpolate (thisMat:Matrix3D, toMat:Matrix3D, percent:Number) : Matrix3D;
+
+		/// Interpolates the display object's matrix a percent closer to a target's matrix.
+		public function interpolateTo (toMat:Matrix3D, percent:Number) : void;
+
+		/// Inverts the current matrix.
+		public function invert () : Boolean;
+
+		/// Creates a Matrix3D object.
+		public function Matrix3D (v:Vector.<Number> = null);
+
+		/// Rotates the display object so that it faces a specified position.
+		public function pointAt (pos:Vector3D, at:Vector3D = null, up:Vector3D = null) : void;
+
+		/// Prepends a matrix by multiplying the current Matrix3D object by another Matrix3D object.
+		public function prepend (rhs:Matrix3D) : void;
+
+		/// Prepends an incremental rotation to a Matrix3D object.
+		public function prependRotation (degrees:Number, axis:Vector3D, pivotPoint:Vector3D = null) : void;
+
+		/// Prepends an incremental scale change along the x, y, and z axes to a Matrix3D object.
+		public function prependScale (xScale:Number, yScale:Number, zScale:Number) : void;
+
+		/// Prepends an incremental translation, a repositioning along the x, y, and z axes, to a Matrix3D object.
+		public function prependTranslation (x:Number, y:Number, z:Number) : void;
+
+		/// Sets the transformation matrix's translation, rotation, and scale settings.
+		public function recompose (components:Vector.<Vector3D>, orientationStyle:String = "eulerAngles") : Boolean;
+
+		/// Uses the transformation matrix to transform a Vector3D object from one space coordinate to another.
+		public function transformVector (v:Vector3D) : Vector3D;
+
+		/// Uses the transformation matrix to transform a Vector of Numbers from one coordinate space to another.
+		public function transformVectors (vin:Vector.<Number>, vout:Vector.<Number>) : void;
+
+		/// Converts the current Matrix3D object to a matrix where the rows and columns are swapped.
+		public function transpose () : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Orientation3D.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Orientation3D.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.geom
+{
+	/// The Orientation3D class is an enumeration of constant values for representing the orientation styleof a Matrix3D object.
+	public class Orientation3D extends Object
+	{
+		/// The axis angle orientation uses a combination of an axis and an angle to determine the orientation.
+		public static const AXIS_ANGLE : String;
+		/// Euler angles, the default orientation for decompose() and recompose() methods, defines the orientation with three separate angles of rotation for each axis.
+		public static const EULER_ANGLES : String;
+		/// The quaternion orientation uses complex numbers.
+		public static const QUATERNION : String;
+
+		public function Orientation3D ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/PerspectiveProjection.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/PerspectiveProjection.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,27 @@
+package flash.geom
+{
+	import flash.geom.Point;
+	import flash.geom.Matrix3D;
+
+	/// The PerspectiveProjection class provides an easy way to assign or modify the perspective transformations of a display object and all of its children.
+	public class PerspectiveProjection extends Object
+	{
+		/// Specifies an angle, as a degree between 0 and 180, for the field of view in three dimensions.
+		public function get fieldOfView () : Number;
+		public function set fieldOfView (fieldOfViewAngleInDegrees:Number) : void;
+
+		/// The distance between the eye or the viewpoint's origin (0,0,0) and the display object located in the z axis.
+		public function get focalLength () : Number;
+		public function set focalLength (value:Number) : void;
+
+		/// A two-dimensional point representing the center of the projection, the vanishing point for the display object.
+		public function get projectionCenter () : Point;
+		public function set projectionCenter (p:Point) : void;
+
+		/// Creates an instance of a PerspectiveProjection object.
+		public function PerspectiveProjection ();
+
+		/// Returns the underlying Matrix3D object of the display object.
+		public function toMatrix3D () : Matrix3D;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Point.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Point.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,49 @@
+package flash.geom
+{
+	import flash.geom.Point;
+
+	/// The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
+	public class Point extends Object
+	{
+		/// The horizontal coordinate of the point.
+		public var x : Number;
+		/// The vertical coordinate of the point.
+		public var y : Number;
+
+		/// The length of the line segment from (0,0) to this point.
+		public function get length () : Number;
+
+		/// Adds the coordinates of another point to the coordinates of this point to create a new point.
+		public function add (v:Point) : Point;
+
+		/// Creates a copy of the Point object.
+		public function clone () : Point;
+
+		/// Returns the distance between pt1 and pt2.
+		public static function distance (pt1:Point, pt2:Point) : Number;
+
+		/// Determines whether two points are equal.
+		public function equals (toCompare:Point) : Boolean;
+
+		/// Determines a point between two specified points.
+		public static function interpolate (pt1:Point, pt2:Point, f:Number) : Point;
+
+		/// Scales the line segment between (0,0) and the current point to a set length.
+		public function normalize (thickness:Number) : void;
+
+		/// Offsets the Point object by the specified amount.
+		public function offset (dx:Number, dy:Number) : void;
+
+		/// Creates a new point.
+		public function Point (x:Number = 0, y:Number = 0);
+
+		/// Converts a pair of polar coordinates to a Cartesian point coordinate.
+		public static function polar (len:Number, angle:Number) : Point;
+
+		/// Subtracts the coordinates of another point from the coordinates of this point to create a new point.
+		public function subtract (v:Point) : Point;
+
+		/// Returns a string that contains the values of the x and y coordinates.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Rectangle.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Rectangle.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,94 @@
+package flash.geom
+{
+	import flash.geom.Point;
+	import flash.geom.Rectangle;
+
+	/// A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
+	public class Rectangle extends Object
+	{
+		/// The height of the rectangle, in pixels.
+		public var height : Number;
+		/// The width of the rectangle, in pixels.
+		public var width : Number;
+		/// The x coordinate of the top-left corner of the rectangle.
+		public var x : Number;
+		/// The y coordinate of the top-left corner of the rectangle.
+		public var y : Number;
+
+		/// The sum of the y and height properties.
+		public function get bottom () : Number;
+		public function set bottom (value:Number) : void;
+
+		/// The location of the Rectangle object's bottom-right corner, determined by the values of the right and bottom properties.
+		public function get bottomRight () : Point;
+		public function set bottomRight (value:Point) : void;
+
+		/// The x coordinate of the top-left corner of the rectangle.
+		public function get left () : Number;
+		public function set left (value:Number) : void;
+
+		/// The sum of the x and width properties.
+		public function get right () : Number;
+		public function set right (value:Number) : void;
+
+		/// The size of the Rectangle object, expressed as a Point object with the values of the width and height properties.
+		public function get size () : Point;
+		public function set size (value:Point) : void;
+
+		/// The y coordinate of the top-left corner of the rectangle.
+		public function get top () : Number;
+		public function set top (value:Number) : void;
+
+		/// The location of the Rectangle object's top-left corner, determined by the x and y coordinates of the point.
+		public function get topLeft () : Point;
+		public function set topLeft (value:Point) : void;
+
+		/// Returns a copy of this Rectangle object.
+		public function clone () : Rectangle;
+
+		/// Determines if the specified point is contained within the rectangular region.
+		public function contains (x:Number, y:Number) : Boolean;
+
+		/// Determines if the specified point is contained within the rectangular region defined by this Rectangle object using a Point object as a parameter.
+		public function containsPoint (point:Point) : Boolean;
+
+		/// Determines if the Rectangle object specified by the rect parameter is contained within this Rectangle object.
+		public function containsRect (rect:Rectangle) : Boolean;
+
+		/// Determines if the object specified in the toCompare parameter is equal to this Rectangle object.
+		public function equals (toCompare:Rectangle) : Boolean;
+
+		/// Increases the size of the Rectangle object by the specified amounts, in pixels.
+		public function inflate (dx:Number, dy:Number) : void;
+
+		/// Increases the size of the Rectangle object using a Point object as a parameter.
+		public function inflatePoint (point:Point) : void;
+
+		/// Returns the area of intersection.
+		public function intersection (toIntersect:Rectangle) : Rectangle;
+
+		/// Determines if the object specified in the toIntersect parameter intersects with this Rectangle object.
+		public function intersects (toIntersect:Rectangle) : Boolean;
+
+		/// Determines whether or not this Rectangle object is empty.
+		public function isEmpty () : Boolean;
+
+		/// Adjusts the location of the Rectangle object.
+		public function offset (dx:Number, dy:Number) : void;
+
+		/// Adjusts the location of the Rectangle object using a Point object as a parameter.
+		public function offsetPoint (point:Point) : void;
+
+		/// Creates a new Rectangle object with the top-left corner specified by the x and y parameters and with the specified width and height.
+		public function Rectangle (x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0);
+
+		/// Sets all properties to 0.
+		public function setEmpty () : void;
+
+		/// Builds and returns a string that lists the horizontal and vertical positions and the width and height of the Rectangle object.
+		public function toString () : String;
+
+		/// Adds two rectangles together to create a new Rectangle object.
+		public function union (toUnion:Rectangle) : Rectangle;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Transform.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Transform.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,43 @@
+package flash.geom
+{
+	import flash.geom.Matrix;
+	import flash.geom.Matrix3D;
+	import flash.geom.ColorTransform;
+	import flash.geom.PerspectiveProjection;
+	import flash.display.DisplayObject;
+	import flash.geom.Rectangle;
+
+	/// The Transform class provides access to color adjustment properties and two- or three-dimensional transformation objects that can be applied to a display object.
+	public class Transform extends Object
+	{
+		/// A ColorTransform object containing values that universally adjust the colors in the display object.
+		public function get colorTransform () : ColorTransform;
+		public function set colorTransform (value:ColorTransform) : void;
+
+		/// A ColorTransform object representing the combined color transformations applied to the display object and all of its parent objects, back to the root level.
+		public function get concatenatedColorTransform () : ColorTransform;
+
+		/// A Matrix object representing the combined transformation matrixes of the display object and all of its parent objects, back to the root level.
+		public function get concatenatedMatrix () : Matrix;
+
+		/// A Matrix object containing values that alter the scaling, rotation, and translation of the display object.
+		public function get matrix () : Matrix;
+		public function set matrix (value:Matrix) : void;
+
+		/// Provides access to the Matrix3D object of a three-dimensional display object.
+		public function get matrix3D () : Matrix3D;
+		public function set matrix3D (m:Matrix3D) : void;
+
+		/// Provides access to the PerspectiveProjection object of a three-dimensional display object.
+		public function get perspectiveProjection () : PerspectiveProjection;
+		public function set perspectiveProjection (pm:PerspectiveProjection) : void;
+
+		/// A Rectangle object that defines the bounding rectangle of the display object on the stage.
+		public function get pixelBounds () : Rectangle;
+
+		/// Returns a Matrix3D object, which can transform the space of a specified display object in relation to the current display object's space.
+		public function getRelativeMatrix3D (relativeTo:DisplayObject) : Matrix3D;
+
+		public function Transform (displayObject:DisplayObject);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Utils3D.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Utils3D.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,20 @@
+package flash.geom
+{
+	import flash.geom.Matrix3D;
+	import flash.geom.Vector3D;
+
+	/// The Utils3D class contains static methods that simplify the implementation of certain three-dimensional matrix operations.
+	public class Utils3D extends Object
+	{
+		/// Interpolates the orientation of an object toward a position.
+		public static function pointTowards (percent:Number, mat:Matrix3D, pos:Vector3D, at:Vector3D = null, up:Vector3D = null) : Matrix3D;
+
+		/// Using a projection Matrix3D object, projects a Vector3D object from one space coordinate to another.
+		public static function projectVector (m:Matrix3D, v:Vector3D) : Vector3D;
+
+		/// Projects a Vector of three-dimensional space coordinates to a Vector of two-dimensional space coordinates.
+		public static function projectVectors (m:Matrix3D, verts:Vector.<Number>, projectedVerts:Vector.<Number>, uvts:Vector.<Number>) : void;
+
+		public function Utils3D ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Vector3D.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/geom/Vector3D.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,80 @@
+package flash.geom
+{
+	import flash.geom.Vector3D;
+
+	/// The Vector3D class represents a point or a location in the three-dimensional space using the Cartesian coordinates x, y, and z.
+	public class Vector3D extends Object
+	{
+		/// The fourth element of a Vector3D object (in addition to the x, y, and z properties) can hold data such as the angle of rotation.
+		public var w : Number;
+		/// The first element of a Vector3D object, such as the x coordinate of a point in the three-dimensional space.
+		public var x : Number;
+		/// The x axis defined as a Vector3D object with coordinates (1,0,0).
+		public static const X_AXIS : Vector3D;
+		/// The second element of a Vector3D object, such as the y coordinate of a point in the three-dimensional space.
+		public var y : Number;
+		/// The y axis defined as a Vector3D object with coordinates (0,1,0).
+		public static const Y_AXIS : Vector3D;
+		/// The third element of a Vector3D object, such as the z coordinate of a point in three-dimensional space.
+		public var z : Number;
+		/// The z axis defined as a Vector3D object with coordinates (0,0,1).
+		public static const Z_AXIS : Vector3D;
+
+		/// The length, magnitude, of the current Vector3D object from the origin (0,0,0) to the object's x, y, and z coordinates.
+		public function get length () : Number;
+
+		/// The square of the length of the current Vector3D object, calculated using the x, y, and z properties.
+		public function get lengthSquared () : Number;
+
+		/// Adds the current Vector3D object to another in order to create a new Vector3D object.
+		public function add (a:Vector3D) : Vector3D;
+
+		/// Returns the angle in radians between two vectors.
+		public static function angleBetween (a:Vector3D, b:Vector3D) : Number;
+
+		/// Returns a new Vector3D object that is an exact copy of the current Vector3D object.
+		public function clone () : Vector3D;
+
+		/// Returns a new Vector3D object that is perpendicular (at a right angle) to the current Vector3D and another Vector3D object.
+		public function crossProduct (a:Vector3D) : Vector3D;
+
+		/// Decrements the current Vector3D object by another Vector3D object.
+		public function decrementBy (a:Vector3D) : void;
+
+		/// Returns the distance between two Vector3D objects.
+		public static function distance (pt1:Vector3D, pt2:Vector3D) : Number;
+
+		/// Returns the dot product of current and another Vector3D object.
+		public function dotProduct (a:Vector3D) : Number;
+
+		/// Determines whether two Vector3D objects are equal by comparing the x, y, and z elements of the current Vector3D object with a specified Vector3D object.
+		public function equals (toCompare:Vector3D, allFour:Boolean = false) : Boolean;
+
+		/// Increments the current Vector3D object by another Vector3D object.
+		public function incrementBy (a:Vector3D) : void;
+
+		/// Compares the elements of the current Vector3D object with the elements of a specified Vector3D object to determine whether they are nearly equal.
+		public function nearEquals (toCompare:Vector3D, tolerance:Number, allFour:Boolean = false) : Boolean;
+
+		/// Sets the current Vector3D object to its inverse.
+		public function negate () : void;
+
+		/// Converts a Vector3D object to a unit vector by dividing the first three elements (x, y, z) by the length of the vector.
+		public function normalize () : Number;
+
+		/// Divides the value of the x, y, and z properties of the current Vector3D object by the value of its w property.
+		public function project () : void;
+
+		/// Scales the current Vector3D object by a scalar, a magnitude.
+		public function scaleBy (s:Number) : void;
+
+		/// Subtracts the current Vector3D from another Vector3D object in order to create a new Vector3D object.
+		public function subtract (a:Vector3D) : Vector3D;
+
+		/// Returns a string representation of the current Vector3D object.
+		public function toString () : String;
+
+		/// Creates an instance of a Vector3D object.
+		public function Vector3D (x:Number = 0, y:Number = 0, z:Number = 0, w:Number = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/Camera.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/Camera.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,88 @@
+package flash.media
+{
+	import flash.events.EventDispatcher;
+	import flash.media.Camera;
+
+	/**
+	 * Dispatched when a camera reports its status.
+	 * @eventType flash.events.StatusEvent.STATUS
+	 */
+	[Event(name="status", type="flash.events.StatusEvent")] 
+
+	/**
+	 * Dispatched when a camera begins or ends a session.
+	 * @eventType flash.events.ActivityEvent.ACTIVITY
+	 */
+	[Event(name="activity", type="flash.events.ActivityEvent")] 
+
+	/// Use the Camera class to capture video from a camera attached to a computer running Flash Player.
+	public class Camera extends EventDispatcher
+	{
+		/// The amount of motion the camera is detecting.
+		public function get activityLevel () : Number;
+
+		/// The maximum amount of bandwidth the current outgoing video feed can use, in bytes.
+		public function get bandwidth () : int;
+
+		/// The rate at which the camera is capturing data, in frames per second.
+		public function get currentFPS () : Number;
+
+		/// The maximum rate at which the camera can capture data, in frames per second.
+		public function get fps () : Number;
+
+		/// The current capture height, in pixels.
+		public function get height () : int;
+
+		/// A zero-based integer that specifies the index of the camera, as reflected in the array returned by the names property.
+		public function get index () : int;
+
+		/// The number of video frames transmitted in full (called keyframes) instead of being interpolated by the video compression algorithm.
+		public function get keyFrameInterval () : int;
+
+		/// Indicates whether a local view of what the camera is capturing is compressed and decompressed (true), as it would be for live transmission using Flash Media Server, or uncompressed (false).
+		public function get loopback () : Boolean;
+
+		/// The amount of motion required to invoke the activity event.
+		public function get motionLevel () : int;
+
+		/// The number of milliseconds between the time the camera stops detecting motion and the time the activity event is invoked.
+		public function get motionTimeout () : int;
+
+		/// A Boolean value indicating whether the user has denied access to the camera (true) or allowed access (false) in the Flash Player Privacy dialog box.
+		public function get muted () : Boolean;
+
+		/// The name of the current camera, as returned by the camera hardware.
+		public function get name () : String;
+
+		/// An array of strings indicating the names of all available cameras without displaying the Flash Player Privacy dialog box.
+		public static function get names () : Array;
+
+		/// The required level of picture quality, as determined by the amount of compression being applied to each video frame.
+		public function get quality () : int;
+
+		/// The current capture width, in pixels.
+		public function get width () : int;
+
+		public function Camera ();
+
+		/// Returns a reference to a Camera object for capturing video.
+		public static function getCamera (name:String = null) : Camera;
+
+		public function setCursor (value:Boolean) : void;
+
+		/// Specifies which video frames are transmitted in full (called keyframes) instead of being interpolated by the video compression algorithm.
+		public function setKeyFrameInterval (keyFrameInterval:int) : void;
+
+		/// Specifies whether to use a compressed video stream for a local view of the camera.
+		public function setLoopback (compress:Boolean = false) : void;
+
+		/// Sets the camera capture mode to the native mode that best meets the specified requirements.
+		public function setMode (width:int, height:int, fps:Number, favorArea:Boolean = true) : void;
+
+		/// Specifies how much motion is required to dispatch the activity event.
+		public function setMotionLevel (motionLevel:int, timeout:int = 2000) : void;
+
+		/// Sets the maximum amount of bandwidth per second or the required picture quality of the current outgoing video feed.
+		public function setQuality (bandwidth:int, quality:int) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/ID3Info.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/ID3Info.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,23 @@
+package flash.media
+{
+	/// The ID3Info class contains properties that reflect ID3 metadata.
+	public class ID3Info extends Object
+	{
+		/// The name of the album; corresponds to the ID3 2.0 tag TALB.
+		public var album : String;
+		/// The name of the artist; corresponds to the ID3 2.0 tag TPE1.
+		public var artist : String;
+		/// A comment about the recording; corresponds to the ID3 2.0 tag COMM.
+		public var comment : String;
+		/// The genre of the song; corresponds to the ID3 2.0 tag TCON.
+		public var genre : String;
+		/// The name of the song; corresponds to the ID3 2.0 tag TIT2.
+		public var songName : String;
+		/// The track number; corresponds to the ID3 2.0 tag TRCK.
+		public var track : String;
+		/// The year of the recording; corresponds to the ID3 2.0 tag TYER.
+		public var year : String;
+
+		public function ID3Info ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/Microphone.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/Microphone.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,84 @@
+package flash.media
+{
+	import flash.events.EventDispatcher;
+	import flash.media.Microphone;
+	import flash.media.SoundTransform;
+
+	/**
+	 * Dispatched when a microphone reports its status.
+	 * @eventType flash.events.StatusEvent.STATUS
+	 */
+	[Event(name="status", type="flash.events.StatusEvent")] 
+
+	/**
+	 * Dispatched when a microphone begins or ends a session.
+	 * @eventType flash.events.ActivityEvent.ACTIVITY
+	 */
+	[Event(name="activity", type="flash.events.ActivityEvent")] 
+
+	/// Use the Microphone class to capture audio from a microphone attached to a computer running Flash Player.
+	public class Microphone extends EventDispatcher
+	{
+		/// The amount of sound the microphone is detecting.
+		public function get activityLevel () : Number;
+
+		/// The codec to use for compressing audio.
+		public function get codec () : String;
+		public function set codec (codec:String) : void;
+
+		/// The encoded speech quality when using the Speex codec.
+		public function get encodeQuality () : int;
+		public function set encodeQuality (quality:int) : void;
+
+		/// Number of Speex speech frames transmitted in a packet (message).
+		public function get framesPerPacket () : int;
+		public function set framesPerPacket (frames:int) : void;
+
+		/// The microphone gain--that is, the amount by which the microphone multiplies the signal before transmitting it.
+		public function get gain () : Number;
+		public function set gain (gain:Number) : void;
+
+		/// The index of the microphone, as reflected in the array returned by Microphone.names.
+		public function get index () : int;
+
+		/// Specifies whether the user has denied access to the microphone (true) or allowed access (false).
+		public function get muted () : Boolean;
+
+		/// The name of the current sound capture device, as returned by the sound capture hardware.
+		public function get name () : String;
+
+		/// An array of strings containing the names of all available sound capture devices.
+		public static function get names () : Array;
+
+		/// The rate at which the microphone captures sound, in kHz.
+		public function get rate () : int;
+		public function set rate (rate:int) : void;
+
+		/// The amount of sound required to activate the microphone and dispatch the activity event.
+		public function get silenceLevel () : Number;
+
+		/// The number of milliseconds between the time the microphone stops detecting sound and the time the activity event is dispatched.
+		public function get silenceTimeout () : int;
+
+		/// Controls the sound of this microphone object when it is in loopback mode.
+		public function get soundTransform () : SoundTransform;
+		public function set soundTransform (sndTransform:SoundTransform) : void;
+
+		/// Set to true if echo suppression is enabled; false otherwise.
+		public function get useEchoSuppression () : Boolean;
+
+		/// Returns a reference to a Microphone object for capturing audio.
+		public static function getMicrophone (index:int = -1) : Microphone;
+
+		public function Microphone ();
+
+		/// Routes audio captured by a microphone to the local speakers.
+		public function setLoopBack (state:Boolean = true) : void;
+
+		/// Sets the minimum input level that should be considered sound and (optionally) the amount of silent time signifying that silence has actually begun.
+		public function setSilenceLevel (silenceLevel:Number, timeout:int = -1) : void;
+
+		/// Specifies whether to use the echo suppression feature of the audio codec.
+		public function setUseEchoSuppression (useEchoSuppression:Boolean) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/Sound.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/Sound.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,83 @@
+package flash.media
+{
+	import flash.events.EventDispatcher;
+	import flash.utils.ByteArray;
+	import flash.net.URLRequest;
+	import flash.media.SoundLoaderContext;
+	import flash.media.SoundChannel;
+	import flash.media.SoundTransform;
+	import flash.media.ID3Info;
+
+	/**
+	 * Dispatched when data is received as a load operation progresses.
+	 * @eventType flash.events.ProgressEvent.PROGRESS
+	 */
+	[Event(name="progress", type="flash.events.ProgressEvent")] 
+
+	/**
+	 * Dispatched when a load operation starts.
+	 * @eventType flash.events.Event.OPEN
+	 */
+	[Event(name="open", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when an input/output error occurs that causes a load operation to fail.
+	 * @eventType flash.events.IOErrorEvent.IO_ERROR
+	 */
+	[Event(name="ioError", type="flash.events.IOErrorEvent")] 
+
+	/**
+	 * Dispatched by a Sound object when ID3 data is available for an MP3 sound.
+	 * @eventType flash.events.Event.ID3
+	 */
+	[Event(name="id3", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when data has loaded successfully.
+	 * @eventType flash.events.Event.COMPLETE
+	 */
+	[Event(name="complete", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when the player requests new audio data.
+	 * @eventType flash.events.SampleDataEvent.SAMPLE_DATA
+	 */
+	[Event(name="sampleData", type="flash.events.SampleDataEvent")] 
+
+	/// The Sound class lets you work with sound in an application.
+	public class Sound extends EventDispatcher
+	{
+		/// Returns the currently available number of bytes in this sound object.
+		public function get bytesLoaded () : uint;
+
+		/// Returns the total number of bytes in this sound object.
+		public function get bytesTotal () : int;
+
+		/// Provides access to the metadata that is part of an MP3 file.
+		public function get id3 () : ID3Info;
+
+		/// Returns the buffering state of external MP3 files.
+		public function get isBuffering () : Boolean;
+
+		/// The length of the current sound in milliseconds.
+		public function get length () : Number;
+
+		/// The URL from which this sound was loaded.
+		public function get url () : String;
+
+		/// Closes the stream, causing any download of data to cease.
+		public function close () : void;
+
+		/// Extracts raw sound data from a Sound object.
+		public function extract (target:ByteArray, length:Number, startPosition:Number = -1) : Number;
+
+		/// Initiates loading of an external MP3 file from the specified URL.
+		public function load (stream:URLRequest, context:SoundLoaderContext = null) : void;
+
+		/// Generates a new SoundChannel object to play back the sound.
+		public function play (startTime:Number = 0, loops:int = 0, sndTransform:SoundTransform = null) : SoundChannel;
+
+		/// Creates a new Sound object.
+		public function Sound (stream:URLRequest = null, context:SoundLoaderContext = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/SoundChannel.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/SoundChannel.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,33 @@
+package flash.media
+{
+	import flash.events.EventDispatcher;
+	import flash.media.SoundTransform;
+
+	/**
+	 * Dispatched when a sound has finished playing.
+	 * @eventType flash.events.Event.SOUND_COMPLETE
+	 */
+	[Event(name="soundComplete", type="flash.events.Event")] 
+
+	/// The SoundChannel class controls a sound in an application.
+	public class SoundChannel extends EventDispatcher
+	{
+		/// The current amplitude (volume) of the left channel, from 0 (silent) to 1 (full amplitude).
+		public function get leftPeak () : Number;
+
+		/// When the sound is playing, the position property indicates the current point that is being played in the sound file.
+		public function get position () : Number;
+
+		/// The current amplitude (volume) of the right channel, from 0 (silent) to 1 (full amplitude).
+		public function get rightPeak () : Number;
+
+		/// The SoundTransform object assigned to the sound channel.
+		public function get soundTransform () : SoundTransform;
+		public function set soundTransform (sndTransform:SoundTransform) : void;
+
+		public function SoundChannel ();
+
+		/// Stops the sound playing in the channel.
+		public function stop () : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/SoundCodec.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/SoundCodec.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.media
+{
+	/// The SoundCodec class is an enumeration of constant values used in setting the codec propertyof the Microphone class.
+	public class SoundCodec extends Object
+	{
+		/// Specifies that the Nellymoser codec be used for compressing audio.
+		public static const NELLYMOSER : String;
+		/// Specifies that the Speex codec be used for compressing audio.
+		public static const SPEEX : String;
+
+		public function SoundCodec ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/SoundLoaderContext.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/SoundLoaderContext.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,14 @@
+package flash.media
+{
+	/// The SoundLoaderContext class provides security checks for SWF files that load sound.
+	public class SoundLoaderContext extends Object
+	{
+		/// The number of milliseconds to preload a streaming sound into a buffer before the sound starts to stream.
+		public var bufferTime : Number;
+		/// Specifies whether Flash Player should try to download a URL policy file from the loaded sound's server before beginning to load the sound.
+		public var checkPolicyFile : Boolean;
+
+		/// Creates a new sound loader context object.
+		public function SoundLoaderContext (bufferTime:Number = 1000, checkPolicyFile:Boolean = false);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/SoundMixer.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/SoundMixer.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,28 @@
+package flash.media
+{
+	import flash.media.SoundTransform;
+	import flash.utils.ByteArray;
+
+	/// The SoundMixer class contains static properties and methods for global sound controlin the SWF file.
+	public class SoundMixer extends Object
+	{
+		/// The number of seconds to preload an embedded streaming sound into a buffer before it starts to stream.
+		public static function get bufferTime () : int;
+		public static function set bufferTime (bufferTime:int) : void;
+
+		/// The SoundTransform object that controls global sound properties.
+		public static function get soundTransform () : SoundTransform;
+		public static function set soundTransform (sndTransform:SoundTransform) : void;
+
+		/// Determines whether any sounds are not accessible due to security restrictions.
+		public static function areSoundsInaccessible () : Boolean;
+
+		/// Takes a snapshot of the current sound wave and places it into the specified ByteArray object.
+		public static function computeSpectrum (outputArray:ByteArray, FFTMode:Boolean = false, stretchFactor:int = 0) : void;
+
+		public function SoundMixer ();
+
+		/// Stops all sounds currently playing.
+		public static function stopAll () : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/SoundTransform.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/SoundTransform.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,33 @@
+package flash.media
+{
+	/// The SoundTransform class contains properties for volume and panning.
+	public class SoundTransform extends Object
+	{
+		/// A value, from 0 (none) to 1 (all), specifying how much of the left input is played in the left speaker.
+		public function get leftToLeft () : Number;
+		public function set leftToLeft (leftToLeft:Number) : void;
+
+		/// A value, from 0 (none) to 1 (all), specifying how much of the left input is played in the right speaker.
+		public function get leftToRight () : Number;
+		public function set leftToRight (leftToRight:Number) : void;
+
+		/// The left-to-right panning of the sound, ranging from -1 (full pan left) to 1 (full pan right).
+		public function get pan () : Number;
+		public function set pan (panning:Number) : void;
+
+		/// A value, from 0 (none) to 1 (all), specifying how much of the right input is played in the left speaker.
+		public function get rightToLeft () : Number;
+		public function set rightToLeft (rightToLeft:Number) : void;
+
+		/// A value, from 0 (none) to 1 (all), specifying how much of the right input is played in the right speaker.
+		public function get rightToRight () : Number;
+		public function set rightToRight (rightToRight:Number) : void;
+
+		/// The volume, ranging from 0 (silent) to 1 (full volume).
+		public function get volume () : Number;
+		public function set volume (volume:Number) : void;
+
+		/// Creates a SoundTransform object.
+		public function SoundTransform (vol:Number = 1, panning:Number = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/Video.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/Video.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,36 @@
+package flash.media
+{
+	import flash.display.DisplayObject;
+	import flash.media.Camera;
+	import flash.net.NetStream;
+
+	/// The Video class displays live or recorded video in an application without embedding the video in your SWF file.
+	public class Video extends DisplayObject
+	{
+		/// Indicates the type of filter applied to decoded video as part of post-processing.
+		public function get deblocking () : int;
+		public function set deblocking (value:int) : void;
+
+		/// Specifies whether the video should be smoothed (interpolated) when it is scaled.
+		public function get smoothing () : Boolean;
+		public function set smoothing (value:Boolean) : void;
+
+		/// An integer specifying the height of the video stream, in pixels.
+		public function get videoHeight () : int;
+
+		/// An integer specifying the width of the video stream, in pixels.
+		public function get videoWidth () : int;
+
+		/// Specifies a video stream from a camera to be displayed within the boundaries of the Video object in the application.
+		public function attachCamera (camera:Camera) : void;
+
+		/// Specifies a video stream to be displayed within the boundaries of the Video object in the application.
+		public function attachNetStream (netStream:NetStream) : void;
+
+		/// Clears the image currently displayed in the Video object (not the video stream).
+		public function clear () : void;
+
+		/// Creates a new Video instance.
+		public function Video (width:int = 320, height:int = 240);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/package.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/media/package.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,6 @@
+package flash.media 
+{
+	/// Forces a rescan of the microphones and cameras on the system.
+	public function scanHardware():void;
+	
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/DynamicPropertyOutput.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/DynamicPropertyOutput.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,9 @@
+package flash.net
+{
+	public class DynamicPropertyOutput extends Object implements IDynamicPropertyOutput
+	{
+		public function DynamicPropertyOutput ();
+
+		public function writeDynamicProperty (name:String, value:*) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/FileFilter.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/FileFilter.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,21 @@
+package flash.net
+{
+	/// The FileFilter class is used to indicate what files on the user's system are shown in the file-browsing dialog box that is displayed when FileReference.browse() or FileReferenceList.browse() is called.
+	public class FileFilter extends Object
+	{
+		/// The description string for the filter.
+		public function get description () : String;
+		public function set description (value:String) : void;
+
+		/// A list of file extensions.
+		public function get extension () : String;
+		public function set extension (value:String) : void;
+
+		/// A list of Macintosh file types.
+		public function get macType () : String;
+		public function set macType (value:String) : void;
+
+		/// Creates a new FileFilter instance.
+		public function FileFilter (description:String, extension:String, macType:String = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/FileReference.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/FileReference.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,112 @@
+package flash.net
+{
+	import flash.events.EventDispatcher;
+	import flash.net.URLRequest;
+	import flash.utils.ByteArray;
+
+	/**
+	 * Dispatched after data is received from the server after a successful upload.
+	 * @eventType flash.events.DataEvent.UPLOAD_COMPLETE_DATA
+	 */
+	[Event(name="uploadCompleteData", type="flash.events.DataEvent")] 
+
+	/**
+	 * Dispatched if a call to the upload() or uploadUnencoded() method attempts to access data over HTTP and Adobe AIR is able to detect and return the status code for the request.
+	 * @eventType flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS
+	 */
+	[Event(name="httpResponseStatus", type="flash.events.HTTPStatusEvent")] 
+
+	/**
+	 * Dispatched when an upload fails and an HTTP status code is available to describe the failure.
+	 * @eventType flash.events.HTTPStatusEvent.HTTP_STATUS
+	 */
+	[Event(name="httpStatus", type="flash.events.HTTPStatusEvent")] 
+
+	/**
+	 * Dispatched when the user selects a file for upload or download from the file-browsing dialog box.
+	 * @eventType flash.events.Event.SELECT
+	 */
+	[Event(name="select", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when a call to the FileReference.upload() or FileReference.download() method tries to upload a file to a server or get a file from a server that is outside the caller's security sandbox.
+	 * @eventType flash.events.SecurityErrorEvent.SECURITY_ERROR
+	 */
+	[Event(name="securityError", type="flash.events.SecurityErrorEvent")] 
+
+	/**
+	 * Dispatched periodically during the file upload or download operation.
+	 * @eventType flash.events.ProgressEvent.PROGRESS
+	 */
+	[Event(name="progress", type="flash.events.ProgressEvent")] 
+
+	/**
+	 * Dispatched when an upload or download operation starts.
+	 * @eventType flash.events.Event.OPEN
+	 */
+	[Event(name="open", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when the upload or download fails.
+	 * @eventType flash.events.IOErrorEvent.IO_ERROR
+	 */
+	[Event(name="ioError", type="flash.events.IOErrorEvent")] 
+
+	/**
+	 * Dispatched when download is complete or when upload generates an HTTP status code of 200.
+	 * @eventType flash.events.Event.COMPLETE
+	 */
+	[Event(name="complete", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when a file upload or download is canceled through the file-browsing dialog box by the user.
+	 * @eventType flash.events.Event.CANCEL
+	 */
+	[Event(name="cancel", type="flash.events.Event")] 
+
+	/// The FileReference class provides a means to upload and download files between a user's computer and a server.
+	public class FileReference extends EventDispatcher
+	{
+		/// The creation date of the file on the local disk.
+		public function get creationDate () : Date;
+
+		/// The Macintosh creator type of the file, which is only used in Mac OS versions prior to Mac OS X.
+		public function get creator () : String;
+
+		/// The ByteArray representing the loaded file after a successful call to load().
+		public function get data () : ByteArray;
+
+		/// The date that the file on the local disk was last modified.
+		public function get modificationDate () : Date;
+
+		/// The name of the file on the local disk.
+		public function get name () : String;
+
+		/// The size of the file on the local disk in bytes.
+		public function get size () : uint;
+
+		/// The file type.
+		public function get type () : String;
+
+		/// Displays a file-browsing dialog box that lets the user select a file to upload.
+		public function browse (typeFilter:Array = null) : Boolean;
+
+		/// Cancels any ongoing upload or download.
+		public function cancel () : void;
+
+		/// Opens a dialog box that lets the user download a file from a remote server.
+		public function download (request:URLRequest, defaultFileName:String = null) : void;
+
+		/// Creates a new FileReference object.
+		public function FileReference ();
+
+		/// Starts the load of a local file.
+		public function load () : void;
+
+		/// Opens a dialog box that lets the user save a file to the local filesystem.
+		public function save (data:*, defaultFileName:String = null) : void;
+
+		/// Starts the upload of a file to a remote server.
+		public function upload (request:URLRequest, uploadDataFieldName:String = "Filedata", testUpload:Boolean = false) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/FileReferenceList.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/FileReferenceList.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,29 @@
+package flash.net
+{
+	import flash.events.EventDispatcher;
+
+	/**
+	 * Dispatched when the user selects one or more files to upload from the file-browsing dialog box.
+	 * @eventType flash.events.Event.SELECT
+	 */
+	[Event(name="select", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when the user dismisses the file-browsing dialog box.
+	 * @eventType flash.events.Event.CANCEL
+	 */
+	[Event(name="cancel", type="flash.events.Event")] 
+
+	/// The FileReferenceList class provides a means to let users select one or more files for uploading.
+	public class FileReferenceList extends EventDispatcher
+	{
+		/// An array of FileReference objects.
+		public function get fileList () : Array;
+
+		/// Displays a file-browsing dialog box that lets the user select local files to upload.
+		public function browse (typeFilter:Array = null) : Boolean;
+
+		/// Creates a new FileReferenceList object.
+		public function FileReferenceList ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/IDynamicPropertyOutput.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/IDynamicPropertyOutput.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,9 @@
+package flash.net
+{
+	/// This interface controls the serialization of dynamic properties of dynamic objects.
+	public interface IDynamicPropertyOutput
+	{
+		/// Adds a dynamic property to the binary output of a serialized object.
+		public function writeDynamicProperty (name:String, value:*) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/IDynamicPropertyWriter.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/IDynamicPropertyWriter.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,11 @@
+package flash.net
+{
+	import flash.net.IDynamicPropertyOutput;
+
+	/// This interface is used with the IDynamicPropertyOutput interface to control the serialization of dynamic properties of dynamic objects.
+	public interface IDynamicPropertyWriter
+	{
+		/// Writes the name and value of an IDynamicPropertyOutput object to an object with dynamic properties.
+		public function writeDynamicProperties (obj:Object, output:IDynamicPropertyOutput) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/LocalConnection.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/LocalConnection.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,51 @@
+package flash.net
+{
+	import flash.events.EventDispatcher;
+
+	/**
+	 * Dispatched when a LocalConnection object reports its status.
+	 * @eventType flash.events.StatusEvent.STATUS
+	 */
+	[Event(name="status", type="flash.events.StatusEvent")] 
+
+	/**
+	 * Dispatched if a call to LocalConnection.send() attempts to send data to a different security sandbox.
+	 * @eventType flash.events.SecurityErrorEvent.SECURITY_ERROR
+	 */
+	[Event(name="securityError", type="flash.events.SecurityErrorEvent")] 
+
+	/**
+	 * Dispatched when an exception is thrown asynchronously -- that is, from native asynchronous code.
+	 * @eventType flash.events.AsyncErrorEvent.ASYNC_ERROR
+	 */
+	[Event(name="asyncError", type="flash.events.AsyncErrorEvent")] 
+
+	/// The LocalConnection class lets you create a LocalConnection object that can invoke a method in another LocalConnection object, either within a single SWF file or between multiple SWF files.
+	public class LocalConnection extends EventDispatcher
+	{
+		/// Indicates the object on which callback methods are invoked.
+		public function get client () : Object;
+		public function set client (client:Object) : void;
+
+		/// A string representing the domain of the location of the current SWF file.
+		public function get domain () : String;
+
+		/// Specifies one or more domains that can send LocalConnection calls to this LocalConnection instance.
+		public function allowDomain (...rest) : void;
+
+		/// Specifies one or more domains that can send LocalConnection calls to this LocalConnection object.
+		public function allowInsecureDomain (...rest) : void;
+
+		/// Closes (disconnects) a LocalConnection object.
+		public function close () : void;
+
+		/// Prepares a LocalConnection object to receive commands from a send() command (called the sending LocalConnection object).
+		public function connect (connectionName:String) : void;
+
+		/// Creates a LocalConnection object.
+		public function LocalConnection ();
+
+		/// Invokes the method named methodName on a connection opened with the connect(<code>connectionName<code>) method (the receiving LocalConnection object).
+		public function send (connectionName:String, methodName:String, ...rest) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/NetConnection.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/NetConnection.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,98 @@
+package flash.net
+{
+	import flash.events.EventDispatcher;
+	import flash.net.Responder;
+
+	/**
+	 * Dispatched when a NetConnection object is reporting its status or error condition.
+	 * @eventType flash.events.NetStatusEvent.NET_STATUS
+	 */
+	[Event(name="netStatus", type="flash.events.NetStatusEvent")] 
+
+	/**
+	 * Dispatched if a call to NetConnection.call() attempts to connect to a server outside the caller's security sandbox.
+	 * @eventType flash.events.SecurityErrorEvent.SECURITY_ERROR
+	 */
+	[Event(name="securityError", type="flash.events.SecurityErrorEvent")] 
+
+	/**
+	 * Dispatched when an input or output error occurs that causes a network operation to fail.
+	 * @eventType flash.events.IOErrorEvent.IO_ERROR
+	 */
+	[Event(name="ioError", type="flash.events.IOErrorEvent")] 
+
+	/**
+	 * Dispatched when an exception is thrown asynchronously -- that is, from native asynchronous code.
+	 * @eventType flash.events.AsyncErrorEvent.ASYNC_ERROR
+	 */
+	[Event(name="asyncError", type="flash.events.AsyncErrorEvent")] 
+
+	/// The NetConnection class creates a bidirectional connection between Flash Player and a Flash Media Server application or between Flash Player and an application server running Flash Remoting.
+	public class NetConnection extends EventDispatcher
+	{
+		/// Indicates the object on which callback methods should be invoked.
+		public function get client () : Object;
+		public function set client (object:Object) : void;
+
+		/// Indicates whether Flash Player is connected to a server through a persistent RTMP connection (true) or not (false).
+		public function get connected () : Boolean;
+
+		/// The proxy type used to make a successful NetConnection.connect() call to Flash Media Server: "none", "HTTP", "HTTPS", or "CONNECT".
+		public function get connectedProxyType () : String;
+
+		/// The default object encoding for NetConnection objects created in the SWF file.
+		public static function get defaultObjectEncoding () : uint;
+		public static function set defaultObjectEncoding (version:uint) : void;
+
+		/// The identifier of the Flash Media Server instance to which this Flash Player or Adobe AIR instance is connected.
+		public function get farID () : String;
+
+		/// A value chosen substantially by Flash Media Server, unique to this connection.
+		public function get farNonce () : String;
+
+		/// The total number of inbound and outbound peer connections that this instance of Flash Player or Adobe AIR allows.
+		public function get maxPeerConnections () : uint;
+		public function set maxPeerConnections (maxPeers:uint) : void;
+
+		/// The identifier of this Flash Player or Adobe AIR instance for this NetConnection instance.
+		public function get nearID () : String;
+
+		/// A value chosen substantially by this Flash Player or Adobe AIR instance, unique to this connection.
+		public function get nearNonce () : String;
+
+		/// The object encoding for this NetConnection instance.
+		public function get objectEncoding () : uint;
+		public function set objectEncoding (version:uint) : void;
+
+		/// The protocol used to establish the connection.
+		public function get protocol () : String;
+
+		/// Determines which fallback methods are tried if an initial connection attempt to the server fails.
+		public function get proxyType () : String;
+		public function set proxyType (ptype:String) : void;
+
+		/// An object that holds all of the peer subscriber NetStream objects that are not associated with publishing NetStream objects.
+		public function get unconnectedPeerStreams () : Array;
+
+		/// The URI passed to the NetConnection.connect() method.
+		public function get uri () : String;
+
+		/// Indicates whether a secure connection was made using native Transport Layer Security (TLS) rather than HTTPS.
+		public function get usingTLS () : Boolean;
+
+		/// Adds a context header to the Action Message Format (AMF) packet structure.
+		public function addHeader (operation:String, mustUnderstand:Boolean = false, param:Object = null) : void;
+
+		/// Invokes a command or method on Flash Media Server or on an application server running Flash Remoting.
+		public function call (command:String, responder:Responder, ...rest) : void;
+
+		/// Closes the connection that was opened locally or to the server and dispatches a netStatus event with a code property of NetConnection.Connect.Closed.
+		public function close () : void;
+
+		/// Creates a bidirectional connection between Flash Player and a Flash Media Server application.
+		public function connect (command:String, ...rest) : void;
+
+		/// Creates a NetConnection object.
+		public function NetConnection ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/NetStream.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/NetStream.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,185 @@
+package flash.net
+{
+	import flash.events.EventDispatcher;
+	import flash.media.SoundTransform;
+	import flash.media.Camera;
+	import flash.media.Microphone;
+	import flash.net.NetConnection;
+	import flash.net.NetStream;
+	import flash.net.Responder;
+	import flash.net.NetStreamInfo;
+	import flash.net.NetStreamPlayOptions;
+
+	/**
+	 * Establishes a listener to respond when a NetStream object has completely played a stream.
+	 * @eventType flash.events.
+	 */
+	[Event(name="onPlayStatus", type="flash.events")] 
+
+	/**
+	 * Establishes a listener to respond when an embedded cue point is reached while playing a video file.
+	 * @eventType flash.events.
+	 */
+	[Event(name="onCuePoint", type="flash.events")] 
+
+	/**
+	 * Establishes a listener to respond when Flash Player receives text data embedded in a media file that is playing.
+	 * @eventType flash.events.
+	 */
+	[Event(name="onTextData", type="flash.events")] 
+
+	/**
+	 * Establishes a listener to respond when Flash Player receives image data as a byte array embedded in a media file that is playing.
+	 * @eventType flash.events.
+	 */
+	[Event(name="onImageData", type="flash.events")] 
+
+	/**
+	 * Establishes a listener to respond when Flash Player receives descriptive information embedded in the video being played.
+	 * @eventType flash.events.
+	 */
+	[Event(name="onMetaData", type="flash.events")] 
+
+	/**
+	 * Establishes a listener to respond when Flash Player receives information specific to Adobe Extensible Metadata Platform (XMP) embedded in the video being played.
+	 * @eventType flash.events.
+	 */
+	[Event(name="onXMPData", type="flash.events")] 
+
+	/**
+	 * Dispatched when a NetStream object is reporting its status or error condition.
+	 * @eventType flash.events.NetStatusEvent.NET_STATUS
+	 */
+	[Event(name="netStatus", type="flash.events.NetStatusEvent")] 
+
+	/**
+	 * Dispatched when an input or output error occurs that causes a network operation to fail.
+	 * @eventType flash.events.IOErrorEvent.IO_ERROR
+	 */
+	[Event(name="ioError", type="flash.events.IOErrorEvent")] 
+
+	/**
+	 * Dispatched when an exception is thrown asynchronously -- that is, from native asynchronous code.
+	 * @eventType flash.events.AsyncErrorEvent.ASYNC_ERROR
+	 */
+	[Event(name="asyncError", type="flash.events.AsyncErrorEvent")] 
+
+	/// The NetStream class opens a one-way streaming connection between Flash Player and Flash Media Server, or between Flash Player and the local file system.
+	public class NetStream extends EventDispatcher
+	{
+		/// A static object used as a parameter to the constructor for a NetStream instance.
+		public static const CONNECT_TO_FMS : String;
+		/// Creates a peer-to-peer publisher connection.
+		public static const DIRECT_CONNECTIONS : String;
+
+		public function get audioCodec () : uint;
+
+		/// The number of seconds of data currently in the buffer.
+		public function get bufferLength () : Number;
+
+		/// Specifies how long to buffer messages before starting to display the stream.
+		public function get bufferTime () : Number;
+		public function set bufferTime (bufferTime:Number) : void;
+
+		/// The number of bytes of data that have been loaded into Flash Player.
+		public function get bytesLoaded () : uint;
+
+		/// The total size in bytes of the file being loaded into Flash Player.
+		public function get bytesTotal () : uint;
+
+		/// Specifies whether Flash Player should try to download a URL policy file from the loaded video file's server before beginning to load the video file.
+		public function get checkPolicyFile () : Boolean;
+		public function set checkPolicyFile (state:Boolean) : void;
+
+		/// Specifies the object on which callback methods are invoked to handle streaming or FLV file data.
+		public function get client () : Object;
+		public function set client (object:Object) : void;
+
+		/// The number of frames per second being displayed.
+		public function get currentFPS () : Number;
+
+		public function get decodedFrames () : uint;
+
+		/// The identifier of the far end that is connected to this NetStream instance.
+		public function get farID () : String;
+
+		/// A value chosen substantially by the other end of this stream, unique to this connection.
+		public function get farNonce () : String;
+
+		/// Returns a NetStreamInfo object whose properties contain statistics about the quality of service.
+		public function get info () : NetStreamInfo;
+
+		/// The number of seconds of data in the subscribing stream's buffer in live (unbuffered) mode.
+		public function get liveDelay () : Number;
+
+		/// Specifies how long to buffer messages during pause mode.
+		public function get maxPauseBufferTime () : Number;
+		public function set maxPauseBufferTime (pauseBufferTime:Number) : void;
+
+		/// A value chosen substantially by this end of the stream, unique to this connection.
+		public function get nearNonce () : String;
+
+		/// The object encoding (AMF version) for this NetStream object.
+		public function get objectEncoding () : uint;
+
+		/// An object that holds all of the subscribing NetStream instances that are listening to this publishing NetStream instance.
+		public function get peerStreams () : Array;
+
+		/// Controls sound in this NetStream object.
+		public function get soundTransform () : SoundTransform;
+		public function set soundTransform (sndTransform:SoundTransform) : void;
+
+		/// The position of the playhead, in seconds.
+		public function get time () : Number;
+
+		public function get videoCodec () : uint;
+
+		/// Specifies an audio stream sent over the NetStream object, from a Microphone object passed as the source.
+		public function attachAudio (microphone:Microphone) : void;
+
+		/// Starts capturing video from a camera, or stops capturing if theCamera is set to null.
+		public function attachCamera (theCamera:Camera, snapshotMilliseconds:int = -1) : void;
+
+		/// Stops playing all data on the stream, sets the time property to 0, and makes the stream available for another use.
+		public function close () : void;
+
+		/// Creates a stream that can be used for playing video files through the specified NetConnection object.
+		public function NetStream (connection:NetConnection, peerID:String = "connectToFMS");
+
+		/// Invoked when a peer-publishing stream matches a peer-subscribing stream.
+		public function onPeerConnect (subscriber:NetStream) : Boolean;
+
+		/// Pauses playback of a video stream.
+		public function pause () : void;
+
+		/// Begins playback of video files.
+		public function play (...rest) : void;
+
+		/// Begins playback of media files, with several options for playback.
+		public function play2 (param:NetStreamPlayOptions) : void;
+
+		/// Sends streaming audio, video, and text messages from a client to Flash Media Server, optionally recording the stream during transmission.
+		public function publish (name:String = null, type:String = null) : void;
+
+		/// Specifies whether incoming audio plays on the stream.
+		public function receiveAudio (flag:Boolean) : void;
+
+		/// Specifies whether incoming video will play on the stream.
+		public function receiveVideo (flag:Boolean) : void;
+
+		/// Specifies the frame rate for incoming video.
+		public function receiveVideoFPS (FPS:Number) : void;
+
+		/// Resumes playback of a video stream that is paused.
+		public function resume () : void;
+
+		/// Seeks the keyframe (also called an I-frame in the video industry) closest to the specified location.
+		public function seek (offset:Number) : void;
+
+		/// Sends a message on a published stream to all subscribing clients.
+		public function send (handlerName:String, ...rest) : void;
+
+		/// Pauses or resumes playback of a stream.
+		public function togglePause () : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/NetStreamInfo.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/NetStreamInfo.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,69 @@
+package flash.net
+{
+	/// The NetStreamInfo class specifies the various Quality of Service (QOS) statistics related to a NetStream object and the underlying streaming buffer for audio, video, and data.
+	public class NetStreamInfo extends Object
+	{
+		/// Provides the NetStream audio buffer size in bytes.
+		public function get audioBufferByteLength () : Number;
+
+		/// Provides NetStream audio buffer size in seconds.
+		public function get audioBufferLength () : Number;
+
+		/// Specifies the total number of audio bytes that have arrived in the queue, regardless of how many have been played or flushed.
+		public function get audioByteCount () : Number;
+
+		/// Specifies the rate at which the NetStream audio buffer is filled in bytes per second.
+		public function get audioBytesPerSecond () : Number;
+
+		/// Specifies the audio loss for the NetStream session.
+		public function get audioLossRate () : Number;
+
+		/// Specifies the total number of bytes that have arrived into the queue, regardless of how many have been played or flushed.
+		public function get byteCount () : Number;
+
+		/// Specifies the rate at which the NetStream buffer is filled in bytes per second.
+		public function get currentBytesPerSecond () : Number;
+
+		/// Provides the NetStream data buffer size in bytes.
+		public function get dataBufferByteLength () : Number;
+
+		/// Provides NetStream data buffer size in seconds.
+		public function get dataBufferLength () : Number;
+
+		/// Specifies the total number of bytes of data messages that have arrived in the queue, regardless of how many have been played or flushed.
+		public function get dataByteCount () : Number;
+
+		/// Specifies the rate at which the NetStream data buffer is filled in bytes per second.
+		public function get dataBytesPerSecond () : Number;
+
+		/// Returns the number of video frames dropped in the current NetStream playback session.
+		public function get droppedFrames () : Number;
+
+		/// Specifies the maximum rate at which the NetStream buffer is filled in bytes per second.
+		public function get maxBytesPerSecond () : Number;
+
+		/// Returns the stream playback rate in bytes per second.
+		public function get playbackBytesPerSecond () : Number;
+
+		/// Specifies the Smooth Round Trip Time for the NetStream session.
+		public function get SRTT () : Number;
+
+		/// Provides the NetStream video buffer size in bytes.
+		public function get videoBufferByteLength () : Number;
+
+		/// Provides NetStream video buffer size in seconds.
+		public function get videoBufferLength () : Number;
+
+		/// Specifies the total number of video bytes that have arrived in the queue, regardless of how many have been played or flushed.
+		public function get videoByteCount () : Number;
+
+		/// Specifies the rate at which the NetStream video buffer is filled in bytes per second.
+		public function get videoBytesPerSecond () : Number;
+
+		/// For internal use only; not recommended for use.
+		public function NetStreamInfo (curBPS:Number, byteCount:Number, maxBPS:Number, audioBPS:Number, audioByteCount:Number, videoBPS:Number, videoByteCount:Number, dataBPS:Number, dataByteCount:Number, playbackBPS:Number, droppedFrames:Number, audioBufferByteLength:Number, videoBufferByteLength:Number, dataBufferByteLength:Number, audioBufferLength:Number, videoBufferLength:Number, dataBufferLength:Number, srtt:Number, audioLossRate:Number);
+
+		/// Returns a text value listing the properties of this NetStreamInfo object.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/NetStreamPlayOptions.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/NetStreamPlayOptions.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,22 @@
+package flash.net
+{
+	import flash.events.EventDispatcher;
+
+	/// The NetStreamPlayOptions class specifies the various options that can be passed to the NetStream.play2() method.
+	public class NetStreamPlayOptions extends EventDispatcher
+	{
+		/// The duration of playback, in seconds, for the stream specified in streamName.
+		public var len : Number;
+		/// The name of the old stream or the stream to transition from.
+		public var oldStreamName : String;
+		/// The start time, in seconds, for streamName.
+		public var start : Number;
+		/// The name of the new stream to transition to or to play.
+		public var streamName : String;
+		/// The mode in which streamName is played or transitioned to.
+		public var transition : String;
+
+		/// Creates a NetStreamPlayOptions object to specify the options that are passed to the NetStream.play2() method.
+		public function NetStreamPlayOptions ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/NetStreamPlayTransitions.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/NetStreamPlayTransitions.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,20 @@
+package flash.net
+{
+	/// The NetStreamPlayTransitions class specifies the valid strings that you can use with the NetStreamPlayOptions.transition property.
+	public class NetStreamPlayTransitions extends Object
+	{
+		/// Adds the stream to a playlist.
+		public static const APPEND : *;
+		/// Clears any previous play calls and plays the specified stream immediately.
+		public static const RESET : *;
+		/// Stops playing the streams in a playlist.
+		public static const STOP : *;
+		/// Replaces a content stream with a different content stream and maintains the rest of the playlist.
+		public static const SWAP : *;
+		/// Switches from playing one stream to another stream, typically with streams of the same content.
+		public static const SWITCH : *;
+
+		/// The NetStreamPlayTransitions class specifies the valid strings that you can use with the NetStreamPlayOptions.transition property.
+		public function NetStreamPlayTransitions ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/ObjectEncoding.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/ObjectEncoding.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,21 @@
+package flash.net
+{
+	import flash.net.IDynamicPropertyWriter;
+
+	/// The ObjectEncoding class allows classes that serialize objects (such as NetStream, NetConnection, SharedObject, and ByteArray) to work with prior versions of ActionScript.
+	public class ObjectEncoding extends Object
+	{
+		/// Specifies that objects are serialized using the Action Message Format for ActionScript 1.0 and 2.0.
+		public static const AMF0 : uint;
+		/// Specifies that objects are serialized using the Action Message Format for ActionScript 3.0.
+		public static const AMF3 : uint;
+		/// Specifies the default (latest) format for the current player.
+		public static const DEFAULT : uint;
+
+		/// Allows greater control over the serialization of dynamic properties of dynamic objects.
+		public static function get dynamicPropertyWriter () : IDynamicPropertyWriter;
+		public static function set dynamicPropertyWriter (object:IDynamicPropertyWriter) : void;
+
+		public function ObjectEncoding ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/Responder.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/Responder.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,9 @@
+package flash.net
+{
+	/// The Responder class provides an object that is used in NetConnection.call() to handle return values from the server related to the success or failure of specific operations.
+	public class Responder extends Object
+	{
+		/// Creates a new Responder object.
+		public function Responder (result:Function, status:Function = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/SharedObject.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/SharedObject.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,82 @@
+package flash.net
+{
+	import flash.events.EventDispatcher;
+	import flash.net.SharedObject;
+	import flash.net.NetConnection;
+
+	/**
+	 * Dispatched when a remote shared object has been updated by the server.
+	 * @eventType flash.events.SyncEvent.SYNC
+	 */
+	[Event(name="sync", type="flash.events.SyncEvent")] 
+
+	/**
+	 * Dispatched when a SharedObject instance is reporting its status or error condition.
+	 * @eventType flash.events.NetStatusEvent.NET_STATUS
+	 */
+	[Event(name="netStatus", type="flash.events.NetStatusEvent")] 
+
+	/**
+	 * Dispatched when an exception is thrown asynchronously -- that is, from native asynchronous code.
+	 * @eventType flash.events.AsyncErrorEvent.ASYNC_ERROR
+	 */
+	[Event(name="asyncError", type="flash.events.AsyncErrorEvent")] 
+
+	/// The SharedObject class is used to read and store limited amounts of data on a user's computer or on a server.
+	public class SharedObject extends EventDispatcher
+	{
+		/// Indicates the object on which callback methods are invoked.
+		public function get client () : Object;
+		public function set client (object:Object) : void;
+
+		/// The collection of attributes assigned to the data property of the object; these attributes can be shared and stored.
+		public function get data () : Object;
+
+		/// The default object encoding (AMF version) for all local shared objects created in the SWF file.
+		public static function get defaultObjectEncoding () : uint;
+		public static function set defaultObjectEncoding (version:uint) : void;
+
+		/// Specifies the number of times per second that a client's changes to a shared object are sent to the server.
+		public function set fps (updatesPerSecond:Number) : void;
+
+		/// The object encoding (AMF version) for this shared object.
+		public function get objectEncoding () : uint;
+		public function set objectEncoding (version:uint) : void;
+
+		/// The current size of the shared object, in bytes.
+		public function get size () : uint;
+
+		/// For local shared objects, purges all of the data and deletes the shared object from the disk.
+		public function clear () : void;
+
+		/// Closes the connection between a remote shared object and the server.
+		public function close () : void;
+
+		/// Connects to a remote shared object on a server through a specified NetConnection object.
+		public function connect (myConnection:NetConnection, params:String = null) : void;
+
+		public static function deleteAll (url:String) : int;
+
+		/// Immediately writes a locally persistent shared object to a local file.
+		public function flush (minDiskSpace:int = 0) : String;
+
+		public static function getDiskUsage (url:String) : int;
+
+		/// Returns a reference to a locally persistent shared object that is only available to the current client.
+		public static function getLocal (name:String, localPath:String = null, secure:Boolean = false) : SharedObject;
+
+		/// Returns a reference to a shared object on Flash Media Server that multiple clients can access.
+		public static function getRemote (name:String, remotePath:String = null, persistence:Object = false, secure:Boolean = false) : SharedObject;
+
+		/// Broadcasts a message to all clients connected to a remote shared object, including the client that sent the message.
+		public function send (...rest) : void;
+
+		/// Indicates to the server that the value of a property in the shared object has changed.
+		public function setDirty (propertyName:String) : void;
+
+		/// Updates the value of a property in a shared object and indicates to the server that the value of the property has changed.
+		public function setProperty (propertyName:String, value:Object = null) : void;
+
+		public function SharedObject ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/SharedObjectFlushStatus.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/SharedObjectFlushStatus.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.net
+{
+	/// The SharedObjectFlushStatus class provides values for the code returned from a call to the SharedObject.flush() method.
+	public class SharedObjectFlushStatus extends Object
+	{
+		/// Indicates that the flush completed successfully.
+		public static const FLUSHED : String;
+		/// Indicates that the user is being prompted to increase disk space for the shared object before the flush can occur.
+		public static const PENDING : String;
+
+		public function SharedObjectFlushStatus ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/Socket.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/Socket.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,152 @@
+package flash.net
+{
+	import flash.events.EventDispatcher;
+	import flash.events.TimerEvent;
+	import flash.events.SecurityErrorEvent;
+	import flash.utils.IDataInput;
+	import flash.utils.IDataOutput;
+	import flash.utils.Timer;
+	import flash.utils.ByteArray;
+
+	/**
+	 * Dispatched if a call to Socket.connect() attempts to connect either to a server outside the caller's security sandbox or to a port lower than 1024.
+	 * @eventType flash.events.SecurityErrorEvent.SECURITY_ERROR
+	 */
+	[Event(name="securityError", type="flash.events.SecurityErrorEvent")] 
+
+	/**
+	 * Dispatched when a socket has received data.
+	 * @eventType flash.events.ProgressEvent.SOCKET_DATA
+	 */
+	[Event(name="socketData", type="flash.events.ProgressEvent")] 
+
+	/**
+	 * Dispatched when an input/output error occurs that causes a send or load operation to fail.
+	 * @eventType flash.events.IOErrorEvent.IO_ERROR
+	 */
+	[Event(name="ioError", type="flash.events.IOErrorEvent")] 
+
+	/**
+	 * Dispatched when a network connection has been established.
+	 * @eventType flash.events.Event.CONNECT
+	 */
+	[Event(name="connect", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when the server closes the socket connection.
+	 * @eventType flash.events.Event.CLOSE
+	 */
+	[Event(name="close", type="flash.events.Event")] 
+
+	/// The Socket class enables ActionScript code to make socket connections and to read and write raw binary data.
+	public class Socket extends EventDispatcher implements IDataInput, IDataOutput
+	{
+		/// The number of bytes of data available for reading in the input buffer.
+		public function get bytesAvailable () : uint;
+
+		/// Indicates whether this Socket object is currently connected.
+		public function get connected () : Boolean;
+
+		/// Indicates the byte order for the data; possible values are constants from the flash.utils.Endian class, Endian.BIG_ENDIAN or Endian.LITTLE_ENDIAN.
+		public function get endian () : String;
+		public function set endian (type:String) : void;
+
+		/// Controls the version of AMF used when writing or reading an object.
+		public function get objectEncoding () : uint;
+		public function set objectEncoding (version:uint) : void;
+
+		/// Indicates the number of milliseconds to wait for a connection.
+		public function get timeout () : uint;
+		public function set timeout (value:uint) : void;
+
+		/// Closes the socket.
+		public function close () : void;
+
+		/// Connects the socket to the specified host and port.
+		public function connect (host:String, port:int) : void;
+
+		/// Flushes any accumulated data in the socket's output buffer.
+		public function flush () : void;
+
+		/// Reads a Boolean value from the socket.
+		public function readBoolean () : Boolean;
+
+		/// Reads a signed byte from the socket.
+		public function readByte () : int;
+
+		/// Reads the number of data bytes specified by the length parameter from the socket.
+		public function readBytes (bytes:ByteArray, offset:uint = 0, length:uint = 0) : void;
+
+		/// Reads an IEEE 754 double-precision floating-point number from the socket.
+		public function readDouble () : Number;
+
+		/// Reads an IEEE 754 single-precision floating-point number from the socket.
+		public function readFloat () : Number;
+
+		/// Reads a signed 32-bit integer from the socket.
+		public function readInt () : int;
+
+		/// Reads a multibyte string from the byte stream, using the specified character set.
+		public function readMultiByte (length:uint, charSet:String) : String;
+
+		/// Reads an object from the socket, encoded in AMF serialized format.
+		public function readObject () : *;
+
+		/// Reads a signed 16-bit integer from the socket.
+		public function readShort () : int;
+
+		/// Reads an unsigned byte from the socket.
+		public function readUnsignedByte () : uint;
+
+		/// Reads an unsigned 32-bit integer from the socket.
+		public function readUnsignedInt () : uint;
+
+		/// Reads an unsigned 16-bit integer from the socket.
+		public function readUnsignedShort () : uint;
+
+		/// Reads a UTF-8 string from the socket.
+		public function readUTF () : String;
+
+		/// Reads the number of UTF-8 data bytes specified by the length parameter from the socket, and returns a string.
+		public function readUTFBytes (length:uint) : String;
+
+		/// Creates a new Socket object.
+		public function Socket (host:String = null, port:int = 0);
+
+		/// Writes a Boolean value to the socket.
+		public function writeBoolean (value:Boolean) : void;
+
+		/// Writes a byte to the socket.
+		public function writeByte (value:int) : void;
+
+		/// Writes a sequence of bytes from the specified byte array.
+		public function writeBytes (bytes:ByteArray, offset:uint = 0, length:uint = 0) : void;
+
+		/// Writes an IEEE 754 double-precision floating-point number to the socket.
+		public function writeDouble (value:Number) : void;
+
+		/// Writes an IEEE 754 single-precision floating-point number to the socket.
+		public function writeFloat (value:Number) : void;
+
+		/// Writes a 32-bit signed integer to the socket.
+		public function writeInt (value:int) : void;
+
+		/// Writes a multibyte string from the byte stream, using the specified character set.
+		public function writeMultiByte (value:String, charSet:String) : void;
+
+		/// Write an object to the socket in AMF serialized format.
+		public function writeObject (object:*) : void;
+
+		/// Writes a 16-bit integer to the socket.
+		public function writeShort (value:int) : void;
+
+		/// Writes a 32-bit unsigned integer to the socket.
+		public function writeUnsignedInt (value:uint) : void;
+
+		/// Writes the following data to the socket: a 16-bit unsigned integer, which indicates the length of the specified UTF-8 string in bytes, followed by the string itself.
+		public function writeUTF (value:String) : void;
+
+		/// Writes a UTF-8 string to the socket.
+		public function writeUTFBytes (value:String) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLLoader.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLLoader.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,66 @@
+package flash.net
+{
+	import flash.events.EventDispatcher;
+	import flash.net.URLStream;
+	import flash.net.URLRequest;
+	import flash.events.ProgressEvent;
+	import flash.events.Event;
+
+	/**
+	 * Dispatched if a call to URLLoader.load() attempts to access data over HTTP and the current Flash Player environment is able to detect and return the status code for the request.
+	 * @eventType flash.events.HTTPStatusEvent.HTTP_STATUS
+	 */
+	[Event(name="httpStatus", type="flash.events.HTTPStatusEvent")] 
+
+	/**
+	 * Dispatched if a call to URLLoader.load() attempts to load data from a server outside the security sandbox.
+	 * @eventType flash.events.SecurityErrorEvent.SECURITY_ERROR
+	 */
+	[Event(name="securityError", type="flash.events.SecurityErrorEvent")] 
+
+	/**
+	 * Dispatched if a call to URLLoader.load() results in a fatal error that terminates the download.
+	 * @eventType flash.events.IOErrorEvent.IO_ERROR
+	 */
+	[Event(name="ioError", type="flash.events.IOErrorEvent")] 
+
+	/**
+	 * Dispatched when data is received as the download operation progresses.
+	 * @eventType flash.events.ProgressEvent.PROGRESS
+	 */
+	[Event(name="progress", type="flash.events.ProgressEvent")] 
+
+	/**
+	 * Dispatched after all the received data is decoded and placed in the data property of the URLLoader object.
+	 * @eventType flash.events.Event.COMPLETE
+	 */
+	[Event(name="complete", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when the download operation commences following a call to the URLLoader.load() method.
+	 * @eventType flash.events.Event.OPEN
+	 */
+	[Event(name="open", type="flash.events.Event")] 
+
+	/// The URLLoader class downloads data from a URL as text, binary data, or URL-encoded variables.
+	public class URLLoader extends EventDispatcher
+	{
+		/// Indicates the number of bytes that have been loaded thus far during the load operation.
+		public var bytesLoaded : uint;
+		/// Indicates the total number of bytes in the downloaded data.
+		public var bytesTotal : uint;
+		/// The data received from the load operation.
+		public var data : *;
+		/// Controls whether the downloaded data is received as text (URLLoaderDataFormat.TEXT), raw binary data (URLLoaderDataFormat.BINARY), or URL-encoded variables (URLLoaderDataFormat.VARIABLES).
+		public var dataFormat : String;
+
+		/// Closes the load operation in progress.
+		public function close () : void;
+
+		/// Sends and loads data from the specified URL.
+		public function load (request:URLRequest) : void;
+
+		/// Creates a URLLoader object.
+		public function URLLoader (request:URLRequest = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLLoaderDataFormat.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLLoaderDataFormat.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.net
+{
+	/// The URLLoaderDataFormat class provides values that specify how downloaded data is received.
+	public class URLLoaderDataFormat extends Object
+	{
+		/// Specifies that downloaded data is received as raw binary data.
+		public static const BINARY : String;
+		/// Specifies that downloaded data is received as text.
+		public static const TEXT : String;
+		/// Specifies that downloaded data is received as URL-encoded variables.
+		public static const VARIABLES : String;
+
+		public function URLLoaderDataFormat ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLRequest.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLRequest.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,33 @@
+package flash.net
+{
+	/// The URLRequest class captures all of the information in a single HTTP request.
+	public class URLRequest extends Object
+	{
+		/// The MIME content type of the content in the the data property.
+		public function get contentType () : String;
+		public function set contentType (value:String) : void;
+
+		/// An object containing data to be transmitted with the URL request.
+		public function get data () : Object;
+		public function set data (value:Object) : void;
+
+		/// A string that uniquely identifies the signed Adobe platform component to be stored to (or retrieved from) the Flash Player cache.
+		public function get digest () : String;
+		public function set digest (value:String) : void;
+
+		/// Controls the HTTP form submission method.
+		public function get method () : String;
+		public function set method (value:String) : void;
+
+		/// The array of HTTP request headers to be appended to the HTTP request.
+		public function get requestHeaders () : Array;
+		public function set requestHeaders (value:Array) : void;
+
+		/// The URL to be requested.
+		public function get url () : String;
+		public function set url (value:String) : void;
+
+		/// Creates a URLRequest object.
+		public function URLRequest (url:String = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLRequestHeader.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLRequestHeader.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,14 @@
+package flash.net
+{
+	/// A URLRequestHeader object encapsulates a single HTTP request header and consists of a name/value pair.
+	public class URLRequestHeader extends Object
+	{
+		/// An HTTP request header name (such as Content-Type or SOAPAction).
+		public var name : String;
+		/// The value associated with the name property (such as text/plain).
+		public var value : String;
+
+		/// Creates a new URLRequestHeader object that encapsulates a single HTTP request header.
+		public function URLRequestHeader (name:String = "", value:String = "");
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLRequestMethod.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLRequestMethod.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.net
+{
+	/// The URLRequestMethod class provides values that specify whether the URLRequest object should use the POST method or the GET method when sending data to a server.
+	public class URLRequestMethod extends Object
+	{
+		/// Specifies that the URLRequest object is a GET.
+		public static const GET : String;
+		/// Specifies that the URLRequest object is a POST.
+		public static const POST : String;
+
+		public function URLRequestMethod ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLStream.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLStream.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,116 @@
+package flash.net
+{
+	import flash.events.EventDispatcher;
+	import flash.net.URLRequest;
+	import flash.utils.ByteArray;
+
+	/**
+	 * Dispatched when data is received as the download operation progresses.
+	 * @eventType flash.events.ProgressEvent.PROGRESS
+	 */
+	[Event(name="progress", type="flash.events.ProgressEvent")] 
+
+	/**
+	 * Dispatched when a load operation starts.
+	 * @eventType flash.events.Event.OPEN
+	 */
+	[Event(name="open", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when an input/output error occurs that causes a load operation to fail.
+	 * @eventType flash.events.IOErrorEvent.IO_ERROR
+	 */
+	[Event(name="ioError", type="flash.events.IOErrorEvent")] 
+
+	/**
+	 * Dispatched if a call to the URLStream.load() method attempts to access data over HTTP and Adobe AIR is able to detect and return the status code for the request.
+	 * @eventType flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS
+	 */
+	[Event(name="httpResponseStatus", type="flash.events.HTTPStatusEvent")] 
+
+	/**
+	 * Dispatched if a call to URLStream.load() attempts to access data over HTTP, and Flash Player or  or Adobe AIR is able to detect and return the status code for the request.
+	 * @eventType flash.events.HTTPStatusEvent.HTTP_STATUS
+	 */
+	[Event(name="httpStatus", type="flash.events.HTTPStatusEvent")] 
+
+	/**
+	 * Dispatched if a call to URLStream.load() attempts to load data from a server outside the security sandbox.
+	 * @eventType flash.events.SecurityErrorEvent.SECURITY_ERROR
+	 */
+	[Event(name="securityError", type="flash.events.SecurityErrorEvent")] 
+
+	/**
+	 * Dispatched when data has loaded successfully.
+	 * @eventType flash.events.Event.COMPLETE
+	 */
+	[Event(name="complete", type="flash.events.Event")] 
+
+	/// The URLStream class provides low-level access to downloading URLs.
+	public class URLStream extends EventDispatcher implements IDataInput
+	{
+		/// Returns the number of bytes of data available for reading in the input buffer.
+		public function get bytesAvailable () : uint;
+
+		/// Indicates whether this URLStream object is currently connected.
+		public function get connected () : Boolean;
+
+		/// Indicates the byte order for the data.
+		public function get endian () : String;
+		public function set endian (type:String) : void;
+
+		/// Controls the version of Action Message Format (AMF) used when writing or reading an object.
+		public function get objectEncoding () : uint;
+		public function set objectEncoding (version:uint) : void;
+
+		/// Immediately closes the stream and cancels the download operation.
+		public function close () : void;
+
+		/// Begins downloading the URL specified in the request parameter.
+		public function load (request:URLRequest) : void;
+
+		/// Reads a Boolean value from the stream.
+		public function readBoolean () : Boolean;
+
+		/// Reads a signed byte from the stream.
+		public function readByte () : int;
+
+		/// Reads length bytes of data from the stream.
+		public function readBytes (bytes:ByteArray, offset:uint = 0, length:uint = 0) : void;
+
+		/// Reads an IEEE 754 double-precision floating-point number from the stream.
+		public function readDouble () : Number;
+
+		/// Reads an IEEE 754 single-precision floating-point number from the stream.
+		public function readFloat () : Number;
+
+		/// Reads a signed 32-bit integer from the stream.
+		public function readInt () : int;
+
+		/// Reads a multibyte string of specified length from the byte stream using the specified character set.
+		public function readMultiByte (length:uint, charSet:String) : String;
+
+		/// Reads an object from the socket, encoded in Action Message Format (AMF).
+		public function readObject () : *;
+
+		/// Reads a signed 16-bit integer from the stream.
+		public function readShort () : int;
+
+		/// Reads an unsigned byte from the stream.
+		public function readUnsignedByte () : uint;
+
+		/// Reads an unsigned 32-bit integer from the stream.
+		public function readUnsignedInt () : uint;
+
+		/// Reads an unsigned 16-bit integer from the stream.
+		public function readUnsignedShort () : uint;
+
+		/// Reads a UTF-8 string from the stream.
+		public function readUTF () : String;
+
+		/// Reads a sequence of length UTF-8 bytes from the stream, and returns a string.
+		public function readUTFBytes (length:uint) : String;
+
+		public function URLStream ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLVariables.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/URLVariables.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.net
+{
+	/// The URLVariables class allows you to transfer variables between an application and a server.
+	public class URLVariables extends Object
+	{
+		/// Converts the variable string to properties of the specified URLVariables object.
+		public function decode (source:String) : void;
+
+		/// Returns a string containing all enumerable variables, in the MIME content encoding application/x-www-form-urlencoded.
+		public function toString () : String;
+
+		/// Creates a new URLVariables object.
+		public function URLVariables (source:String = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/XMLSocket.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/XMLSocket.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,61 @@
+package flash.net
+{
+	import flash.events.EventDispatcher;
+	import flash.utils.ByteArray;
+	import flash.net.Socket;
+	import flash.events.ProgressEvent;
+	import flash.events.Event;
+
+	/**
+	 * Dispatched if a call to the XMLSocket.connect() method attempts to connect either to a server outside the caller's security sandbox or to a port lower than 1024.
+	 * @eventType flash.events.SecurityErrorEvent.SECURITY_ERROR
+	 */
+	[Event(name="securityError", type="flash.events.SecurityErrorEvent")] 
+
+	/**
+	 * Dispatched when an input/output error occurs that causes a send or receive operation to fail.
+	 * @eventType flash.events.IOErrorEvent.IO_ERROR
+	 */
+	[Event(name="ioError", type="flash.events.IOErrorEvent")] 
+
+	/**
+	 * Dispatched after raw data is sent or received.
+	 * @eventType flash.events.DataEvent.DATA
+	 */
+	[Event(name="data", type="flash.events.DataEvent")] 
+
+	/**
+	 * Dispatched after a successful call to the XMLSocket.connect() method.
+	 * @eventType flash.events.Event.CONNECT
+	 */
+	[Event(name="connect", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when the server closes the socket connection.
+	 * @eventType flash.events.Event.CLOSE
+	 */
+	[Event(name="close", type="flash.events.Event")] 
+
+	/// The XMLSocket class implements client sockets that let the computer that is running Flash Player communicate with a server computer identified by an IP address or domain name.
+	public class XMLSocket extends EventDispatcher
+	{
+		/// Indicates whether this XMLSocket object is currently connected.
+		public function get connected () : Boolean;
+
+		/// Indicates the number of milliseconds to wait for a connection.
+		public function get timeout () : int;
+		public function set timeout (value:int) : void;
+
+		/// Closes the connection specified by the XMLSocket object.
+		public function close () : void;
+
+		/// Establishes a connection to the specified Internet host using the specified TCP port.
+		public function connect (host:String, port:int) : void;
+
+		/// Converts the XML object or data specified in the object parameter to a string and transmits it to the server, followed by a zero (0) byte.
+		public function send (object:*) : void;
+
+		/// Creates a new XMLSocket object.
+		public function XMLSocket (host:String = null, port:int = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/package.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/net/package.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,18 @@
+package flash.net
+{
+	import flash.net.URLRequest;
+
+	/// Preserves the class (type) of an object when the object is encoded in Action Message Format (AMF).
+	public function registerClassAlias (aliasName:String, classObject:Class) : void;
+
+	/// Looks up a class that previously had an alias registered through a call to the registerClassAlias() method.
+	public function getClassByAlias (aliasName:String) : Class;
+
+	/// Opens or replaces a window in the application that contains the Flash Player container (usually a browser).
+	public function navigateToURL (request:URLRequest, window:String = null) : void;
+
+	/// Sends a URL request to a server, but ignores any response.
+	public function sendToURL (request:URLRequest) : void;
+
+}
+

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/printing/PrintJob.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/printing/PrintJob.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,38 @@
+package flash.printing
+{
+	import flash.events.EventDispatcher;
+	import flash.geom.Rectangle;
+	import flash.display.Sprite;
+	import flash.printing.PrintJobOptions;
+
+	/// The PrintJob class lets you create content and print it to one or more pages.
+	public class PrintJob extends EventDispatcher
+	{
+		/// The image orientation for printing.
+		public function get orientation () : String;
+
+		/// The height of the actual printable area on the page, in points.
+		public function get pageHeight () : int;
+
+		/// The width of the actual printable area on the page, in points.
+		public function get pageWidth () : int;
+
+		/// The overall paper height, in points.
+		public function get paperHeight () : int;
+
+		/// The overall paper width, in points.
+		public function get paperWidth () : int;
+
+		/// Sends the specified Sprite object as a single page to the print spooler.
+		public function addPage (sprite:Sprite, printArea:Rectangle = null, options:PrintJobOptions = null, frameNum:int = 0) : void;
+
+		/// Creates a PrintJob object that you can use to print one or more pages.
+		public function PrintJob ();
+
+		/// Sends spooled pages to the printer after PrintJob.start() and PrintJob.addPage() have been successful.
+		public function send () : void;
+
+		/// Displays the operating system's Print dialog box, starts spooling, and sets the PrintJob read-only property values.
+		public function start () : Boolean;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/printing/PrintJobOptions.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/printing/PrintJobOptions.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,12 @@
+package flash.printing
+{
+	/// The PrintJobOptions class contains properties to use with the options parameter of the PrintJob.addPage() method.
+	public class PrintJobOptions extends Object
+	{
+		/// Specifies whether the content in the print job is printed as a bitmap or as a vector.
+		public var printAsBitmap : Boolean;
+
+		/// Creates a new PrintJobOptions object.
+		public function PrintJobOptions (printAsBitmap:Boolean = false);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/printing/PrintJobOrientation.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/printing/PrintJobOrientation.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.printing
+{
+	/// This class provides values that are used by the PrintJob.orientation property for the image position of a printed page.
+	public class PrintJobOrientation extends Object
+	{
+		/// The landscape (horizontal) image orientation for printing.
+		public static const LANDSCAPE : String;
+		/// The portrait (vertical) image orientation for printing.
+		public static const PORTRAIT : String;
+
+		public function PrintJobOrientation ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/profiler/package.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/profiler/package.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,7 @@
+package flash.profiler
+{
+	/// Shows or hides redraw regions.
+	public function showRedrawRegions (on:Boolean, color:uint = 0xFF0000) : void;
+
+}
+

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/DeleteObjectSample.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/DeleteObjectSample.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.sampler
+{
+	/// The DeleteObjectSample class represents objects that are created within a getSamples() stream; each DeleteObjectSample object corresponds to a NewObjectSample object.
+	public class DeleteObjectSample extends Sample
+	{
+		/// The unique identification number that matches up with a NewObjectSample's identification number.
+		public const id : Number;
+		/// The size of the DeleteObjectSample object before it is deleted.
+		public const size : Number;
+
+		public function DeleteObjectSample ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/NewObjectSample.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/NewObjectSample.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,16 @@
+package flash.sampler
+{
+	/// The NewObjectSample class represents objects that are created within a getSamples() stream.
+	public class NewObjectSample extends Sample
+	{
+		/// The unique identification number that matches up with a DeleteObjectSample's identification number.
+		public const id : Number;
+		/// The Class object corresponding to the object created within a getSamples() stream.
+		public const type : Class;
+
+		/// The NewObjectSample object if it still exists.
+		public function get object () : *;
+
+		public function NewObjectSample ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/Sample.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/Sample.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.sampler
+{
+	/// The Sample class creates objects that hold memory analysis information over distinct durations.
+	public class Sample extends Object
+	{
+		/// Contains information about the methods executed by Flash Player over a specified period of time.
+		public const stack : Array;
+		/// The microseconds that define the duration of the Sample instance.
+		public const time : Number;
+
+		public function Sample ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/StackFrame.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/StackFrame.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,18 @@
+package flash.sampler
+{
+	/// The StackFrame class provides access to the properties of a data block containing a function.
+	public class StackFrame extends Object
+	{
+		/// The file name of the SWF file being debugged.
+		public const file : String;
+		/// The line number for the function in the SWF file being debugged.
+		public const line : uint;
+		/// The function name in the stack frame.
+		public const name : String;
+
+		public function StackFrame ();
+
+		/// Converts the StackFrame to a string of its properties.
+		public function toString () : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/package.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/sampler/package.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,40 @@
+package flash.sampler
+{
+	/// Clears the current set of Sample objects.
+	public function clearSamples () : void;
+
+	/// Begins the process of collecting memory usage Sample objects.
+	public function startSampling () : void;
+
+	/// Ends the process of collecting memory usage Sample objects and frees resources dedicated to the sampling process.
+	public function stopSampling () : void;
+
+	/// Stops the sampling process momentarily.
+	public function pauseSampling () : void;
+
+	/// Returns the size in memory of a specified object when used with the Flash Player 9.0.115.0 or later debugger version.
+	public function getSize (o:*) : Number;
+
+	/// Returns an object containing all members of a specified object, including private members.
+	public function getMemberNames (o:Object, instanceNames:Boolean = false) : Object;
+
+	/// Returns an object of memory usage Sample instances from the last sampling session.
+	public function getSamples () : Object;
+
+	/// Returns the number of samples collected.
+	public function getSampleCount () : Number;
+
+	/// Returns the number of times a method was executed.
+	public function getInvocationCount (obj:Object, qname:QName) : Number;
+
+	/// Returns the number of times a set function was executed.
+	public function getSetterInvocationCount (obj:Object, qname:QName) : Number;
+
+	/// Returns the number of times a get function was executed.
+	public function getGetterInvocationCount (obj:Object, qname:QName) : Number;
+
+	/// Checks to see if a property is defined by a get/set function.
+	public function isGetterSetter (obj:Object, qname:QName) : Boolean;
+
+}
+

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/ApplicationDomain.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/ApplicationDomain.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,31 @@
+package flash.system
+{
+	import flash.system.ApplicationDomain;
+	import flash.utils.ByteArray;
+
+	/// The ApplicationDomain class is a container for discrete groups of class definitions.
+	public class ApplicationDomain extends Object
+	{
+		/// Gets the current application domain in which your code is executing.
+		public static function get currentDomain () : ApplicationDomain;
+
+		/// Gets and sets the object on which domain-global memory operations will operate within this ApplicationDomain.
+		public function get domainMemory () : ByteArray;
+		public function set domainMemory (mem:ByteArray) : void;
+
+		/// Gets the minimum memory object length required to be used as ApplicationDomain.domainMemory.
+		public static function get MIN_DOMAIN_MEMORY_LENGTH () : uint;
+
+		/// Gets the parent domain of this application domain.
+		public function get parentDomain () : ApplicationDomain;
+
+		/// Creates a new application domain.
+		public function ApplicationDomain (parentDomain:ApplicationDomain = null);
+
+		/// Gets a public definition from the specified application domain.
+		public function getDefinition (name:String) : Object;
+
+		/// Checks to see if a public definition exists within the specified application domain.
+		public function hasDefinition (name:String) : Boolean;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/Capabilities.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/Capabilities.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,94 @@
+package flash.system
+{
+	/// The Capabilities class provides properties that describe the system and player that are hosting a SWF file.
+	public class Capabilities extends Object
+	{
+		public static function get _internal () : uint;
+
+		/// Specifies whether access to the user's camera and microphone has been administratively prohibited (true) or allowed (false).
+		public static function get avHardwareDisable () : Boolean;
+
+		/// Specifies whether the system supports (true) or does not support (false) communication with accessibility aids.
+		public static function get hasAccessibility () : Boolean;
+
+		/// Specifies whether the system has audio capabilities.
+		public static function get hasAudio () : Boolean;
+
+		/// Specifies whether the system can (true) or cannot (false) encode an audio stream, such as that coming from a microphone.
+		public static function get hasAudioEncoder () : Boolean;
+
+		/// Specifies whether the system supports (true) or does not support (false) embedded video.
+		public static function get hasEmbeddedVideo () : Boolean;
+
+		/// Specifies whether the system does (true) or does not (false) have an input method editor (IME) installed.
+		public static function get hasIME () : Boolean;
+
+		/// Specifies whether the system does (true) or does not (false) have an MP3 decoder.
+		public static function get hasMP3 () : Boolean;
+
+		/// Specifies whether the system does (true) or does not (false) support printing.
+		public static function get hasPrinting () : Boolean;
+
+		/// Specifies whether the system does (true) or does not (false) support the development of screen broadcast applications to be run through Flash Media Server.
+		public static function get hasScreenBroadcast () : Boolean;
+
+		/// Specifies whether the system does (true) or does not (false) support the playback of screen broadcast applications that are being run through Flash Media Server.
+		public static function get hasScreenPlayback () : Boolean;
+
+		/// Specifies whether the system can (true) or cannot (false) play streaming audio.
+		public static function get hasStreamingAudio () : Boolean;
+
+		/// Specifies whether the system can (true) or cannot (false) play streaming video.
+		public static function get hasStreamingVideo () : Boolean;
+
+		/// Specifies whether the system supports native SSL sockets through NetConnection (true) or does not (false).
+		public static function get hasTLS () : Boolean;
+
+		/// Specifies whether the system can (true) or cannot (false) encode a video stream, such as that coming from a web camera.
+		public static function get hasVideoEncoder () : Boolean;
+
+		/// Specifies whether the system is using special debugging software (true) or an officially released version (false).
+		public static function get isDebugger () : Boolean;
+
+		/// Specifies the language code of the system on which the content is running.
+		public static function get language () : String;
+
+		/// Specifies whether read access to the user's hard disk has been administratively prohibited (true) or allowed (false).
+		public static function get localFileReadDisable () : Boolean;
+
+		/// Specifies the manufacturer of the running version of Flash Player or  the AIR runtime, in the format "Adobe <em>OSName".
+		public static function get manufacturer () : String;
+
+		/// Retrieves the highest H.264 Level IDC that the client hardware supports.
+		public static function get maxLevelIDC () : String;
+
+		/// Specifies the current operating system.
+		public static function get os () : String;
+
+		/// Specifies the pixel aspect ratio of the screen.
+		public static function get pixelAspectRatio () : Number;
+
+		/// Specifies the type of runtime environment.
+		public static function get playerType () : String;
+
+		/// Specifies the screen color.
+		public static function get screenColor () : String;
+
+		/// Specifies the dots-per-inch (dpi) resolution of the screen, in pixels.
+		public static function get screenDPI () : Number;
+
+		/// Specifies the maximum horizontal resolution of the screen.
+		public static function get screenResolutionX () : Number;
+
+		/// Specifies the maximum vertical resolution of the screen.
+		public static function get screenResolutionY () : Number;
+
+		/// A URL-encoded string that specifies values for each Capabilities property.
+		public static function get serverString () : String;
+
+		/// Specifies the Flash Player or Adobe AIR platform and version information.
+		public static function get version () : String;
+
+		public function Capabilities ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/FSCommand.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/FSCommand.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,9 @@
+package flash.system
+{
+	public class FSCommand extends Object
+	{
+		public static function _fscommand (command:String, args:String) : void;
+
+		public function FSCommand ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/IME.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/IME.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,32 @@
+package flash.system
+{
+	import flash.events.EventDispatcher;
+
+	/**
+	 * Dispatched when a user has completed an input method editor (IME) composition and the reading string is available.
+	 * @eventType flash.events.IMEEvent.IME_COMPOSITION
+	 */
+	[Event(name="imeComposition", type="flash.events.IMEEvent")] 
+
+	/// The IME class lets you directly manipulate the operating system's input method editor (IME) in the Flash Player application that is running on a client computer.
+	public class IME extends EventDispatcher
+	{
+		public static function set constructOK (construct:Boolean) : void;
+
+		/// The conversion mode of the current IME.
+		public static function get conversionMode () : String;
+		public static function set conversionMode (mode:String) : void;
+
+		/// Indicates whether the system IME is enabled (true) or disabled (false).
+		public static function get enabled () : Boolean;
+		public static function set enabled (enabled:Boolean) : void;
+
+		/// Instructs the IME to select the first candidate for the current composition string.
+		public static function doConversion () : void;
+
+		public function IME ();
+
+		/// Sets the IME composition string.
+		public static function setCompositionString (composition:String) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/IMEConversionMode.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/IMEConversionMode.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,25 @@
+package flash.system
+{
+	/// This class contains constants for use with the IME.conversionMode property.
+	public class IMEConversionMode extends Object
+	{
+		/// The string "ALPHANUMERIC_FULL", for use with the IME.conversionMode property.
+		public static const ALPHANUMERIC_FULL : String;
+		/// The string "ALPHANUMERIC_HALF", for use with the IME.conversionMode property.
+		public static const ALPHANUMERIC_HALF : String;
+		/// The string "CHINESE", for use with the IME.conversionMode property.
+		public static const CHINESE : String;
+		/// The string "JAPANESE_HIRAGANA", for use with the IME.conversionMode property.
+		public static const JAPANESE_HIRAGANA : String;
+		/// The string "JAPANESE_KATAKANA_FULL", for use with the IME.conversionMode property.
+		public static const JAPANESE_KATAKANA_FULL : String;
+		/// The string "JAPANESE_KATAKANA_HALF", for use with the IME.conversionMode property.
+		public static const JAPANESE_KATAKANA_HALF : String;
+		/// The string "KOREAN", for use with the IME.conversionMode property.
+		public static const KOREAN : String;
+		/// The string "UNKNOWN", which can be returned by a call to the IME.conversionMode property.
+		public static const UNKNOWN : String;
+
+		public function IMEConversionMode ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/JPEGLoaderContext.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/JPEGLoaderContext.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,12 @@
+package flash.system
+{
+	import flash.system.ApplicationDomain;
+	import flash.system.SecurityDomain;
+
+	public class JPEGLoaderContext extends LoaderContext
+	{
+		public var deblockingFilter : Number;
+
+		public function JPEGLoaderContext (deblockingFilter:Number = 0, checkPolicyFile:Boolean = false, applicationDomain:ApplicationDomain = null, securityDomain:SecurityDomain = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/LoaderContext.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/LoaderContext.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,19 @@
+package flash.system
+{
+	import flash.system.ApplicationDomain;
+	import flash.system.SecurityDomain;
+
+	/// The LoaderContext class provides options for loading SWF files and other media by using the Loader class.
+	public class LoaderContext extends Object
+	{
+		/// Specifies the application domain to use for the Loader.load() or Loader.loadBytes() method.
+		public var applicationDomain : ApplicationDomain;
+		/// Specifies whether Flash Player should attempt to download a URL policy file from the loaded object's server before beginning to load the object itself.
+		public var checkPolicyFile : Boolean;
+		/// Specifies the security domain to use for a Loader.load() operation.
+		public var securityDomain : SecurityDomain;
+
+		/// Creates a new LoaderContext object, with the specified settings.
+		public function LoaderContext (checkPolicyFile:Boolean = false, applicationDomain:ApplicationDomain = null, securityDomain:SecurityDomain = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/Security.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/Security.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,39 @@
+package flash.system
+{
+	/// The Security class lets you specify how content in different domains can communicate with each other.
+	public class Security extends Object
+	{
+		/// The file is a local file and has been trusted by the user, using either the Flash Player Settings Manager or a FlashPlayerTrust configuration file.
+		public static const LOCAL_TRUSTED : String;
+		/// The file is a local file, has not been trusted by the user, and it is not a SWF file that was published with a networking designation.
+		public static const LOCAL_WITH_FILE : String;
+		/// The file is a local file, has not been trusted by the user, and it is a SWF file that was published with a networking designation.
+		public static const LOCAL_WITH_NETWORK : String;
+		/// The file is from an Internet URL and operates under domain-based sandbox rules.
+		public static const REMOTE : String;
+
+		public static function get disableAVM1Loading () : Boolean;
+		public static function set disableAVM1Loading (value:Boolean) : void;
+
+		/// Determines how Flash Player or AIR chooses the domain to use for certain content settings, including settings for camera and microphone permissions, storage quotas, and storage of persistent shared objects.
+		public static function get exactSettings () : Boolean;
+		public static function set exactSettings (value:Boolean) : void;
+
+		/// Indicates the type of security sandbox in which the calling file is operating.
+		public static function get sandboxType () : String;
+
+		/// Lets SWF files and HTML files access objects and variables in the calling SWF file.
+		public static function allowDomain (...rest) : void;
+
+		/// Lets SWF and HTML files hosted using the HTTPS protocol, access objects and variables in the calling SWF file.
+		public static function allowInsecureDomain (...rest) : void;
+
+		/// Loads a URL policy file from a location specified by the url parameter.
+		public static function loadPolicyFile (url:String) : void;
+
+		public function Security ();
+
+		/// Displays the Security Settings panel in Flash Player.
+		public static function showSettings (panel:String = "default") : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/SecurityDomain.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/SecurityDomain.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.system
+{
+	import flash.system.SecurityDomain;
+
+	/// The SecurityDomain class represents the current security "sandbox," also known as a security domain.
+	public class SecurityDomain extends Object
+	{
+		/// Gets the current security domain.
+		public static function get currentDomain () : SecurityDomain;
+
+		public function SecurityDomain ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/SecurityPanel.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/SecurityPanel.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,23 @@
+package flash.system
+{
+	/// The SecurityPanel class provides values for specifying which Security Settings panel you want to display.
+	public class SecurityPanel extends Object
+	{
+		/// When passed to Security.showSettings(), displays the Camera panel in Flash Player Settings.
+		public static const CAMERA : String;
+		/// When passed to Security.showSettings(), displays the panel that was open the last time the user closed the Flash Player Settings.
+		public static const DEFAULT : String;
+		/// When passed to Security.showSettings(), displays the Display panel in Flash Player Settings.
+		public static const DISPLAY : String;
+		/// When passed to Security.showSettings(), displays the Local Storage Settings panel in Flash Player Settings.
+		public static const LOCAL_STORAGE : String;
+		/// When passed to Security.showSettings(), displays the Microphone panel in Flash Player Settings.
+		public static const MICROPHONE : String;
+		/// When passed to Security.showSettings(), displays the Privacy Settings panel in Flash Player Settings.
+		public static const PRIVACY : String;
+		/// When passed to Security.showSettings(), displays the Settings Manager (in a separate browser window).
+		public static const SETTINGS_MANAGER : String;
+
+		public function SecurityPanel ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/System.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/System.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,37 @@
+package flash.system
+{
+	import flash.system.IME;
+
+	/// The System class contains properties related to certain operations that take place on the user's computer, such as operations with shared objects, local settings for cameras and microphones, and use of the Clipboard.
+	public class System extends Object
+	{
+		/// The currently installed system IME.
+		public static function get ime () : IME;
+
+		/// The amount of memory (in bytes) currently in use by Adobe Flash Player.
+		public static function get totalMemory () : uint;
+
+		/// A Boolean value that tells Flash Player which code page to use to interpret external text files.
+		public static function get useCodePage () : Boolean;
+		public static function set useCodePage (value:Boolean) : void;
+
+		public static function get vmVersion () : String;
+
+		/// Closes the Flash Player.
+		public static function exit (code:uint) : void;
+
+		/// Forces the garbage collection process.
+		public static function gc () : void;
+
+		/// Pauses the Flash Player.
+		public static function pause () : void;
+
+		/// Resumes the Flash Player after using System.pause().
+		public static function resume () : void;
+
+		/// Replaces the contents of the Clipboard with a specified text string.
+		public static function setClipboard (string:String) : void;
+
+		public function System ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/package.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/system/package.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,7 @@
+package flash.system
+{
+	/// Lets the SWF file communicate with either Flash Player or the program hosting Flash Player, such as a web browser.
+	public function fscommand (command:String, args:String) : void;
+
+}
+

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/AntiAliasType.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/AntiAliasType.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.text
+{
+	/// The AntiAliasType class provides values for anti-aliasing in the flash.text.TextField class.
+	public class AntiAliasType extends Object
+	{
+		/// Sets anti-aliasing to advanced anti-aliasing.
+		public static const ADVANCED : String;
+		/// Sets anti-aliasing to the anti-aliasing that is used in Flash Player 7 and earlier.
+		public static const NORMAL : String;
+
+		public function AntiAliasType ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/CSMSettings.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/CSMSettings.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,16 @@
+package flash.text
+{
+	/// The CSMSettings class contains properties for use with the TextRenderer.setAdvancedAntiAliasingTable() method to provide continuous stroke modulation (CSM).
+	public class CSMSettings extends Object
+	{
+		/// The size, in pixels, for which the settings apply.
+		public var fontSize : Number;
+		/// The inside cutoff value, above which densities are set to a maximum density value (such as 255).
+		public var insideCutoff : Number;
+		/// The outside cutoff value, below which densities are set to zero.
+		public var outsideCutoff : Number;
+
+		/// Creates a new CSMSettings object which stores stroke values for custom anti-aliasing settings.
+		public function CSMSettings (fontSize:Number, insideCutoff:Number, outsideCutoff:Number);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/Font.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/Font.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,26 @@
+package flash.text
+{
+	/// The Font class is used to manage embedded fonts in SWF files.
+	public class Font extends Object
+	{
+		/// The name of an embedded font.
+		public function get fontName () : String;
+
+		/// The style of the font.
+		public function get fontStyle () : String;
+
+		/// The type of the font.
+		public function get fontType () : String;
+
+		/// Specifies whether to provide a list of the currently available embedded fonts.
+		public static function enumerateFonts (enumerateDeviceFonts:Boolean = false) : Array;
+
+		public function Font ();
+
+		/// Specifies whether a provided string can be displayed using the currently assigned font.
+		public function hasGlyphs (str:String) : Boolean;
+
+		/// Registers a font class in the global font list.
+		public static function registerFont (font:Class) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/FontStyle.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/FontStyle.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.text
+{
+	/// The FontStyle class provides values for the TextRenderer class.
+	public class FontStyle extends Object
+	{
+		/// Defines the bold style of a font for the fontStyle parameter in the setAdvancedAntiAliasingTable() method.
+		public static const BOLD : String;
+		/// Defines the combined bold and italic style of a font for the fontStyle parameter in the setAdvancedAntiAliasingTable() method.
+		public static const BOLD_ITALIC : String;
+		/// Defines the italic style of a font for the fontStyle parameter in the setAdvancedAntiAliasingTable() method.
+		public static const ITALIC : String;
+		/// Defines the plain style of a font for the fontStyle parameter in the setAdvancedAntiAliasingTable() method.
+		public static const REGULAR : String;
+
+		public function FontStyle ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/FontType.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/FontType.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.text
+{
+	/// The FontType class contains the enumerated constants "embedded" and "device" for the fontType property of the Font class.
+	public class FontType extends Object
+	{
+		/// Indicates that this is a device font.
+		public static const DEVICE : String;
+		/// Indicates that this is an embedded font.
+		public static const EMBEDDED : String;
+		/// Indicates that this is an embedded CFF font.
+		public static const EMBEDDED_CFF : String;
+
+		public function FontType ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/GridFitType.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/GridFitType.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.text
+{
+	/// The GridFitType class defines values for grid fitting in the TextField class.
+	public class GridFitType extends Object
+	{
+		/// Doesn't set grid fitting.
+		public static const NONE : String;
+		/// Fits strong horizontal and vertical lines to the pixel grid.
+		public static const PIXEL : String;
+		/// Fits strong horizontal and vertical lines to the sub-pixel grid on LCD monitors.
+		public static const SUBPIXEL : String;
+
+		public function GridFitType ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/StaticText.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/StaticText.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.text
+{
+	import flash.display.DisplayObject;
+
+	/// This class represents StaticText objects on the display list.
+	public class StaticText extends DisplayObject
+	{
+		/// Returns the current text of the static text field.
+		public function get text () : String;
+
+		public function StaticText ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/StyleSheet.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/StyleSheet.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,30 @@
+package flash.text
+{
+	import flash.events.EventDispatcher;
+	import flash.text.TextFormat;
+
+	/// The StyleSheet class lets you create a StyleSheet object that contains text formatting rules for font size, color, and other styles.
+	public class StyleSheet extends EventDispatcher
+	{
+		/// An array that contains the names (as strings) of all of the styles registered in this style sheet.
+		public function get styleNames () : Array;
+
+		/// Removes all styles from the style sheet object.
+		public function clear () : void;
+
+		/// Returns a copy of the style object associated with the style named styleName.
+		public function getStyle (styleName:String) : Object;
+
+		/// Parses the CSS in cssText and loads the StyleSheet with it.
+		public function parseCSS (CSSText:String) : void;
+
+		/// Adds a new style with the specified name to the style sheet object.
+		public function setStyle (styleName:String, styleObject:Object) : void;
+
+		/// Creates a new StyleSheet object.
+		public function StyleSheet ();
+
+		/// Extends the CSS parsing capability.
+		public function transform (formatObject:Object) : TextFormat;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextColorType.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextColorType.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.text
+{
+	/// The TextColorType class provides color values for the flash.text.TextRenderer class.
+	public class TextColorType extends Object
+	{
+		/// Used in the colorType parameter in the setAdvancedAntiAliasingTable() method.
+		public static const DARK_COLOR : String;
+		/// Used in the colorType parameter in the setAdvancedAntiAliasingTable() method.
+		public static const LIGHT_COLOR : String;
+
+		public function TextColorType ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextDisplayMode.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextDisplayMode.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.text
+{
+	/// The TextDisplayMode class contains values that control the subpixel anti-aliasing of the advanced anti-aliasing system.
+	public class TextDisplayMode extends Object
+	{
+		/// Forces Flash Player to display grayscale anti-aliasing.
+		public static const CRT : String;
+		/// Allows Flash Player to choose LCD or CRT mode.
+		public static const DEFAULT : String;
+		/// Forces Flash Player to use LCD subpixel anti-aliasing.
+		public static const LCD : String;
+
+		public function TextDisplayMode ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextExtent.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextExtent.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,14 @@
+package flash.text
+{
+	public class TextExtent extends Object
+	{
+		public var ascent : Number;
+		public var descent : Number;
+		public var height : Number;
+		public var textFieldHeight : Number;
+		public var textFieldWidth : Number;
+		public var width : Number;
+
+		public function TextExtent (width:Number, height:Number, textFieldWidth:Number, textFieldHeight:Number, ascent:Number, descent:Number);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextField.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextField.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,246 @@
+package flash.text
+{
+	import flash.display.InteractiveObject;
+	import flash.text.TextFormat;
+	import flash.display.DisplayObject;
+	import flash.geom.Rectangle;
+	import flash.text.StyleSheet;
+	import flash.text.TextLineMetrics;
+
+	/**
+	 * Flash Player dispatches the textInput event when a user enters one or more characters of text.
+	 * @eventType flash.events.TextEvent.TEXT_INPUT
+	 */
+	[Event(name="textInput", type="flash.events.TextEvent")] 
+
+	/**
+	 * Dispatched by a TextField object after the user scrolls.
+	 * @eventType flash.events.Event.SCROLL
+	 */
+	[Event(name="scroll", type="flash.events.Event")] 
+
+	/**
+	 * Dispatched when a user clicks a hyperlink in an HTML-enabled text field, where the URL begins with "event:".
+	 * @eventType flash.events.TextEvent.LINK
+	 */
+	[Event(name="link", type="flash.events.TextEvent")] 
+
+	/**
+	 * Dispatched after a control value is modified, unlike the textInput event, which is dispatched before the value is modified.
+	 * @eventType flash.events.Event.CHANGE
+	 */
+	[Event(name="change", type="flash.events.Event")] 
+
+	/// The TextField class is used to create display objects for text display and input.
+	public class TextField extends InteractiveObject
+	{
+		/// When set to true and the text field is not in focus, Flash Player highlights the selection in the text field in gray.
+		public function get alwaysShowSelection () : Boolean;
+		public function set alwaysShowSelection (value:Boolean) : void;
+
+		/// The type of anti-aliasing used for this text field.
+		public function get antiAliasType () : String;
+		public function set antiAliasType (antiAliasType:String) : void;
+
+		/// Controls automatic sizing and alignment of text fields.
+		public function get autoSize () : String;
+		public function set autoSize (value:String) : void;
+
+		/// Specifies whether the text field has a background fill.
+		public function get background () : Boolean;
+		public function set background (value:Boolean) : void;
+
+		/// The color of the text field background.
+		public function get backgroundColor () : uint;
+		public function set backgroundColor (value:uint) : void;
+
+		/// Specifies whether the text field has a border.
+		public function get border () : Boolean;
+		public function set border (value:Boolean) : void;
+
+		/// The color of the text field border.
+		public function get borderColor () : uint;
+		public function set borderColor (value:uint) : void;
+
+		/// An integer (1-based index) that indicates the bottommost line that is currently visible in the specified text field.
+		public function get bottomScrollV () : int;
+
+		/// The index of the insertion point (caret) position.
+		public function get caretIndex () : int;
+
+		/// A Boolean value that specifies whether extra white space (spaces, line breaks, and so on) in a text field with HTML text is removed.
+		public function get condenseWhite () : Boolean;
+		public function set condenseWhite (value:Boolean) : void;
+
+		/// Specifies the format applied to newly inserted text, such as text inserted with the replaceSelectedText() method or text entered by a user.
+		public function get defaultTextFormat () : TextFormat;
+		public function set defaultTextFormat (format:TextFormat) : void;
+
+		/// Specifies whether the text field is a password text field.
+		public function get displayAsPassword () : Boolean;
+		public function set displayAsPassword (value:Boolean) : void;
+
+		/// Specifies whether to render by using embedded font outlines.
+		public function get embedFonts () : Boolean;
+		public function set embedFonts (value:Boolean) : void;
+
+		/// The type of grid fitting used for this text field.
+		public function get gridFitType () : String;
+		public function set gridFitType (gridFitType:String) : void;
+
+		/// Contains the HTML representation of the text field contents.
+		public function get htmlText () : String;
+		public function set htmlText (value:String) : void;
+
+		/// The number of characters in a text field.
+		public function get length () : int;
+
+		/// The maximum number of characters that the text field can contain, as entered by a user.
+		public function get maxChars () : int;
+		public function set maxChars (value:int) : void;
+
+		/// The maximum value of scrollH.
+		public function get maxScrollH () : int;
+
+		/// The maximum value of scrollV.
+		public function get maxScrollV () : int;
+
+		/// A Boolean value that indicates whether Flash Player automatically scrolls multiline text fields when the user clicks a text field and rolls the mouse wheel.
+		public function get mouseWheelEnabled () : Boolean;
+		public function set mouseWheelEnabled (value:Boolean) : void;
+
+		/// Indicates whether field is a multiline text field.
+		public function get multiline () : Boolean;
+		public function set multiline (value:Boolean) : void;
+
+		/// Defines the number of text lines in a multiline text field.
+		public function get numLines () : int;
+
+		/// Indicates the set of characters that a user can enter into the text field.
+		public function get restrict () : String;
+		public function set restrict (value:String) : void;
+
+		/// The current horizontal scrolling position.
+		public function get scrollH () : int;
+		public function set scrollH (value:int) : void;
+
+		/// The vertical position of text in a text field.
+		public function get scrollV () : int;
+		public function set scrollV (value:int) : void;
+
+		/// A Boolean value that indicates whether the text field is selectable.
+		public function get selectable () : Boolean;
+		public function set selectable (value:Boolean) : void;
+
+		public function get selectedText () : String;
+
+		/// The zero-based character index value of the first character in the current selection.
+		public function get selectionBeginIndex () : int;
+
+		/// The zero-based character index value of the last character in the current selection.
+		public function get selectionEndIndex () : int;
+
+		/// The sharpness of the glyph edges in this text field.
+		public function get sharpness () : Number;
+		public function set sharpness (value:Number) : void;
+
+		/// Attaches a style sheet to the text field.
+		public function get styleSheet () : StyleSheet;
+		public function set styleSheet (value:StyleSheet) : void;
+
+		/// A string that is the current text in the text field.
+		public function get text () : String;
+		public function set text (value:String) : void;
+
+		/// The color of the text in a text field, in hexadecimal format.
+		public function get textColor () : uint;
+		public function set textColor (value:uint) : void;
+
+		/// The height of the text in pixels.
+		public function get textHeight () : Number;
+
+		/// The width of the text in pixels.
+		public function get textWidth () : Number;
+
+		/// The thickness of the glyph edges in this text field.
+		public function get thickness () : Number;
+		public function set thickness (value:Number) : void;
+
+		/// The type of the text field.
+		public function get type () : String;
+		public function set type (value:String) : void;
+
+		/// Specifies whether to copy and paste the text formatting along with the text.
+		public function get useRichTextClipboard () : Boolean;
+		public function set useRichTextClipboard (value:Boolean) : void;
+
+		/// A Boolean value that indicates whether the text field has word wrap.
+		public function get wordWrap () : Boolean;
+		public function set wordWrap (value:Boolean) : void;
+
+		/// Appends text to the end of the existing text of the TextField.
+		public function appendText (newText:String) : void;
+
+		/// Returns a rectangle that is the bounding box of the character.
+		public function getCharBoundaries (charIndex:int) : Rectangle;
+
+		/// Returns the zero-based index value of the character.
+		public function getCharIndexAtPoint (x:Number, y:Number) : int;
+
+		/// The zero-based index value of the character.
+		public function getFirstCharInParagraph (charIndex:int) : int;
+
+		/// Returns a DisplayObject reference for the given id, for an image or SWF file that has been added to an HTML-formatted text field by using an <img> tag.
+		public function getImageReference (id:String) : DisplayObject;
+
+		/// The zero-based index value of the line at a specified point.
+		public function getLineIndexAtPoint (x:Number, y:Number) : int;
+
+		/// The zero-based index value of the line containing the character that the the charIndex parameter specifies.
+		public function getLineIndexOfChar (charIndex:int) : int;
+
+		/// Returns the number of characters in a specific text line.
+		public function getLineLength (lineIndex:int) : int;
+
+		/// Returns metrics information about a given text line.
+		public function getLineMetrics (lineIndex:int) : TextLineMetrics;
+
+		/// The zero-based index value of the first character in the line.
+		public function getLineOffset (lineIndex:int) : int;
+
+		/// The text string contained in the specified line.
+		public function getLineText (lineIndex:int) : String;
+
+		/// The zero-based index value of the character.
+		public function getParagraphLength (charIndex:int) : int;
+
+		public function getRawText () : String;
+
+		/// Returns a TextFormat object.
+		public function getTextFormat (beginIndex:int = -1, endIndex:int = -1) : TextFormat;
+
+		public function getTextRuns (beginIndex:int = 0, endIndex:int = 2147483647) : Array;
+
+		public function getXMLText (beginIndex:int = 0, endIndex:int = 2147483647) : String;
+
+		public function insertXMLText (beginIndex:int, endIndex:int, richText:String, pasting:Boolean = false) : void;
+
+		/// Returns true if an embedded font is available with the specified fontName and fontStyle where Font.fontType is flash.text.FontType.EMBEDDED.
+		public static function isFontCompatible (fontName:String, fontStyle:String) : Boolean;
+
+		/// Replaces the current selection with the contents of the value parameter.
+		public function replaceSelectedText (value:String) : void;
+
+		/// Replaces a range of characters.
+		public function replaceText (beginIndex:int, endIndex:int, newText:String) : void;
+
+		/// Sets a new text selection.
+		public function setSelection (beginIndex:int, endIndex:int) : void;
+
+		/// Applies text formatting.
+		public function setTextFormat (format:TextFormat, beginIndex:int = -1, endIndex:int = -1) : void;
+
+		/// Creates a new TextField instance.
+		public function TextField ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextFieldAutoSize.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextFieldAutoSize.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.text
+{
+	/// The TextFieldAutoSize class is an enumeration of constant values used in setting the autoSize property of the TextField class.
+	public class TextFieldAutoSize extends Object
+	{
+		/// Specifies that the text is to be treated as center-justified text.
+		public static const CENTER : String;
+		/// Specifies that the text is to be treated as left-justified text, meaning that the left side of the text field remains fixed and any resizing of a single line is on the right side.
+		public static const LEFT : String;
+		/// Specifies that no resizing is to occur.
+		public static const NONE : String;
+		/// Specifies that the text is to be treated as right-justified text, meaning that the right side of the text field remains fixed and any resizing of a single line is on the left side.
+		public static const RIGHT : String;
+
+		public function TextFieldAutoSize ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextFieldType.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextFieldType.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.text
+{
+	/// The TextFieldType class is an enumeration of constant values used in setting the type property of the TextField class.
+	public class TextFieldType extends Object
+	{
+		/// Used to specify a dynamic TextField.
+		public static const DYNAMIC : String;
+		/// Used to specify an input TextField.
+		public static const INPUT : String;
+
+		public function TextFieldType ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextFormat.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextFormat.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,84 @@
+package flash.text
+{
+	/// The TextFormat class represents character formatting information.
+	public class TextFormat extends Object
+	{
+		/// Indicates the alignment of the paragraph.
+		public function get align () : String;
+		public function set align (value:String) : void;
+
+		/// Indicates the block indentation in pixels.
+		public function get blockIndent () : Object;
+		public function set blockIndent (value:Object) : void;
+
+		/// Specifies whether the text is boldface.
+		public function get bold () : Object;
+		public function set bold (value:Object) : void;
+
+		/// Indicates that the text is part of a bulleted list.
+		public function get bullet () : Object;
+		public function set bullet (value:Object) : void;
+
+		/// Indicates the color of the text.
+		public function get color () : Object;
+		public function set color (value:Object) : void;
+
+		public function get display () : String;
+		public function set display (value:String) : void;
+
+		/// The name of the font for text in this text format, as a string.
+		public function get font () : String;
+		public function set font (value:String) : void;
+
+		/// Indicates the indentation from the left margin to the first character in the paragraph.
+		public function get indent () : Object;
+		public function set indent (value:Object) : void;
+
+		/// Indicates whether text in this text format is italicized.
+		public function get italic () : Object;
+		public function set italic (value:Object) : void;
+
+		/// A Boolean value that indicates whether kerning is enabled (true) or disabled (false).
+		public function get kerning () : Object;
+		public function set kerning (value:Object) : void;
+
+		/// An integer representing the amount of vertical space (called leading) between lines.
+		public function get leading () : Object;
+		public function set leading (value:Object) : void;
+
+		/// The left margin of the paragraph, in pixels.
+		public function get leftMargin () : Object;
+		public function set leftMargin (value:Object) : void;
+
+		/// A number representing the amount of space that is uniformly distributed between all characters.
+		public function get letterSpacing () : Object;
+		public function set letterSpacing (value:Object) : void;
+
+		/// The right margin of the paragraph, in pixels.
+		public function get rightMargin () : Object;
+		public function set rightMargin (value:Object) : void;
+
+		/// The point size of text in this text format.
+		public function get size () : Object;
+		public function set size (value:Object) : void;
+
+		/// Specifies custom tab stops as an array of non-negative integers.
+		public function get tabStops () : Array;
+		public function set tabStops (value:Array) : void;
+
+		/// Indicates the target window where the hyperlink is displayed.
+		public function get target () : String;
+		public function set target (value:String) : void;
+
+		/// Indicates whether the text that uses this text format is underlined (true) or not (false).
+		public function get underline () : Object;
+		public function set underline (value:Object) : void;
+
+		/// Indicates the target URL for the text in this text format.
+		public function get url () : String;
+		public function set url (value:String) : void;
+
+		/// Creates a TextFormat object with the specified properties.
+		public function TextFormat (font:String = null, size:Object = null, color:Object = null, bold:Object = null, italic:Object = null, underline:Object = null, url:String = null, target:String = null, align:String = null, leftMargin:Object = null, rightMargin:Object = null, indent:Object = null, leading:Object = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextFormatAlign.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextFormatAlign.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.text
+{
+	/// The TextFormatAlign class provides values for text alignment in the TextFormat class.
+	public class TextFormatAlign extends Object
+	{
+		/// Constant; centers the text in the text field.
+		public static const CENTER : String;
+		/// Constant; justifies text within the text field.
+		public static const JUSTIFY : String;
+		/// Constant; aligns text to the left within the text field.
+		public static const LEFT : String;
+		/// Constant; aligns text to the right within the text field.
+		public static const RIGHT : String;
+
+		public function TextFormatAlign ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextFormatDisplay.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextFormatDisplay.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,10 @@
+package flash.text
+{
+	public class TextFormatDisplay extends Object
+	{
+		public static const BLOCK : String;
+		public static const INLINE : String;
+
+		public function TextFormatDisplay ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextLineMetrics.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextLineMetrics.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,22 @@
+package flash.text
+{
+	/// The TextLineMetrics class contains information about the text position and measurements of a line of text within a text field.
+	public class TextLineMetrics extends Object
+	{
+		/// The ascent value of the text is the length from the baseline to the top of the line height in pixels.
+		public var ascent : Number;
+		/// The descent value of the text is the length from the baseline to the bottom depth of the line in pixels.
+		public var descent : Number;
+		/// The height value of the text of the selected lines (not necessarily the complete text) in pixels.
+		public var height : Number;
+		/// The leading value is the measurement of the vertical distance between the lines of text.
+		public var leading : Number;
+		/// The width value is the width of the text of the selected lines (not necessarily the complete text) in pixels.
+		public var width : Number;
+		/// The x value is the left position of the first character in pixels.
+		public var x : Number;
+
+		/// Contains information about the text position and measurements of a line of text in a text field.
+		public function TextLineMetrics (x:Number, width:Number, height:Number, ascent:Number, descent:Number, leading:Number);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextRenderer.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextRenderer.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,22 @@
+package flash.text
+{
+	/// The TextRenderer class provides functionality for the advanced anti-aliasing capability of embedded fonts.
+	public class TextRenderer extends Object
+	{
+		public static function get antiAliasType () : String;
+		public static function set antiAliasType (value:String) : void;
+
+		/// Controls the rendering of advanced anti-aliased text.
+		public static function get displayMode () : String;
+		public static function set displayMode (value:String) : void;
+
+		/// The adaptively sampled distance fields (ADFs) quality level for advanced anti-aliasing.
+		public static function get maxLevel () : int;
+		public static function set maxLevel (value:int) : void;
+
+		/// Sets a custom continuous stroke modulation (CSM) lookup table for a font.
+		public static function setAdvancedAntiAliasingTable (fontName:String, fontStyle:String, colorType:String, advancedAntiAliasingTable:Array) : void;
+
+		public function TextRenderer ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextRun.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextRun.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.text
+{
+	import flash.text.TextFormat;
+
+	public class TextRun extends Object
+	{
+		public var beginIndex : int;
+		public var endIndex : int;
+		public var textFormat : TextFormat;
+
+		public function TextRun (beginIndex:int, endIndex:int, textFormat:TextFormat);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextSnapshot.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/TextSnapshot.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,35 @@
+package flash.text
+{
+	/// TextSnapshot objects let you work with static text in a movie clip.
+	public class TextSnapshot extends Object
+	{
+		/// The number of characters in a TextSnapshot object.
+		public function get charCount () : int;
+
+		/// Searches the specified TextSnapshot object and returns the position of the first occurrence of textToFind found at or after beginIndex.
+		public function findText (beginIndex:int, textToFind:String, caseSensitive:Boolean) : int;
+
+		/// Returns a Boolean value that specifies whether a TextSnapshot object contains selected text in the specified range.
+		public function getSelected (beginIndex:int, endIndex:int) : Boolean;
+
+		/// Returns a string that contains all the characters specified by the corresponding setSelected() method.
+		public function getSelectedText (includeLineEndings:Boolean = false) : String;
+
+		/// Returns a string that contains all the characters specified by the beginIndex and endIndex parameters.
+		public function getText (beginIndex:int, endIndex:int, includeLineEndings:Boolean = false) : String;
+
+		/// Returns an array of objects that contains information about a run of text.
+		public function getTextRunInfo (beginIndex:int, endIndex:int) : Array;
+
+		/// Lets you determine which character within a TextSnapshot object is on or near the specified x, y coordinates of the movie clip containing the text in the TextSnapshot object.
+		public function hitTestTextNearPos (x:Number, y:Number, maxDistance:Number = 0) : Number;
+
+		/// Specifies the color to use when highlighting characters that have been selected with the  setSelected() method.
+		public function setSelectColor (hexColor:uint = 16776960) : void;
+
+		/// Specifies a range of characters in a TextSnapshot object to be selected or deselected.
+		public function setSelected (beginIndex:int, endIndex:int, select:Boolean) : void;
+
+		public function TextSnapshot ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/BreakOpportunity.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/BreakOpportunity.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.text.engine
+{
+	/// The BreakOpportunity class is an enumeration of constant values that you can use to set the breakOpportunity property of the ElementFormat class.
+	public class BreakOpportunity extends Object
+	{
+		/// Treats all characters in the ContentElement object as mandatory line break opportunities.
+		public static const ALL : String;
+		/// Treats any character in the ContentElement object as a line break opportunity.
+		public static const ANY : String;
+		/// Bases line break opportunities on Unicode character properties.
+		public static const AUTO : String;
+		/// Treats no characters in the ContentElement object as line break opportunities.
+		public static const NONE : String;
+
+		public function BreakOpportunity ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/CFFHinting.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/CFFHinting.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.text.engine
+{
+	/// The CFFHinting class defines values for cff hinting in the FontDescription class.
+	public class CFFHinting extends Object
+	{
+		/// Fits strong horizontal stems to the pixel grid for improved readability.
+		public static const HORIZONTAL_STEM : String;
+		/// No hinting is applied.
+		public static const NONE : String;
+
+		public function CFFHinting ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/ContentElement.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/ContentElement.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,46 @@
+package flash.text.engine
+{
+	import flash.text.engine.TextBlock;
+	import flash.text.engine.ElementFormat;
+	import flash.events.EventDispatcher;
+	import flash.text.engine.GroupElement;
+
+	/// The ContentElement class serves as a base class for the element types that can appear in a GroupElement, namely a GraphicElement, another GroupElement, or a TextElement.
+	public class ContentElement extends Object
+	{
+		/// Indicates the presence a graphic element in the text.
+		public static const GRAPHIC_ELEMENT : uint;
+		/// Provides a way for the author to associate arbitrary data with the element.
+		public var userData : *;
+
+		/// The ElementFormat object used for the element.
+		public function get elementFormat () : ElementFormat;
+		public function set elementFormat (value:ElementFormat) : void;
+
+		/// The EventDispatcher object that receives copies of every event dispatched to valid text lines based on this content element.
+		public function get eventMirror () : EventDispatcher;
+		public function set eventMirror (value:EventDispatcher) : void;
+
+		/// The GroupElement object that contains this element, or null if it is not in a group.
+		public function get groupElement () : GroupElement;
+
+		/// A copy of the text in the element, including the U+FDEF characters.
+		public function get rawText () : String;
+
+		/// A copy of the text in the element, not including the U+FDEF characters, which represent graphic elements in the String.
+		public function get text () : String;
+
+		/// The TextBlock to which this element belongs.
+		public function get textBlock () : TextBlock;
+
+		/// The index in the text block of the first character of this element.
+		public function get textBlockBeginIndex () : int;
+
+		/// The rotation to apply to the element as a unit.
+		public function get textRotation () : String;
+		public function set textRotation (value:String) : void;
+
+		/// Calling the new ContentElement() constructor throws an ArgumentError exception.
+		public function ContentElement (elementFormat:ElementFormat = null, eventMirror:EventDispatcher = null, textRotation:String = "rotate0");
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/DigitCase.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/DigitCase.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.text.engine
+{
+	/// The DigitCase class is an enumeration of constant values used in setting the digitCase property of the ElementFormat class.
+	public class DigitCase extends Object
+	{
+		/// Used to specify default digit case.
+		public static const DEFAULT : String;
+		/// Used to specify lining digit case.
+		public static const LINING : String;
+		/// Used to specify old style digit case.
+		public static const OLD_STYLE : String;
+
+		public function DigitCase ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/DigitWidth.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/DigitWidth.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.text.engine
+{
+	/// The DigitWidth class is an enumeration of constant values used in setting the digitWidth property of the ElementFormat class.
+	public class DigitWidth extends Object
+	{
+		/// Used to specify default digit width.
+		public static const DEFAULT : String;
+		/// Used to specify proportional digit width.
+		public static const PROPORTIONAL : String;
+		/// Used to specify tabular digit width.
+		public static const TABULAR : String;
+
+		public function DigitWidth ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/EastAsianJustifier.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/EastAsianJustifier.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,18 @@
+package flash.text.engine
+{
+	import flash.text.engine.TextJustifier;
+
+	/// The EastAsianJustifier class has properties to control the justification options for text lines whose content is primarily East Asian text.
+	public class EastAsianJustifier extends TextJustifier
+	{
+		/// Specifies the justification style for the text in a text block.
+		public function get justificationStyle () : String;
+		public function set justificationStyle (value:String) : void;
+
+		/// Constructs a cloned copy of the EastAsianJustifier.
+		public function clone () : TextJustifier;
+
+		/// Creates a EastAsianJustifier object.
+		public function EastAsianJustifier (locale:String = "ja", lineJustification:String = "allButLast", justificationStyle:String = "pushInKinsoku");
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/ElementFormat.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/ElementFormat.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,91 @@
+package flash.text.engine
+{
+	import flash.text.engine.FontDescription;
+	import flash.text.engine.ElementFormat;
+	import flash.text.engine.FontMetrics;
+
+	/// The ElementFormat class represents formatting information which can be applied to a ContentElement.
+	public class ElementFormat extends Object
+	{
+		/// Specifies which of the baselines of the line containing the element the dominantBaseline snaps to, thus determining the vertical position of the element in the line.
+		public function get alignmentBaseline () : String;
+		public function set alignmentBaseline (alignmentBaseline:String) : void;
+
+		/// Provides a way for the author to automatically set the alpha property of all line atoms based on the element format to the specified Number.
+		public function get alpha () : Number;
+		public function set alpha (value:Number) : void;
+
+		/// Indicates the baseline shift for the element in pixels.
+		public function get baselineShift () : Number;
+		public function set baselineShift (value:Number) : void;
+
+		/// The line break opportunity applied to this text.
+		public function get breakOpportunity () : String;
+		public function set breakOpportunity (opportunityType:String) : void;
+
+		/// Indicates the color of the text.
+		public function get color () : uint;
+		public function set color (value:uint) : void;
+
+		/// The digit case used for this text.
+		public function get digitCase () : String;
+		public function set digitCase (digitCaseType:String) : void;
+
+		/// The digit width used for this text.
+		public function get digitWidth () : String;
+		public function set digitWidth (digitWidthType:String) : void;
+
+		/// Specifies which of the baselines of the element snaps to the alignmentBaseline to determine the vertical position of the element on the line.
+		public function get dominantBaseline () : String;
+		public function set dominantBaseline (dominantBaseline:String) : void;
+
+		/// An object which encapsulates properties necessary to describe a font.
+		public function get fontDescription () : FontDescription;
+		public function set fontDescription (value:FontDescription) : void;
+
+		/// The point size of text.
+		public function get fontSize () : Number;
+		public function set fontSize (value:Number) : void;
+
+		/// The kerning used for this text.
+		public function get kerning () : String;
+		public function set kerning (value:String) : void;
+
+		/// The ligature level used for this text.
+		public function get ligatureLevel () : String;
+		public function set ligatureLevel (ligatureLevelType:String) : void;
+
+		/// The locale of the text.
+		public function get locale () : String;
+		public function set locale (value:String) : void;
+
+		/// Indicates whether or not the ElementFormat is locked.
+		public function get locked () : Boolean;
+		public function set locked (value:Boolean) : void;
+
+		/// Sets the rotation applied to individual glyphs.
+		public function get textRotation () : String;
+		public function set textRotation (value:String) : void;
+
+		/// The tracking or manual kerning applied to the left of each glyph in pixels.
+		public function get trackingLeft () : Number;
+		public function set trackingLeft (value:Number) : void;
+
+		/// The tracking or manual kerning applied to the right of each glyph in pixels.
+		public function get trackingRight () : Number;
+		public function set trackingRight (value:Number) : void;
+
+		/// The typographic case used for this text.
+		public function get typographicCase () : String;
+		public function set typographicCase (typographicCaseType:String) : void;
+
+		/// Constructs an unlocked, cloned copy of the ElementFormat.
+		public function clone () : ElementFormat;
+
+		/// Creates an ElementFormat object.
+		public function ElementFormat (fontDescription:FontDescription = null, fontSize:Number = 12, color:uint = 0, alpha:Number = 1, textRotation:String = "auto", dominantBaseline:String = "roman", alignmentBaseline:String = "useDominantBaseline", baselineShift:Number = 0, kerning:String = "on", trackingRight:Number = 0, trackingLeft:Number = 0, locale:String = "en", breakOpportunity:String = "auto", digitCase:String = "default", digitWidth:String = "default", ligatureLevel:String = "common", typographicCase:String = "default");
+
+		/// Returns a FontMetrics object with properties which describe the emBox, strikethrough position, strikethrough thickness, underline position, and underline thickness for the font specified by fontDescription and fontSize.
+		public function getFontMetrics () : FontMetrics;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/FontDescription.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/FontDescription.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,45 @@
+package flash.text.engine
+{
+	import flash.text.engine.FontDescription;
+
+	/// The FontDescription class represents properties necessary to describe a font.
+	public class FontDescription extends Object
+	{
+		/// The type of CFF hinting used for this text.
+		public function get cffHinting () : String;
+		public function set cffHinting (value:String) : void;
+
+		/// Specifies how the font should be looked up.
+		public function get fontLookup () : String;
+		public function set fontLookup (value:String) : void;
+
+		/// The name of the font to use, or a comma-separated list of font names.
+		public function get fontName () : String;
+		public function set fontName (value:String) : void;
+
+		/// Specifies the font posture.
+		public function get fontPosture () : String;
+		public function set fontPosture (value:String) : void;
+
+		/// Specifies the font weight.
+		public function get fontWeight () : String;
+		public function set fontWeight (value:String) : void;
+
+		/// Indicates whether or not the FontDescription is locked.
+		public function get locked () : Boolean;
+		public function set locked (value:Boolean) : void;
+
+		/// The rendering mode used for this text.
+		public function get renderingMode () : String;
+		public function set renderingMode (value:String) : void;
+
+		/// Constructs an unlocked, cloned copy of the FontDescription.
+		public function clone () : FontDescription;
+
+		/// Creates a FontDescription object.
+		public function FontDescription (fontName:String = "_serif", fontWeight:String = "normal", fontPosture:String = "normal", fontLookup:String = "device", renderingMode:String = "cff", cffHinting:String = "horizontalStem");
+
+		/// Returns true if an embedded font is available with the specified fontName, fontWeight, and fontPosture where Font.fontType is flash.text.FontType.EMBEDDED_CFF.
+		public static function isFontCompatible (fontName:String, fontWeight:String, fontPosture:String) : Boolean;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/FontLookup.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/FontLookup.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.text.engine
+{
+	/// The FontLookup class is an enumeration of constant values used with FontDescription.fontLookup.
+	public class FontLookup extends Object
+	{
+		/// Used to indicate device font lookup.
+		public static const DEVICE : String;
+		/// Used to indicate embedded CFF font lookup.
+		public static const EMBEDDED_CFF : String;
+
+		public function FontLookup ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/FontMetrics.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/FontMetrics.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,30 @@
+package flash.text.engine
+{
+	import flash.geom.Rectangle;
+
+	/// The FontMetrics class contains measurement and offset information about a font.
+	public class FontMetrics extends Object
+	{
+		/// The emBox value represents the design space of the font and is used to place Chinese, Korean, or Japanese glyphs relative to the Roman baseline.
+		public var emBox : Rectangle;
+		/// The strikethroughOffset value is the suggested vertical offset from the Roman baseline for a strikethrough.
+		public var strikethroughOffset : Number;
+		/// The strikethroughThickness value is the suggested thickness for a strikethrough.
+		public var strikethroughThickness : Number;
+		/// The subscriptOffset value is the suggested vertical offset from the Roman baseline for a subscript.
+		public var subscriptOffset : Number;
+		/// The subscriptScale value is the suggested scale factor to apply to the point size for a subscript.
+		public var subscriptScale : Number;
+		/// The superscriptOffset value is the suggested vertical offset from the Roman baseline for a superscript.
+		public var superscriptOffset : Number;
+		/// The superscriptScale value is the suggested scale factor to apply to the point size for a superscript.
+		public var superscriptScale : Number;
+		/// The underlineOffset value is the suggested vertical offset from the Roman baseline for an underline.
+		public var underlineOffset : Number;
+		/// The underlineThickness value is the suggested thickness for an underline.
+		public var underlineThickness : Number;
+
+		/// Creates a FontMetrics object.
+		public function FontMetrics (emBox:Rectangle, strikethroughOffset:Number, strikethroughThickness:Number, underlineOffset:Number, underlineThickness:Number, subscriptOffset:Number, subscriptScale:Number, superscriptOffset:Number, superscriptScale:Number);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/FontPosture.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/FontPosture.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.text.engine
+{
+	/// The FontPosture class is an enumeration of constant values used with FontDescription.fontPosture.
+	public class FontPosture extends Object
+	{
+		/// Used to indicate italic font posture.
+		public static const ITALIC : String;
+		/// Used to indicate normal font posture.
+		public static const NORMAL : String;
+
+		public function FontPosture ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/FontWeight.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/FontWeight.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.text.engine
+{
+	/// The FontWeight class is an enumeration of constant values used with FontDescription.fontWeight.
+	public class FontWeight extends Object
+	{
+		/// Used to indicate bold font weight.
+		public static const BOLD : String;
+		/// Used to indicate normal font weight.
+		public static const NORMAL : String;
+
+		public function FontWeight ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/GraphicElement.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/GraphicElement.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,25 @@
+package flash.text.engine
+{
+	import flash.display.DisplayObject;
+	import flash.text.engine.ElementFormat;
+	import flash.events.EventDispatcher;
+
+	/// The GraphicElement class represents a graphic element in a TextBlock or GroupElement object.
+	public class GraphicElement extends ContentElement
+	{
+		/// The height in pixels to reserve for the graphic in the line.
+		public function get elementHeight () : Number;
+		public function set elementHeight (value:Number) : void;
+
+		/// The width in pixels to reserve for the graphic in the line.
+		public function get elementWidth () : Number;
+		public function set elementWidth (value:Number) : void;
+
+		/// The DisplayObject to be used as a graphic for the GraphicElement.
+		public function get graphic () : DisplayObject;
+		public function set graphic (value:DisplayObject) : void;
+
+		/// Creates a new GraphicElement instance.
+		public function GraphicElement (graphic:DisplayObject = null, elementWidth:Number = 15, elementHeight:Number = 15, elementFormat:ElementFormat = null, eventMirror:EventDispatcher = null, textRotation:String = "rotate0");
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/GroupElement.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/GroupElement.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,45 @@
+package flash.text.engine
+{
+	import flash.text.engine.ContentElement;
+	import flash.text.engine.TextElement;
+	import flash.text.engine.GroupElement;
+	import flash.text.engine.ElementFormat;
+	import flash.events.EventDispatcher;
+
+	/// A GroupElement object groups a collection of TextElement, GraphicElement, or other GroupElement objects that you can assign as a whole to the content property of a TextBlock object.
+	public class GroupElement extends ContentElement
+	{
+		/// The number of elements in the group.
+		public function get elementCount () : int;
+
+		/// Retrieves an element from within the group.
+		public function getElementAt (index:int) : ContentElement;
+
+		/// Returns the element containing the character specified by the charIndex parameter.
+		public function getElementAtCharIndex (charIndex:int) : ContentElement;
+
+		/// Returns the index of the element specified by the element parameter.
+		public function getElementIndex (element:ContentElement) : int;
+
+		/// Creates a new GroupElement instance.
+		public function GroupElement (elements:Vector.<ContentElement> = null, elementFormat:ElementFormat = null, eventMirror:EventDispatcher = null, textRotation:String = "rotate0");
+
+		/// Replaces the range of elements that the beginIndex and endIndex parameters specify with a new GroupElement containing those elements.
+		public function groupElements (beginIndex:int, endIndex:int) : GroupElement;
+
+		/// Merges the text from the range of elements that the beginIndex and endIndex parameters specify into the element specified by beginIndex without affecting the format of that element.
+		public function mergeTextElements (beginIndex:int, endIndex:int) : TextElement;
+
+		/// Replaces the range of elements that the beginIndex and endIndex parameters specify with the contents of the newElements parameter.
+		public function replaceElements (beginIndex:int, endIndex:int, newElements:Vector.<ContentElement>) : Vector.<ContentElement>;
+
+		/// Sets the elements in the group to the contents of the Vector.
+		public function setElements (value:Vector.<ContentElement>) : void;
+
+		/// Splits a portion of a TextElement in the group into a new TextElement which is inserted into the group following the specified TextElement.
+		public function splitTextElement (elementIndex:int, splitIndex:int) : TextElement;
+
+		/// Ungroups the elements in a nested GroupElement that groupIndex specifies within an outer GroupElement object.
+		public function ungroupElements (groupIndex:int) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/JustificationStyle.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/JustificationStyle.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.text.engine
+{
+	/// The JustificationStyle class is an enumeration of constant values for setting the justificationStyle property of the EastAsianJustifier class.
+	public class JustificationStyle extends Object
+	{
+		/// Bases justification on either expanding or compressing the line, whichever gives a result closest to the desired width.
+		public static const PRIORITIZE_LEAST_ADJUSTMENT : String;
+		/// Bases justification on compressing kinsoku at the end of the line, or expanding it if no kinsoku occurs or if that space is insufficient.
+		public static const PUSH_IN_KINSOKU : String;
+		/// Bases justification on expanding the line.
+		public static const PUSH_OUT_ONLY : String;
+
+		public function JustificationStyle ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/Kerning.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/Kerning.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.text.engine
+{
+	/// The Kerning class is an enumeration of constant values used with ElementFormat.kerning.
+	public class Kerning extends Object
+	{
+		/// Used to indicate kerning is enabled only for characters appropriate in Asian typography.
+		public static const AUTO : String;
+		/// Used to indicate kerning is disabled.
+		public static const OFF : String;
+		/// Used to indicate kerning is enabled.
+		public static const ON : String;
+
+		public function Kerning ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/LigatureLevel.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/LigatureLevel.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,19 @@
+package flash.text.engine
+{
+	/// The LigatureLevel class is an enumeration of constant values used in setting the ligatureLevel property of the ElementFormat class.
+	public class LigatureLevel extends Object
+	{
+		/// Used to specify common ligatures.
+		public static const COMMON : String;
+		/// Used to specify exotic ligatures.
+		public static const EXOTIC : String;
+		/// Used to specify minimum ligatures.
+		public static const MINIMUM : String;
+		/// Used to specify no ligatures.
+		public static const NONE : String;
+		/// Used to specify uncommon ligatures.
+		public static const UNCOMMON : String;
+
+		public function LigatureLevel ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/LineJustification.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/LineJustification.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.text.engine
+{
+	/// The LineJustification class is an enumeration of constant values used in setting the lineJustfication property of the TextJustifier subclasses.
+	public class LineJustification extends Object
+	{
+		/// Directs the text engine to justify all but the last line.
+		public static const ALL_BUT_LAST : String;
+		/// Directs the text engine to justify all lines.
+		public static const ALL_INCLUDING_LAST : String;
+		/// Directs the text engine to generate unjustified lines.
+		public static const UNJUSTIFIED : String;
+
+		public function LineJustification ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/RenderingMode.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/RenderingMode.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.text.engine
+{
+	/// The RenderingMode class provides values for rendering mode in the flash.text.engine.FontDescription class.
+	public class RenderingMode extends Object
+	{
+		/// Sets rendering mode to CFF.
+		public static const CFF : String;
+		/// Sets rendering mode to the rendering mode that is used in Flash Player 7 and earlier.
+		public static const NORMAL : String;
+
+		public function RenderingMode ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/SpaceJustifier.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/SpaceJustifier.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,18 @@
+package flash.text.engine
+{
+	import flash.text.engine.TextJustifier;
+
+	/// The SpaceJustifier class represents properties that control the justification options for text lines in a text block.
+	public class SpaceJustifier extends TextJustifier
+	{
+		/// Specifies whether to use letter spacing during justification.
+		public function get letterSpacing () : Boolean;
+		public function set letterSpacing (value:Boolean) : void;
+
+		/// Constructs a cloned copy of the SpaceJustifier.
+		public function clone () : TextJustifier;
+
+		/// Creates a SpaceJustifier object.
+		public function SpaceJustifier (locale:String = "en", lineJustification:String = "unjustified", letterSpacing:Boolean = false);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TabAlignment.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TabAlignment.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.text.engine
+{
+	/// The TabAlignment class is an enumeration of constant values that you can use to set the tabAlignment property of the TabStop class.
+	public class TabAlignment extends Object
+	{
+		/// Positions the center of the tabbed text at the tab stop.
+		public static const CENTER : String;
+		/// Positions the alignment token of the tabbed text at the tab stop.
+		public static const DECIMAL : String;
+		/// Positions the end of the tabbed text at the tab stop.
+		public static const END : String;
+		/// Positions the start of the tabbed text at the tab stop.
+		public static const START : String;
+
+		public function TabAlignment ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TabStop.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TabStop.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,21 @@
+package flash.text.engine
+{
+	/// The TabStop class represents the properties of a tab stop in a text block.
+	public class TabStop extends Object
+	{
+		/// Specifies the tab alignment for this tab stop.
+		public function get alignment () : String;
+		public function set alignment (value:String) : void;
+
+		/// Specifies the alignment token to use when you set the alignment property to TabAlignment.DECIMAL.
+		public function get decimalAlignmentToken () : String;
+		public function set decimalAlignmentToken (value:String) : void;
+
+		/// The position of the tab stop, in pixels, relative to the start of the text line.
+		public function get position () : Number;
+		public function set position (value:Number) : void;
+
+		/// Creates a new TabStop.
+		public function TabStop (alignment:String = "start", position:Number = 0, decimalAlignmentToken:String = "");
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextBaseline.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextBaseline.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,23 @@
+package flash.text.engine
+{
+	/// The TextBaseline class is an enumeration of constant values to use in setting the dominantBaseline andalignmentBaseline properties of the ElementFormat class.
+	public class TextBaseline extends Object
+	{
+		/// Specifies an ascent baseline.
+		public static const ASCENT : String;
+		/// Specifies a descent baseline.
+		public static const DESCENT : String;
+		/// Specifies an ideographic bottom baseline.
+		public static const IDEOGRAPHIC_BOTTOM : String;
+		/// Specifies an ideographic center baseline.
+		public static const IDEOGRAPHIC_CENTER : String;
+		/// Specifies an ideographic top baseline.
+		public static const IDEOGRAPHIC_TOP : String;
+		/// Specifies a roman baseline.
+		public static const ROMAN : String;
+		/// Specifies that the alignmentBaseline is the same as the dominantBaseline.
+		public static const USE_DOMINANT_BASELINE : String;
+
+		public function TextBaseline ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextBlock.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextBlock.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,90 @@
+package flash.text.engine
+{
+	import flash.text.engine.TextJustifier;
+	import flash.text.engine.TextLine;
+	import flash.text.engine.ContentElement;
+	import flash.text.engine.FontDescription;
+	import flash.text.engine.TabStop;
+
+	/// The TextBlock class is a factory for the creation of TextLine objects, which you can render by placing them on the display list.
+	public class TextBlock extends Object
+	{
+		/// Provides a way for the author to associate arbitrary data with the text block.
+		public var userData : *;
+
+		/// Specifies that you want to enhance screen appearance at the expense of what-you-see-is-what-you-get (WYSIWYG) print fidelity.
+		public function get applyNonLinearFontScaling () : Boolean;
+		public function set applyNonLinearFontScaling (value:Boolean) : void;
+
+		/// The font used to determine the baselines for all the lines created from the block, independent of their content.
+		public function get baselineFontDescription () : FontDescription;
+		public function set baselineFontDescription (value:FontDescription) : void;
+
+		/// The font size used to calculate the baselines for the lines created from the block.
+		public function get baselineFontSize () : Number;
+		public function set baselineFontSize (value:Number) : void;
+
+		/// Specifies which baseline is at y=0 for lines created from this block.
+		public function get baselineZero () : String;
+		public function set baselineZero (value:String) : void;
+
+		/// Specifies the default bidirectional embedding level of the text in the text block.
+		public function get bidiLevel () : int;
+		public function set bidiLevel (value:int) : void;
+
+		/// Holds the contents of the text block.
+		public function get content () : ContentElement;
+		public function set content (value:ContentElement) : void;
+
+		/// Identifies the first line in the text block in which TextLine.validity is not equal to TextLineValidity.VALID.
+		public function get firstInvalidLine () : TextLine;
+
+		/// The first TextLine in the TextBlock, if any.
+		public function get firstLine () : TextLine;
+
+		/// The last TextLine in the TextBlock, if any.
+		public function get lastLine () : TextLine;
+
+		/// Rotates the text lines in the text block as a unit.
+		public function get lineRotation () : String;
+		public function set lineRotation (value:String) : void;
+
+		/// Specifies the tab stops for the text in the text block, in the form of a Vector of TabStop objects.
+		public function get tabStops () : Vector.<TabStop>;
+		public function set tabStops (value:Vector.<TabStop>) : void;
+
+		/// Specifies the TextJustifier to use during line creation.
+		public function get textJustifier () : TextJustifier;
+		public function set textJustifier (value:TextJustifier) : void;
+
+		/// Indicates the result of a createTextLine() operation.
+		public function get textLineCreationResult () : String;
+
+		/// Instructs the text block to create a line of text from its content, beginning at the point specified by the previousLine parameter and breaking at the point specified by the width parameter.
+		public function createTextLine (previousLine:TextLine = null, width:Number = 1000000, lineOffset:Number = 0, fitSomething:Boolean = false) : TextLine;
+
+		/// Dumps the underlying contents of the TextBlock as an XML string.
+		public function dump () : String;
+
+		/// Finds the index of the next Atom boundary from the specified character index, not including the character at the specified index.
+		public function findNextAtomBoundary (afterCharIndex:int) : int;
+
+		/// Finds the index of the next word boundary from the specified character index, not including the character at the specified index.
+		public function findNextWordBoundary (afterCharIndex:int) : int;
+
+		/// Finds the index of the previous atom boundary to the specified character index, not including the character at the specified index.
+		public function findPreviousAtomBoundary (beforeCharIndex:int) : int;
+
+		/// Finds the index of the previous word boundary to the specified character index, not including the character at the specified index.
+		public function findPreviousWordBoundary (beforeCharIndex:int) : int;
+
+		/// Returns the TextLine containing the character specified by the charIndex parameter.
+		public function getTextLineAtCharIndex (charIndex:int) : TextLine;
+
+		/// Removes a range of text lines from the list of lines maintained by the TextBlock.
+		public function releaseLines (firstLine:TextLine, lastLine:TextLine) : void;
+
+		/// Creates a TextBlock object
+		public function TextBlock (content:ContentElement = null, tabStops:Vector.<TabStop> = null, textJustifier:TextJustifier = null, lineRotation:String = "rotate0", baselineZero:String = "roman", bidiLevel:int = 0, applyNonLinearFontScaling:Boolean = true, baselineFontDescription:FontDescription = null, baselineFontSize:Number = 12);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextElement.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextElement.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,18 @@
+package flash.text.engine
+{
+	import flash.text.engine.ElementFormat;
+	import flash.events.EventDispatcher;
+
+	/// The TextElement class represents a string of formatted text.
+	public class TextElement extends ContentElement
+	{
+		/// Receives the text that is the content of the element.
+		public function set text (value:String) : void;
+
+		/// Replaces the range of characters that the beginIndex and endIndex parameters specify with the contents of the newText parameter.
+		public function replaceText (beginIndex:int, endIndex:int, newText:String) : void;
+
+		/// Creates a new TextElement instance.
+		public function TextElement (text:String = null, elementFormat:ElementFormat = null, eventMirror:EventDispatcher = null, textRotation:String = "rotate0");
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextJustifier.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextJustifier.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,24 @@
+package flash.text.engine
+{
+	import flash.text.engine.TextJustifier;
+
+	/// The TextJustifier class is an abstract base class for the justifier types that you can apply to a TextBlock, specifically the EastAsianJustifier and SpaceJustifier classes.
+	public class TextJustifier extends Object
+	{
+		/// Specifies the line justification for the text in a text block.
+		public function get lineJustification () : String;
+		public function set lineJustification (value:String) : void;
+
+		/// Specifies the locale to determine the justification rules for the text in a text block.
+		public function get locale () : String;
+
+		/// Constructs a cloned copy of the TextJustifier.
+		public function clone () : TextJustifier;
+
+		/// Constructs a default TextJustifier subclass appropriate to the specified locale.
+		public static function getJustifierForLocale (locale:String) : TextJustifier;
+
+		/// Calling the new TextJustifier() constructor throws an ArgumentError exception.
+		public function TextJustifier (locale:String, lineJustification:String);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextLine.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextLine.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,120 @@
+package flash.text.engine
+{
+	import flash.display.DisplayObjectContainer;
+	import flash.text.engine.TextLineMirrorRegion;
+	import flash.display.DisplayObject;
+	import flash.text.engine.TextLine;
+	import flash.events.EventDispatcher;
+	import flash.ui.ContextMenu;
+	import flash.text.engine.TextBlock;
+	import flash.geom.Rectangle;
+
+	/// The TextLine class is used to display text on the display list.
+	public class TextLine extends DisplayObjectContainer
+	{
+		/// The maximum requested width of a text line, in pixels.
+		public static const MAX_LINE_WIDTH : int;
+		/// Provides a way for the author to associate arbitrary data with the text line.
+		public var userData : *;
+
+		/// Specifies the number of pixels from the baseline to the top of the tallest characters in the line.
+		public function get ascent () : Number;
+
+		/// The number of atoms in the line, which is the number of indivisible elements, including spaces and graphic elements.
+		public function get atomCount () : int;
+
+		public function set contextMenu (cm:ContextMenu) : void;
+
+		/// Specifies the number of pixels from the baseline to the bottom of the lowest-descending characters in the line.
+		public function get descent () : Number;
+
+		public function set focusRect (focusRect:Object) : void;
+
+		/// Indicates whether the text line contains any graphic elements.
+		public function get hasGraphicElement () : Boolean;
+
+		/// A Vector containing the TextLineMirrorRegion objects associated with the line, or null if none exist.
+		public function get mirrorRegions () : Vector.<TextLineMirrorRegion>;
+
+		/// The next TextLine in the TextBlock, or null if the current line is the last line in the block or the validity of the line is TextLineValidity.STATIC.
+		public function get nextLine () : TextLine;
+
+		/// The previous TextLine in the TextBlock, or null if the line is the first line in the block or the validity of the line is TextLineValidity.STATIC.
+		public function get previousLine () : TextLine;
+
+		/// The length of the raw text in the text block that became the line, including the U+FDEF characters representing graphic elements and any trailing spaces, which are part of the line but not are displayed.
+		public function get rawTextLength () : int;
+
+		/// The width that was specified to the TextBlock.createTextLine() method when it created the line.
+		public function get specifiedWidth () : Number;
+
+		public function set tabChildren (enable:Boolean) : void;
+
+		public function set tabEnabled (enabled:Boolean) : void;
+
+		public function set tabIndex (index:int) : void;
+
+		/// The TextBlock containing this text line, or null if the validity of the line is TextLineValidity.STATIC.
+		public function get textBlock () : TextBlock;
+
+		/// The index of the first character of the line in the raw text of the text block.
+		public function get textBlockBeginIndex () : int;
+
+		/// The logical height of the text line, which is equal to ascent + descent.
+		public function get textHeight () : Number;
+
+		/// The logical width of the text line, which is the width that the text engine uses to lay out the line.
+		public function get textWidth () : Number;
+
+		/// The width of the line if it was not justified.
+		public function get unjustifiedTextWidth () : Number;
+
+		/// Specifies the current validity of the text line.
+		public function get validity () : String;
+		public function set validity (value:String) : void;
+
+		/// Dumps the underlying contents of the TextLine as an XML string.
+		public function dump () : String;
+
+		/// Releases the atom data of the line for garbage collection.
+		public function flushAtomData () : void;
+
+		/// Gets the bidirectional level of the atom at the specified index.
+		public function getAtomBidiLevel (atomIndex:int) : int;
+
+		/// Gets the bounds of the atom at the specified index relative to the text line.
+		public function getAtomBounds (atomIndex:int) : Rectangle;
+
+		/// Gets the center of the atom as measured along the baseline at the specified index.
+		public function getAtomCenter (atomIndex:int) : Number;
+
+		/// Gets the graphic of the atom at the specified index, or null if the atom is a character.
+		public function getAtomGraphic (atomIndex:int) : DisplayObject;
+
+		/// Returns the index of the atom containing the character specified by the charIndex parameter, or -1 if the character does not contribute to any atom in the line.
+		public function getAtomIndexAtCharIndex (charIndex:int) : int;
+
+		/// Returns the index of the atom at the point specified by the x and y parameters, or -1 if no atom exists at that point.
+		public function getAtomIndexAtPoint (stageX:Number, stageY:Number) : int;
+
+		/// Gets the text block begin index of the atom at the specified index.
+		public function getAtomTextBlockBeginIndex (atomIndex:int) : int;
+
+		/// Gets the text block end index of the atom at the specified index.
+		public function getAtomTextBlockEndIndex (atomIndex:int) : int;
+
+		/// Gets the rotation of the atom at the specified index.
+		public function getAtomTextRotation (atomIndex:int) : String;
+
+		/// Indicates whether a word boundary occurs to the left of the atom at the specified index.
+		public function getAtomWordBoundaryOnLeft (atomIndex:int) : Boolean;
+
+		/// Gets the position of the specified baseline, relative to TextBlock.baselineZero.
+		public function getBaselinePosition (baseline:String) : Number;
+
+		/// Returns the first TextLineMirrorRegion on the line whose mirror property matches that specified by the mirror parameter, or null if no match exists.
+		public function getMirrorRegion (mirror:EventDispatcher) : TextLineMirrorRegion;
+
+		public function TextLine ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextLineCreationResult.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextLineCreationResult.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.text.engine
+{
+	/// The TextLineCreationResult class is an enumeration of constant values used with TextBlock.textLineCreationResult.
+	public class TextLineCreationResult extends Object
+	{
+		/// Indicates no line was created because all text in the block had already been broken.
+		public static const COMPLETE : String;
+		/// Indicates the line was created with an emergency break because no break opportunity was available in the specified width.
+		public static const EMERGENCY : String;
+		/// Indicates no line was created because no text could fit in the specified width and fitSomething was not specified in the call to createTextLine().
+		public static const INSUFFICIENT_WIDTH : String;
+		/// Indicates the line was successfully broken.
+		public static const SUCCESS : String;
+
+		public function TextLineCreationResult ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextLineMirrorRegion.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextLineMirrorRegion.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,32 @@
+package flash.text.engine
+{
+	import flash.text.engine.TextLine;
+	import flash.geom.Rectangle;
+	import flash.text.engine.TextLineMirrorRegion;
+	import flash.text.engine.ContentElement;
+	import flash.events.EventDispatcher;
+
+	/// The TextLineMirrorRegion class represents a portion of a text line wherein events are mirrored to another event dispatcher.
+	public class TextLineMirrorRegion extends Object
+	{
+		/// The bounds of the mirror region, relative to the text line.
+		public function get bounds () : Rectangle;
+
+		/// The ContentElement object from which the mirror region was derived.
+		public function get element () : ContentElement;
+
+		/// The EventDispatcher object to which events affecting the mirror region are mirrored.
+		public function get mirror () : EventDispatcher;
+
+		/// The next TextLineMirrorRegion in the set derived from the text element, or null if the current region is the last mirror region in the set.
+		public function get nextRegion () : TextLineMirrorRegion;
+
+		/// The previous TextLineMirrorRegion in the set derived from the text element, or null if the current region is the first mirror region in the set.
+		public function get previousRegion () : TextLineMirrorRegion;
+
+		/// The TextLine containing this mirror region.
+		public function get textLine () : TextLine;
+
+		public function TextLineMirrorRegion ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextLineValidity.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextLineValidity.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.text.engine
+{
+	/// The TextLineValidity class is an enumeration of constant values for setting the validity property of the TextLine class.
+	public class TextLineValidity extends Object
+	{
+		/// Specifies that the line is invalid.
+		public static const INVALID : String;
+		/// Specifies that the text line is possibly invalid.
+		public static const POSSIBLY_INVALID : String;
+		/// Specifies that the line is static, and that the connection between the line and the text block has been severed, and the atom data that is unnecessary for rendering has been discarded.
+		public static const STATIC : String;
+		/// Specifies that the text line is valid.
+		public static const VALID : String;
+
+		public function TextLineValidity ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextRotation.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TextRotation.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,19 @@
+package flash.text.engine
+{
+	/// The TextRotation class is an enumeration of constant values used with the following properties:ElementFormat.textRotation, ContentElement.textRotation,TextBlock.lineRotation, and TextLine.getAtomTextRotation().
+	public class TextRotation extends Object
+	{
+		/// Specifies a 90 degree counter clockwise rotation for full width and wide glyphs only, as determined by the Unicode properties of the glyph.
+		public static const AUTO : String;
+		/// Specifies no rotation.
+		public static const ROTATE_0 : String;
+		/// Specifies a 180 degree rotation.
+		public static const ROTATE_180 : String;
+		/// Specifies a 270 degree clockwise rotation.
+		public static const ROTATE_270 : String;
+		/// Specifies a 90 degree clockwise rotation.
+		public static const ROTATE_90 : String;
+
+		public function TextRotation ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TypographicCase.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/text/engine/TypographicCase.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,23 @@
+package flash.text.engine
+{
+	/// The TypographicCase class is an enumeration of constant values for setting the typographicCase property of the ElementFormat class.
+	public class TypographicCase extends Object
+	{
+		/// Specifies that spacing is adjusted for uppercase characters on output.
+		public static const CAPS : String;
+		/// Specifies that all lowercase characters use small-caps glyphs on output.
+		public static const CAPS_AND_SMALL_CAPS : String;
+		/// Specifies default typographic case.
+		public static const DEFAULT : String;
+		/// Specifies that all characters use lowercase glyphs on output.
+		public static const LOWERCASE : String;
+		/// Specifies that uppercase characters use small-caps glyphs on output.
+		public static const SMALL_CAPS : String;
+		/// Specifies that uppercase characters use title glyphs on output.
+		public static const TITLE : String;
+		/// Specifies that all characters use uppercase glyphs on output.
+		public static const UPPERCASE : String;
+
+		public function TypographicCase ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/trace/Trace.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/trace/Trace.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,23 @@
+package flash.trace
+{
+	public class Trace extends Object
+	{
+		public static const FILE : *;
+		public static const LISTENER : *;
+		public static const METHODS : int;
+		public static const METHODS_AND_LINES : int;
+		public static const METHODS_AND_LINES_WITH_ARGS : int;
+		public static const METHODS_WITH_ARGS : int;
+		public static const OFF : int;
+
+		public static function getLevel (target:int = 2) : int;
+
+		public static function getListener () : Function;
+
+		public static function setLevel (l:int, target:int = 2) : *;
+
+		public static function setListener (f:Function) : *;
+
+		public function Trace ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/ContextMenu.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/ContextMenu.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,47 @@
+package flash.ui
+{
+	import flash.events.EventDispatcher;
+	import flash.ui.ContextMenuBuiltInItems;
+	import flash.ui.ContextMenu;
+	import flash.ui.ContextMenuClipboardItems;
+	import flash.net.URLRequest;
+
+	/**
+	 * Dispatched when a user first generates a context menu but before the contents of the context menu are displayed.
+	 * @eventType flash.events.ContextMenuEvent.MENU_SELECT
+	 */
+	[Event(name="menuSelect", type="flash.events.ContextMenuEvent")] 
+
+	/// The ContextMenu class provides control over the items in the Flash Player context menu.
+	public class ContextMenu extends EventDispatcher
+	{
+		/// An object that has the following properties of the ContextMenuBuiltInItems class: forwardAndBack, loop, play, print, quality, rewind, save, and zoom.
+		public function get builtInItems () : ContextMenuBuiltInItems;
+		public function set builtInItems (value:ContextMenuBuiltInItems) : void;
+
+		/// An object that has the following properties of the ContextMenuClipboardItems class: cut, copy, paste, delete, selectAll.
+		public function get clipboardItems () : ContextMenuClipboardItems;
+		public function set clipboardItems (value:ContextMenuClipboardItems) : void;
+
+		/// Specifies whether or not the clipboard menu should be used.
+		public function get clipboardMenu () : Boolean;
+		public function set clipboardMenu (value:Boolean) : void;
+
+		/// An array of ContextMenuItem objects.
+		public function get customItems () : Array;
+		public function set customItems (value:Array) : void;
+
+		/// The URLRequest of the link.
+		public function get link () : URLRequest;
+		public function set link (value:URLRequest) : void;
+
+		/// Creates a copy of the specified ContextMenu object.
+		public function clone () : ContextMenu;
+
+		/// Creates a ContextMenu object.
+		public function ContextMenu ();
+
+		/// Hides all built-in menu items (except Settings) in the specified ContextMenu object.
+		public function hideBuiltInItems () : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/ContextMenuBuiltInItems.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/ContextMenuBuiltInItems.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,30 @@
+package flash.ui
+{
+	import flash.ui.ContextMenuBuiltInItems;
+
+	/// The ContextMenuBuiltInItems class describes the items that are built in to a context menu.
+	public class ContextMenuBuiltInItems extends Object
+	{
+		/// Lets the user move forward or backward one frame in a SWF file at run time (does not appear for a single-frame SWF file).
+		public var forwardAndBack : Boolean;
+		/// Lets the user set a SWF file to start over automatically when it reaches the final frame (does not appear for a single-frame SWF file).
+		public var loop : Boolean;
+		/// Lets the user start a paused SWF file (does not appear for a single-frame SWF file).
+		public var play : Boolean;
+		/// Lets the user send the displayed frame image to a printer.
+		public var print : Boolean;
+		/// Lets the user set the resolution of the SWF file at run time.
+		public var quality : Boolean;
+		/// Lets the user set a SWF file to play from the first frame when selected, at any time (does not appear for a single-frame SWF file).
+		public var rewind : Boolean;
+		/// Lets the user with Shockmachine installed save a SWF file.
+		public var save : Boolean;
+		/// Lets the user zoom in and out on a SWF file at run time.
+		public var zoom : Boolean;
+
+		public function clone () : ContextMenuBuiltInItems;
+
+		/// Creates a new ContextMenuBuiltInItems object so that you can set the properties for Flash Player to display or hide each menu item.
+		public function ContextMenuBuiltInItems ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/ContextMenuClipboardItems.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/ContextMenuClipboardItems.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,24 @@
+package flash.ui
+{
+	import flash.ui.ContextMenuClipboardItems;
+
+	/// The ContextMenuClipboardItems class determines which items are enabled or disabled on the clipboard context menu.
+	public class ContextMenuClipboardItems extends Object
+	{
+		/// Enables or disables the 'Delete' (Windows) / 'Clear' (Mac) item on the clipboard menu.
+		public var clear : Boolean;
+		/// Enables or disables the 'Copy' item on the clipboard menu.
+		public var copy : Boolean;
+		/// Enables or disables the 'Cut' item on the clipboard menu.
+		public var cut : Boolean;
+		/// Enables or disables the 'Paste' item on the clipboard menu.
+		public var paste : Boolean;
+		/// Enables or disables the 'Select All' item on the clipboard menu.
+		public var selectAll : Boolean;
+
+		public function clone () : ContextMenuClipboardItems;
+
+		/// Creates a new ContextMenuClipboardItems object so that you can set the properties for Flash Player to enable or disable each menu item.
+		public function ContextMenuClipboardItems ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/ContextMenuItem.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/ContextMenuItem.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,37 @@
+package flash.ui
+{
+	import flash.events.EventDispatcher;
+	import flash.ui.ContextMenuItem;
+
+	/**
+	 * Dispatched when a user selects an item from a context menu.
+	 * @eventType flash.events.ContextMenuEvent.MENU_ITEM_SELECT
+	 */
+	[Event(name="menuItemSelect", type="flash.events.ContextMenuEvent")] 
+
+	/// Use the ContextMenuItem class to create custom menu items to display in the Flash Player context menu.
+	public class ContextMenuItem extends EventDispatcher
+	{
+		/// Specifies the menu item caption (text) displayed in the context menu.
+		public function get caption () : String;
+		public function set caption (value:String) : void;
+
+		/// Indicates whether the specified menu item is enabled or disabled.
+		public function get enabled () : Boolean;
+		public function set enabled (value:Boolean) : void;
+
+		/// Indicates whether a separator bar should appear above the specified menu item.
+		public function get separatorBefore () : Boolean;
+		public function set separatorBefore (value:Boolean) : void;
+
+		/// Indicates whether the specified menu item is visible when the Flash Player context menu is displayed.
+		public function get visible () : Boolean;
+		public function set visible (value:Boolean) : void;
+
+		/// Creates and returns a copy of the specified ContextMenuItem object.
+		public function clone () : ContextMenuItem;
+
+		/// Creates a new ContextMenuItem object that can be added to the ContextMenu.customItems array.
+		public function ContextMenuItem (caption:String, separatorBefore:Boolean = false, enabled:Boolean = true, visible:Boolean = true);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/KeyLocation.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/KeyLocation.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+package flash.ui
+{
+	/// The KeyLocation class contains constants that indicate the location of a key pressed on the keyboard.
+	public class KeyLocation extends Object
+	{
+		/// Indicates the key activated is in the left key location (there is more than one possible location for this key).
+		public static const LEFT : uint;
+		/// Indicates the key activation originated on the numeric keypad or with a virtual key corresponding to the numeric keypad.
+		public static const NUM_PAD : uint;
+		/// Indicates the key activated is in the right key location (there is more than one possible location for this key).
+		public static const RIGHT : uint;
+		/// Indicates the key activation is not distinguished as the left or right version of the key, and did not originate on the numeric keypad (or did not originate with a virtual key corresponding to the numeric keypad).
+		public static const STANDARD : uint;
+
+		public function KeyLocation ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/Keyboard.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/Keyboard.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,116 @@
+package flash.ui
+{
+	/// The Keyboard class is used to build an interface that can be controlled by a user with a standard keyboard.
+	public class Keyboard extends Object
+	{
+		/// Constant associated with the key code value for the Backspace key (8).
+		public static const BACKSPACE : uint;
+		/// Constant associated with the key code value for the Caps Lock key (20).
+		public static const CAPS_LOCK : uint;
+		/// Constant associated with the key code value for the Control key (17).
+		public static const CONTROL : uint;
+		/// Constant associated with the key code value for the Delete key (46).
+		public static const DELETE : uint;
+		/// Constant associated with the key code value for the Down Arrow key (40).
+		public static const DOWN : uint;
+		/// Constant associated with the key code value for the End key (35).
+		public static const END : uint;
+		/// Constant associated with the key code value for the Enter key (13).
+		public static const ENTER : uint;
+		/// Constant associated with the key code value for the Escape key (27).
+		public static const ESCAPE : uint;
+		/// Constant associated with the key code value for the F1 key (112).
+		public static const F1 : uint;
+		/// Constant associated with the key code value for the F10 key (121).
+		public static const F10 : uint;
+		/// Constant associated with the key code value for the F11 key (122).
+		public static const F11 : uint;
+		/// Constant associated with the key code value for the F12 key (123).
+		public static const F12 : uint;
+		/// Constant associated with the key code value for the F13 key (124).
+		public static const F13 : uint;
+		/// Constant associated with the key code value for the F14 key (125).
+		public static const F14 : uint;
+		/// Constant associated with the key code value for the F15 key (126).
+		public static const F15 : uint;
+		/// Constant associated with the key code value for the F2 key (113).
+		public static const F2 : uint;
+		/// Constant associated with the key code value for the F3 key (114).
+		public static const F3 : uint;
+		/// Constant associated with the key code value for the F4 key (115).
+		public static const F4 : uint;
+		/// Constant associated with the key code value for the F5 key (116).
+		public static const F5 : uint;
+		/// Constant associated with the key code value for the F6 key (117).
+		public static const F6 : uint;
+		/// Constant associated with the key code value for the F7 key (118).
+		public static const F7 : uint;
+		/// Constant associated with the key code value for the F8 key (119).
+		public static const F8 : uint;
+		/// Constant associated with the key code value for the F9 key (120).
+		public static const F9 : uint;
+		/// Constant associated with the key code value for the Home key (36).
+		public static const HOME : uint;
+		/// Constant associated with the key code value for the Insert key (45).
+		public static const INSERT : uint;
+		/// Constant associated with the key code value for the Left Arrow key (37).
+		public static const LEFT : uint;
+		/// Constant associated with the key code value for the number 0 key on the number pad (96).
+		public static const NUMPAD_0 : uint;
+		/// Constant associated with the key code value for the number 1 key on the number pad (97).
+		public static const NUMPAD_1 : uint;
+		/// Constant associated with the key code value for the number 2 key on the number pad (98).
+		public static const NUMPAD_2 : uint;
+		/// Constant associated with the key code value for the number 3 key on the number pad (99).
+		public static const NUMPAD_3 : uint;
+		/// Constant associated with the key code value for the number 4 key on the number pad (100).
+		public static const NUMPAD_4 : uint;
+		/// Constant associated with the key code value for the number 5 key on the number pad (101).
+		public static const NUMPAD_5 : uint;
+		/// Constant associated with the key code value for the number 6 key on the number pad (102).
+		public static const NUMPAD_6 : uint;
+		/// Constant associated with the key code value for the number 7 key on the number pad (103).
+		public static const NUMPAD_7 : uint;
+		/// Constant associated with the key code value for the number 8 key on the number pad (104).
+		public static const NUMPAD_8 : uint;
+		/// Constant associated with the key code value for the number 9 key on the number pad (105).
+		public static const NUMPAD_9 : uint;
+		/// Constant associated with the key code value for the addition key on the number pad (107).
+		public static const NUMPAD_ADD : uint;
+		/// Constant associated with the key code value for the decimal key on the number pad (110).
+		public static const NUMPAD_DECIMAL : uint;
+		/// Constant associated with the key code value for the division key on the number pad (111).
+		public static const NUMPAD_DIVIDE : uint;
+		/// Constant associated with the key code value for the Enter key on the number pad (108).
+		public static const NUMPAD_ENTER : uint;
+		/// Constant associated with the key code value for the multiplication key on the number pad (106).
+		public static const NUMPAD_MULTIPLY : uint;
+		/// Constant associated with the key code value for the subtraction key on the number pad (109).
+		public static const NUMPAD_SUBTRACT : uint;
+		/// Constant associated with the key code value for the Page Down key (34).
+		public static const PAGE_DOWN : uint;
+		/// Constant associated with the key code value for the Page Up key (33).
+		public static const PAGE_UP : uint;
+		/// Constant associated with the key code value for the Right Arrow key (39).
+		public static const RIGHT : uint;
+		/// Constant associated with the key code value for the Shift key (16).
+		public static const SHIFT : uint;
+		/// Constant associated with the key code value for the Spacebar (32).
+		public static const SPACE : uint;
+		/// Constant associated with the key code value for the Tab key (9).
+		public static const TAB : uint;
+		/// Constant associated with the key code value for the Up Arrow key (38).
+		public static const UP : uint;
+
+		/// Specifies whether the Caps Lock key is activated (true) or not (false).
+		public static function get capsLock () : Boolean;
+
+		/// Specifies whether the Num Lock key is activated (true) or not (false).
+		public static function get numLock () : Boolean;
+
+		/// Specifies whether the last key pressed is accessible by other SWF files.
+		public static function isAccessible () : Boolean;
+
+		public function Keyboard ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/Mouse.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/Mouse.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,18 @@
+package flash.ui
+{
+	/// The methods of the Mouse class are used to hide and show the mouse pointer, or to set the pointer to a specific style.
+	public class Mouse extends Object
+	{
+		/// Sets the mouse cursor.
+		public static function get cursor () : String;
+		public static function set cursor (value:String) : void;
+
+		/// Hides the pointer.
+		public static function hide () : void;
+
+		public function Mouse ();
+
+		/// Displays the pointer.
+		public static function show () : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/MouseCursor.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/ui/MouseCursor.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,19 @@
+package flash.ui
+{
+	/// The MouseCursor class is an enumeration of constant values used in setting the cursor property of the Mouse class.
+	public class MouseCursor extends Object
+	{
+		/// Used to specify that the arrow cursor should be used.
+		public static const ARROW : String;
+		/// Used to specify that the cursor should be selected automatically based on the object under the mouse.
+		public static const AUTO : String;
+		/// Used to specify that the button pressing hand cursor should be used.
+		public static const BUTTON : String;
+		/// Used to specify that the dragging hand cursor should be used.
+		public static const HAND : String;
+		/// Used to specify that the I-beam cursor should be used.
+		public static const IBEAM : String;
+
+		public function MouseCursor ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/ByteArray.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/ByteArray.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,130 @@
+package flash.utils
+{
+	import flash.utils.ByteArray;
+
+	/// The ByteArray class provides methods and properties to optimize reading, writing, and working with binary data.
+	public class ByteArray extends Object implements IDataInput, IDataOutput
+	{
+		/// The number of bytes of data available for reading from the current position in the byte array to the end of the array.
+		public function get bytesAvailable () : uint;
+
+		/// Denotes the default object encoding for the ByteArray class to use for a new ByteArray instance.
+		public static function get defaultObjectEncoding () : uint;
+		public static function set defaultObjectEncoding (version:uint) : void;
+
+		/// Changes or reads the byte order for the data; either Endian.BIG_ENDIAN or Endian.LITTLE_ENDIAN.
+		public function get endian () : String;
+		public function set endian (type:String) : void;
+
+		/// The length of the ByteArray object, in bytes.
+		public function get length () : uint;
+		public function set length (value:uint) : void;
+
+		/// Used to determine whether the ActionScript 3.0, ActionScript 2.0, or ActionScript 1.0 format should be used when writing to, or reading from, a ByteArray instance.
+		public function get objectEncoding () : uint;
+		public function set objectEncoding (version:uint) : void;
+
+		/// Moves, or returns the current position, in bytes, of the file pointer into the ByteArray object.
+		public function get position () : uint;
+		public function set position (offset:uint) : void;
+
+		/// Creates a ByteArray instance representing a packed array of bytes, so that you can use the methods and properties in this class to optimize your data storage and stream.
+		public function ByteArray ();
+
+		/// Clears the contents of the byte array and resets the length and position properties to 0.
+		public function clear () : void;
+
+		/// Compresses the byte array.
+		public function compress () : void;
+
+		/// Compresses the byte array using the DEFLATE compression algorithm.
+		public function deflate () : void;
+
+		/// Decompresses the byte array.
+		public function inflate () : void;
+
+		/// Reads a Boolean value from the byte stream.
+		public function readBoolean () : Boolean;
+
+		/// Reads a signed byte from the byte stream.
+		public function readByte () : int;
+
+		/// Reads the number of data bytes, specified by the length parameter, from the byte stream.
+		public function readBytes (bytes:ByteArray, offset:uint = 0, length:uint = 0) : void;
+
+		/// Reads an IEEE 754 double-precision (64-bit) floating-point number from the byte stream.
+		public function readDouble () : Number;
+
+		/// Reads an IEEE 754 single-precision (32-bit) floating-point number from the byte stream.
+		public function readFloat () : Number;
+
+		/// Reads a signed 32-bit integer from the byte stream.
+		public function readInt () : int;
+
+		/// Reads a multibyte string of specified length from the byte stream using the specified character set.
+		public function readMultiByte (length:uint, charSet:String) : String;
+
+		/// Reads an object from the byte array, encoded in AMF serialized format.
+		public function readObject () : *;
+
+		/// Reads a signed 16-bit integer from the byte stream.
+		public function readShort () : int;
+
+		/// Reads an unsigned byte from the byte stream.
+		public function readUnsignedByte () : uint;
+
+		/// Reads an unsigned 32-bit integer from the byte stream.
+		public function readUnsignedInt () : uint;
+
+		/// Reads an unsigned 16-bit integer from the byte stream.
+		public function readUnsignedShort () : uint;
+
+		/// Reads a UTF-8 string from the byte stream.
+		public function readUTF () : String;
+
+		/// Reads a sequence of UTF-8 bytes specified by the length parameter from the byte stream and returns a string.
+		public function readUTFBytes (length:uint) : String;
+
+		/// Converts the byte array to a string.
+		public function toString () : String;
+
+		/// Decompresses the byte array.
+		public function uncompress () : void;
+
+		/// Writes a Boolean value.
+		public function writeBoolean (value:Boolean) : void;
+
+		/// Writes a byte to the byte stream.
+		public function writeByte (value:int) : void;
+
+		/// Writes a sequence of length bytes from the specified byte array, bytes, starting offset (zero-based index) bytes into the byte stream.
+		public function writeBytes (bytes:ByteArray, offset:uint = 0, length:uint = 0) : void;
+
+		/// Writes an IEEE 754 double-precision (64-bit) floating-point number to the byte stream.
+		public function writeDouble (value:Number) : void;
+
+		/// Writes an IEEE 754 single-precision (32-bit) floating-point number to the byte stream.
+		public function writeFloat (value:Number) : void;
+
+		/// Writes a 32-bit signed integer to the byte stream.
+		public function writeInt (value:int) : void;
+
+		/// Writes a multibyte string to the byte stream using the specified character set.
+		public function writeMultiByte (value:String, charSet:String) : void;
+
+		/// Writes an object into the byte array in AMF serialized format.
+		public function writeObject (object:*) : void;
+
+		/// Writes a 16-bit integer to the byte stream.
+		public function writeShort (value:int) : void;
+
+		/// Writes a 32-bit unsigned integer to the byte stream.
+		public function writeUnsignedInt (value:uint) : void;
+
+		/// Writes a UTF-8 string to the byte stream.
+		public function writeUTF (value:String) : void;
+
+		/// Writes a UTF-8 string to the byte stream.
+		public function writeUTFBytes (value:String) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/Dictionary.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/Dictionary.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,9 @@
+package flash.utils
+{
+	/// The Dictionary class lets you create a dynamic collection of properties, which uses strict equality (===) for key comparison.
+	public class Dictionary extends Object
+	{
+		/// Creates a new Dictionary object.
+		public function Dictionary (weakKeys:Boolean = false);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/Endian.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/Endian.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.utils
+{
+	/// The Endian class contains values that denote the byte order used to represent multibyte numbers.
+	public class Endian extends Object
+	{
+		/// Indicates the most significant byte of the multibyte number appears first in the sequence of bytes.
+		public static const BIG_ENDIAN : String;
+		/// Indicates the least significant byte of the multibyte number appears first in the sequence of bytes.
+		public static const LITTLE_ENDIAN : String;
+
+		public function Endian ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/IDataInput.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/IDataInput.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,61 @@
+package flash.utils
+{
+	import flash.utils.ByteArray;
+
+	/// The IDataInput interface provides a set of methods for reading binary data.
+	public interface IDataInput
+	{
+		/// Returns the number of bytes of data available for reading in the input buffer.
+		public function get bytesAvailable () : uint;
+
+		/// The byte order for the data, either the "bigEndian" or "littleEndian" constant from the Endian class.
+		public function get endian () : String;
+		public function set endian (type:String) : void;
+
+		/// Used to determine whether the ActionScript 3.0, ActionScript 2.0, or ActionScript 1.0 format should be used when writing to, or reading binary data.
+		public function get objectEncoding () : uint;
+		public function set objectEncoding (version:uint) : void;
+
+		/// Reads a Boolean value from the byte stream or byte array.
+		public function readBoolean () : Boolean;
+
+		/// Reads a signed byte from the byte stream or byte array.
+		public function readByte () : int;
+
+		/// Reads the number of data bytes, specified by the length parameter, from the byte stream or byte array.
+		public function readBytes (bytes:ByteArray, offset:uint = 0, length:uint = 0) : void;
+
+		/// Reads an IEEE 754 double-precision floating point number from the byte stream or byte array.
+		public function readDouble () : Number;
+
+		/// Reads an IEEE 754 single-precision floating point number from the byte stream or byte array.
+		public function readFloat () : Number;
+
+		/// Reads a signed 32-bit integer from the byte stream or byte array.
+		public function readInt () : int;
+
+		/// Reads a multibyte string of specified length from the byte stream using the specified character set.
+		public function readMultiByte (length:uint, charSet:String) : String;
+
+		/// Reads an object from the byte stream or byte array, encoded in AMF serialized format.
+		public function readObject () : *;
+
+		/// Reads a signed 16-bit integer from the byte stream or byte array.
+		public function readShort () : int;
+
+		/// Reads an unsigned byte from the byte stream or byte array.
+		public function readUnsignedByte () : uint;
+
+		/// Reads an unsigned 32-bit integer from the byte stream or byte array.
+		public function readUnsignedInt () : uint;
+
+		/// Reads an unsigned 16-bit integer from the byte stream or byte array.
+		public function readUnsignedShort () : uint;
+
+		/// Reads a UTF-8 string from the byte stream or byte array.
+		public function readUTF () : String;
+
+		/// Reads a sequence of length UTF-8 bytes from the byte stream or byte array and returns a string.
+		public function readUTFBytes (length:uint) : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/IDataOutput.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/IDataOutput.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,52 @@
+package flash.utils
+{
+	import flash.utils.ByteArray;
+
+	/// The IDataOutput interface provides a set of methods for writing binary data.
+	public interface IDataOutput
+	{
+		/// The byte order for the data, either the "bigEndian" or "littleEndian" constant from the Endian class.
+		public function get endian () : String;
+		public function set endian (type:String) : void;
+
+		/// Used to determine whether the ActionScript 3.0, ActionScript 2.0, or ActionScript 1.0 format should be used when writing to, or reading binary data.
+		public function get objectEncoding () : uint;
+		public function set objectEncoding (version:uint) : void;
+
+		/// Writes a Boolean value.
+		public function writeBoolean (value:Boolean) : void;
+
+		/// Writes a byte.
+		public function writeByte (value:int) : void;
+
+		/// Writes a sequence of length bytes from the specified byte array, bytes, starting offset(zero-based index) bytes into the byte stream.
+		public function writeBytes (bytes:ByteArray, offset:uint = 0, length:uint = 0) : void;
+
+		/// Writes an IEEE 754 double-precision (64-bit) floating point number.
+		public function writeDouble (value:Number) : void;
+
+		/// Writes an IEEE 754 single-precision (32-bit) floating point number.
+		public function writeFloat (value:Number) : void;
+
+		/// Writes a 32-bit signed integer.
+		public function writeInt (value:int) : void;
+
+		/// Writes a multibyte string to the byte stream using the specified character set.
+		public function writeMultiByte (value:String, charSet:String) : void;
+
+		/// Writes an object to the byte stream or byte array in AMF serialized format.
+		public function writeObject (object:*) : void;
+
+		/// Writes a 16-bit integer.
+		public function writeShort (value:int) : void;
+
+		/// Writes a 32-bit unsigned integer.
+		public function writeUnsignedInt (value:uint) : void;
+
+		/// Writes a UTF-8 string to the byte stream.
+		public function writeUTF (value:String) : void;
+
+		/// Writes a UTF-8 string.
+		public function writeUTFBytes (value:String) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/IExternalizable.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/IExternalizable.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,15 @@
+package flash.utils
+{
+	import flash.utils.IDataInput;
+	import flash.utils.IDataOutput;
+
+	/// The IExternalizable interface provides control over serialization of a class as it is encoded into a data stream.
+	public interface IExternalizable
+	{
+		/// A class implements this method to decode itself from a data stream by calling the methods of the IDataInput interface.
+		public function readExternal (input:IDataInput) : void;
+
+		/// A class implements this method to encode itself for a data stream by calling the methods of the IDataOutput interface.
+		public function writeExternal (output:IDataOutput) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/ObjectInput.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/ObjectInput.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,45 @@
+package flash.utils
+{
+	import flash.utils.ByteArray;
+
+	public class ObjectInput extends Object implements IDataInput
+	{
+		public function get bytesAvailable () : uint;
+
+		public function get endian () : String;
+		public function set endian (type:String) : void;
+
+		public function get objectEncoding () : uint;
+		public function set objectEncoding (version:uint) : void;
+
+		public function ObjectInput ();
+
+		public function readBoolean () : Boolean;
+
+		public function readByte () : int;
+
+		public function readBytes (bytes:ByteArray, offset:uint = 0, length:uint = 0) : void;
+
+		public function readDouble () : Number;
+
+		public function readFloat () : Number;
+
+		public function readInt () : int;
+
+		public function readMultiByte (length:uint, charSet:String) : String;
+
+		public function readObject () : *;
+
+		public function readShort () : int;
+
+		public function readUnsignedByte () : uint;
+
+		public function readUnsignedInt () : uint;
+
+		public function readUnsignedShort () : uint;
+
+		public function readUTF () : String;
+
+		public function readUTFBytes (length:uint) : String;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/ObjectOutput.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/ObjectOutput.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,39 @@
+package flash.utils
+{
+	import flash.utils.ByteArray;
+
+	public class ObjectOutput extends Object implements IDataOutput
+	{
+		public function get endian () : String;
+		public function set endian (type:String) : void;
+
+		public function get objectEncoding () : uint;
+		public function set objectEncoding (version:uint) : void;
+
+		public function ObjectOutput ();
+
+		public function writeBoolean (value:Boolean) : void;
+
+		public function writeByte (value:int) : void;
+
+		public function writeBytes (bytes:ByteArray, offset:uint = 0, length:uint = 0) : void;
+
+		public function writeDouble (value:Number) : void;
+
+		public function writeFloat (value:Number) : void;
+
+		public function writeInt (value:int) : void;
+
+		public function writeMultiByte (value:String, charSet:String) : void;
+
+		public function writeObject (object:*) : void;
+
+		public function writeShort (value:int) : void;
+
+		public function writeUnsignedInt (value:uint) : void;
+
+		public function writeUTF (value:String) : void;
+
+		public function writeUTFBytes (value:String) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/Proxy.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/Proxy.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,38 @@
+package flash.utils
+{
+	/// The Proxy class lets you override the default behavior of ActionScript operations (such as retrieving and modifying properties) on an object.
+	public class Proxy extends Object
+	{
+		/// Overrides the behavior of an object property that can be called as a function.
+		flash_proxy function callProperty (name:*, ...rest) : *;
+
+		/// Overrides the request to delete a property.
+		flash_proxy function deleteProperty (name:*) : Boolean;
+
+		/// Overrides the use of the descendant operator.
+		flash_proxy function getDescendants (name:*) : *;
+
+		/// Overrides any request for a property's value.
+		flash_proxy function getProperty (name:*) : *;
+
+		/// Overrides a request to check whether an object has a particular property by name.
+		flash_proxy function hasProperty (name:*) : Boolean;
+
+		/// Checks whether a supplied QName is also marked as an attribute.
+		flash_proxy function isAttribute (name:*) : Boolean;
+
+		/// Allows enumeration of the proxied object's properties by index number to retrieve property names.
+		flash_proxy function nextName (index:int) : String;
+
+		/// Allows enumeration of the proxied object's properties by index number.
+		flash_proxy function nextNameIndex (index:int) : int;
+
+		/// Allows enumeration of the proxied object's properties by index number to retrieve property values.
+		flash_proxy function nextValue (index:int) : *;
+
+		flash_proxy function Proxy ();
+
+		/// Overrides a call to change a property's value.
+		flash_proxy function setProperty (name:*, value:*) : void;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/SetIntervalTimer.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/SetIntervalTimer.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,9 @@
+package flash.utils
+{
+	import flash.events.Event;
+
+	public class SetIntervalTimer extends Timer
+	{
+		public function SetIntervalTimer (closure:Function, delay:Number, repeats:Boolean, rest:Array);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/Timer.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/Timer.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,46 @@
+package flash.utils
+{
+	import flash.events.EventDispatcher;
+
+	/**
+	 * Dispatched whenever it has completed the number of requests set by Timer.repeatCount.
+	 * @eventType flash.events.TimerEvent.TIMER_COMPLETE
+	 */
+	[Event(name="timerComplete", type="flash.events.TimerEvent")] 
+
+	/**
+	 * Dispatched whenever a Timer object reaches an interval specified according to the Timer.delay property.
+	 * @eventType flash.events.TimerEvent.TIMER
+	 */
+	[Event(name="timer", type="flash.events.TimerEvent")] 
+
+	/// The Timer class is the interface to Flash Player timers.
+	public class Timer extends EventDispatcher
+	{
+		/// The total number of times the timer has fired since it started at zero.
+		public function get currentCount () : int;
+
+		/// The delay, in milliseconds, between timer events.
+		public function get delay () : Number;
+		public function set delay (value:Number) : void;
+
+		/// The total number of times the timer is set to run.
+		public function get repeatCount () : int;
+		public function set repeatCount (value:int) : void;
+
+		/// The timer's current state; true if the timer is running, otherwise false.
+		public function get running () : Boolean;
+
+		/// Stops the timer, if it is running, and sets the currentCount property back to 0, like the reset button of a stopwatch.
+		public function reset () : void;
+
+		/// Starts the timer, if it is not already running.
+		public function start () : void;
+
+		/// Stops the timer.
+		public function stop () : void;
+
+		/// Constructs a new Timer object with the specified delay and repeatCount states.
+		public function Timer (delay:Number, repeatCount:int = 0);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/package.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/utils/package.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,40 @@
+package flash.utils
+{
+	/// Proxy methods namespace
+	public namespace flash_proxy;
+
+	/// Runs a function at a specified interval (in milliseconds).
+	public function setInterval (closure:Function, delay:Number, ...arguments) : uint;
+
+	/// Runs a specified function after a specified delay (in milliseconds).
+	public function setTimeout (closure:Function, delay:Number, ...arguments) : uint;
+
+	/// Cancels a specified setInterval() call.
+	public function clearInterval (id:uint) : void;
+
+	/// Cancels a specified setTimeout() call.
+	public function clearTimeout (id:uint) : void;
+
+	/// Produces an XML object that describes the ActionScript object named as the parameter of the method.
+	public function describeType (value:*) : XML;
+
+	/// Returns the fully qualified class name of an object.
+	public function getQualifiedClassName (value:*) : String;
+
+	/// Returns a reference to the class object of the class specified by the name parameter.
+	public function getDefinitionByName (name:String) : Object;
+
+	/// Returns the fully qualified class name of the base class of the object specified by the value parameter.
+	public function getQualifiedSuperclassName (value:*) : String;
+
+	/// Returns the number of milliseconds that have elapsed since Flash Player was initialized, and is used to compute relative time.
+	public function getTimer () : int;
+
+	/// Returns an escaped copy of the input string encoded as either UTF-8 or system code page, depending on the value of System.useCodePage.
+	public function escapeMultiByte (value:String) : String;
+
+	/// Returns an unescaped copy of the input string, which is decoded from either system code page page or UTF-8 depending on the value of System.useCodePage.
+	public function unescapeMultiByte (value:String) : String;
+
+}
+

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/XMLDocument.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/XMLDocument.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,32 @@
+package flash.xml
+{
+	import flash.xml.XMLNode;
+
+	/// The XMLDocument class represents the legacy XML object that was present in ActionScript 2.0.
+	public class XMLDocument extends XMLNode
+	{
+		/// Specifies information about the XML document's DOCTYPE declaration.
+		public var docTypeDecl : Object;
+		/// An Object containing the nodes of the XML that have an id attribute assigned.
+		public var idMap : Object;
+		/// When set to true, text nodes that contain only white space are discarded during the parsing process.
+		public var ignoreWhite : Boolean;
+		/// A string that specifies information about a document's XML declaration.
+		public var xmlDecl : Object;
+
+		/// Creates a new XMLNode object with the name specified in the parameter.
+		public function createElement (name:String) : XMLNode;
+
+		/// Creates a new XML text node with the specified text.
+		public function createTextNode (text:String) : XMLNode;
+
+		/// Parses the XML text specified in the value parameter and populates the specified XMLDocument object with the resulting XML tree.
+		public function parseXML (source:String) : void;
+
+		/// Returns a string representation of the XML object.
+		public function toString () : String;
+
+		/// Creates a new XMLDocument object.
+		public function XMLDocument (source:String = null);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/XMLNode.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/XMLNode.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,68 @@
+package flash.xml
+{
+	import flash.xml.XMLNode;
+
+	/// The XMLNode class represents the legacy XML object that was present in ActionScript 2.0 and that was renamed in ActionScript 3.0.
+	public class XMLNode extends Object
+	{
+		/// Evaluates the specified XMLDocument object and references the first child in the parent node's child list.
+		public var firstChild : XMLNode;
+		/// An XMLNode value that references the last child in the node's child list.
+		public var lastChild : XMLNode;
+		/// An XMLNode value that references the next sibling in the parent node's child list.
+		public var nextSibling : XMLNode;
+		/// A string representing the node name of the XMLNode object.
+		public var nodeName : String;
+		/// A nodeType constant value, either XMLNodeType.ELEMENT_NODE for an XML element or XMLNodeType.TEXT_NODE for a text node.
+		public var nodeType : uint;
+		/// The node value of the XMLDocument object.
+		public var nodeValue : String;
+		/// An XMLNode value that references the parent node of the specified XML object, or returns null if the node has no parent.
+		public var parentNode : XMLNode;
+		/// An XMLNode value that references the previous sibling in the parent node's child list.
+		public var previousSibling : XMLNode;
+
+		/// An object containing all of the attributes of the specified XMLNode instance.
+		public function get attributes () : Object;
+		public function set attributes (value:Object) : void;
+
+		/// An array of the specified XMLNode object's children.
+		public function get childNodes () : Array;
+
+		/// The local name portion of the XML node's name.
+		public function get localName () : String;
+
+		/// If the XML node has a prefix, namespaceURI is the value of the xmlns declaration for that prefix (the URI), which is typically called the namespace URI.
+		public function get namespaceURI () : String;
+
+		/// The prefix portion of the XML node name.
+		public function get prefix () : String;
+
+		/// Appends the specified node to the XML object's child list.
+		public function appendChild (node:XMLNode) : void;
+
+		/// Constructs and returns a new XML node of the same type, name, value, and attributes as the specified XML object.
+		public function cloneNode (deep:Boolean) : XMLNode;
+
+		/// Returns the namespace URI that is associated with the specified prefix for the node.
+		public function getNamespaceForPrefix (prefix:String) : String;
+
+		/// Returns the prefix that is associated with the specified namespace URI for the node.
+		public function getPrefixForNamespace (ns:String) : String;
+
+		/// Indicates whether the specified XMLNode object has child nodes.
+		public function hasChildNodes () : Boolean;
+
+		/// Inserts a new child node into the XML object's child list, before the beforeNode node.
+		public function insertBefore (node:XMLNode, before:XMLNode) : void;
+
+		/// Removes the specified XML object from its parent.
+		public function removeNode () : void;
+
+		/// Evaluates the specified XMLNode object, constructs a textual representation of the XML structure, including the node, children, and attributes, and returns the result as a string.
+		public function toString () : String;
+
+		/// Creates a new XMLNode object.
+		public function XMLNode (type:uint, value:String);
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/XMLNodeType.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/XMLNodeType.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,18 @@
+package flash.xml
+{
+	/// The XMLNodeType class contains constants used with XMLNode.nodeType.
+	public class XMLNodeType extends Object
+	{
+		public static const CDATA_NODE : uint;
+		public static const COMMENT_NODE : uint;
+		public static const DOCUMENT_TYPE_NODE : uint;
+		/// Specifies that the node is an element.
+		public static const ELEMENT_NODE : uint;
+		public static const PROCESSING_INSTRUCTION_NODE : uint;
+		/// Specifies that the node is a text node.
+		public static const TEXT_NODE : uint;
+		public static const XML_DECLARATION : uint;
+
+		public function XMLNodeType ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/XMLParser.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/XMLParser.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+package flash.xml
+{
+	import flash.xml.XMLTag;
+
+	public class XMLParser extends Object
+	{
+		public function getNext (tag:XMLTag) : int;
+
+		public function startParse (source:String, ignoreWhite:Boolean) : void;
+
+		public function XMLParser ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/XMLTag.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/flash/xml/XMLTag.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,19 @@
+package flash.xml
+{
+	public class XMLTag extends Object
+	{
+		public function get attrs () : Object;
+		public function set attrs (value:Object) : void;
+
+		public function get empty () : Boolean;
+		public function set empty (value:Boolean) : void;
+
+		public function get type () : uint;
+		public function set type (value:uint) : void;
+
+		public function get value () : String;
+		public function set value (v:String) : void;
+
+		public function XMLTag ();
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/int.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/int.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,30 @@
+package
+{
+	/// The int class lets you work with the data type representing a 32-bit signed integer.
+	public class int extends Object
+	{
+		public static const length : int;
+		/// The largest representable 32-bit signed integer, which is 2,147,483,647.
+		public static const MAX_VALUE : int;
+		/// The smallest representable 32-bit signed integer, which is -2,147,483,648.
+		public static const MIN_VALUE : int;
+
+		/// Constructor; creates a new int object.
+		public function int (value:* = 0);
+
+		/// Returns a string representation of the number in exponential notation.
+		public function toExponential (p:* = 0) : String;
+
+		/// Returns a string representation of the number in fixed-point notation.
+		public function toFixed (p:* = 0) : String;
+
+		/// Returns a string representation of the number either in exponential notation or in fixed-point notation.
+		public function toPrecision (p:* = 0) : String;
+
+		/// Returns the string representation of an int object.
+		public function toString (radix:* = 10) : String;
+
+		/// Returns the primitive value of the specified int object.
+		public function valueOf () : int;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/toplevel.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/toplevel.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,49 @@
+package
+{
+	/// A special value representing positive Infinity.
+	public var Infinity:Number;
+
+	/// A special member of the Number data type that represents a value that is "not a number" (NaN).
+	public var NaN:Number;
+
+	/// A special value that applies to untyped variables that have not been initialized or dynamic object properties that are not initialized.
+	public var undefined:*;
+
+	/// Displays expressions, or writes to log files, while debugging.
+	public function trace (...arguments) : void;
+
+	/// Decodes an encoded URI into a string.
+	public function decodeURI (uri:String) : String;
+
+	/// Decodes an encoded URI component into a string.
+	public function decodeURIComponent (uri:String) : String;
+
+	/// Encodes a string into a valid URI (Uniform Resource Identifier).
+	public function encodeURI (uri:String) : String;
+
+	/// Encodes a string into a valid URI component.
+	public function encodeURIComponent (uri:String) : String;
+
+	/// Converts the parameter to a string and encodes it in a URL-encoded format, where most nonalphanumeric characters are replaced with % hexadecimal sequences.
+	public function escape (str:String) : String;
+
+	/// Returns true if the value is a finite number, or false if the value is Infinity or -Infinity.
+	public function isFinite (num:Number) : Boolean;
+
+	/// Returns true if the value is NaN(not a number).
+	public function isNaN (num:Number) : Boolean;
+
+	/// Determines whether the specified string is a valid name for an XML element or attribute.
+	public function isXMLName (str:String) : Boolean;
+
+	/// Converts a string to an integer.
+	public function parseInt (str:String, radix:uint = 0) : Number;
+
+	/// Converts a string to a floating-point number.
+	public function parseFloat (str:String) : Number;
+
+	/// Evaluates the parameter str as a string, decodes the string from URL-encoded format (converting all hexadecimal sequences to ASCII characters), and returns the string.
+	public function unescape (str:String) : String;
+
+}
+

Added: pypy/branch/avm/pypy/translator/avm2/intrinsic/src/uint.as
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/intrinsic/src/uint.as	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,30 @@
+package
+{
+	/// The uint class provides methods for working with a data type representing a 32-bit unsigned integer.
+	public class uint extends Object
+	{
+		public static const length : int;
+		/// The largest representable 32-bit unsigned integer, which is 4,294,967,295.
+		public static const MAX_VALUE : uint;
+		/// The smallest representable unsigned integer, which is 0.
+		public static const MIN_VALUE : uint;
+
+		/// Returns a string representation of the number in exponential notation.
+		public function toExponential (p:* = 0) : String;
+
+		/// Returns a string representation of the number in fixed-point notation.
+		public function toFixed (p:* = 0) : String;
+
+		/// Returns a string representation of the number either in exponential notation or in fixed-point notation.
+		public function toPrecision (p:* = 0) : String;
+
+		/// Returns the string representation of a uint object.
+		public function toString (radix:* = 10) : String;
+
+		/// Creates a new uint object.
+		public function uint (value:* = 0);
+
+		/// Returns the primitive uint type value of the specified uint object.
+		public function valueOf () : uint;
+	}
+}

Added: pypy/branch/avm/pypy/translator/avm2/metavm.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/metavm.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,297 @@
+from pypy.translator.cli import oopspec
+from pypy.rpython.ootypesystem import ootype
+from pypy.translator.oosupport.metavm import InstructionList, MicroInstruction, \
+     PushAllArgs, StoreResult, GetField, SetField, DownCast
+from pypy.translator.oosupport.metavm import _Call as _OOCall
+# from pypy.translator.cli.comparer import EqualityComparer
+from pypy.translator.avm2.runtime import _static_meth, NativeInstance
+
+STRING_HELPER_CLASS = '[pypylib]pypy.runtime.String'
+
+def functype_to_cts(cts, FUNC):
+    ret_type = cts.lltype_to_cts(FUNC.RESULT)
+    arg_types = [cts.lltype_to_cts(arg).typename()
+                 for arg in FUNC.ARGS
+                 if arg is not ootype.Void]
+    return ret_type, arg_types
+
+class _Call(_OOCall):
+    
+    def render(self, generator, op):
+        callee = op.args[0].value
+        if isinstance(callee, _static_meth):
+            self._render_native_function(generator, callee, op.args)
+        else:
+            _OOCall.render(self, generator, op)
+
+    def _render_native_function(self, generator, funcdesc, args):
+        for func_arg in args[1:]: # push parameters
+            self._load_arg_or_null(generator, func_arg)
+        cts = generator.cts
+        #ret_type, arg_types = functype_to_cts(cts, funcdesc._TYPE)
+        #arg_list = ', '.join(arg_types)
+        #signature = '%s %s::%s(%s)' % (ret_type, funcdesc._cls._name, funcdesc._name, arg_list)
+        generator.call_signature(signature)
+
+    def _load_arg_or_null(self, generator, arg):
+        if arg.concretetype is ootype.Void:
+            if arg.value is None:
+                generator.ilasm.opcode('ldnull') # special-case: use None as a null value
+            else:
+                assert False, "Don't know how to load this arg"
+        else:
+            generator.load(arg)
+
+
+class _CallMethod(_Call):
+    def render(self, generator, op):
+        method = op.args[0]
+        self._render_method(generator, method.value, op.args[1:])
+
+    def _render_method(self, generator, method_name, args):
+        this = args[0]
+        native = isinstance(this.concretetype, NativeInstance)
+        for arg in args: # push parametes
+            if native:
+                self._load_arg_or_null(generator, arg)
+            else:
+                generator.load(arg)
+
+        # XXX: very hackish, need refactoring
+        if this.concretetype in (ootype.String, ootype.Unicode):
+            # special case for string: don't use methods, but plain functions
+            METH = this.concretetype._METHODS[method_name]
+            cts = generator.cts
+            ret_type, arg_types = functype_to_cts(cts, METH)
+            arg_types.insert(0, cts.lltype_to_cts(ootype.String).typename())
+            generator.call_method(signature)
+        elif isinstance(this.concretetype, ootype.Array) and this.concretetype.ITEM is not ootype.Void:
+            v_array = args[0]
+            ARRAY = v_array.concretetype
+            if method_name == 'll_setitem_fast':
+                generator.array_setitem(ARRAY)
+            elif method_name == 'll_getitem_fast':
+                generator.array_getitem(ARRAY)
+            elif method_name == 'll_length':
+                generator.array_length(ARRAY)
+            else:
+                assert False
+        else:
+            generator.call_method(this.concretetype, method_name)
+            
+            # special case: DictItemsIterator(XXX,
+            # Void).ll_current_value needs to return an int32 because
+            # we can't use 'void' as a parameter of a Generic. This
+            # means that after the call to ll_current_value there will
+            # be a value on the stack, and we need to explicitly pop
+            # it.
+            if isinstance(this.concretetype, ootype.DictItemsIterator) and \
+                   ((this.concretetype._VALUETYPE is ootype.Void and \
+                     method_name == 'll_current_value') or \
+                    (this.concretetype._KEYTYPE is ootype.Void and \
+                     method_name == 'll_current_key')):
+                generator.ilasm.pop()
+
+
+class _IndirectCall(_CallMethod):
+    def render(self, generator, op):
+        # discard the last argument because it's used only for analysis
+        self._render_method(generator, 'Invoke', op.args[:-1])
+
+class _RuntimeNew(MicroInstruction):
+    def render(self, generator, op):
+        generator.load(op.args[0])
+        generator.call_signature('object [pypylib]pypy.runtime.Utils::RuntimeNew(class [mscorlib]System.Type)')
+        generator.cast_to(op.result.concretetype)
+
+class CallConstantMethod(MicroInstruction):
+    pass
+
+# class _NewCustomDict(MicroInstruction):
+#     def render(self, generator, op):
+#         DICT = op.args[0].value
+#         comparer = EqualityComparer(generator.db, DICT._KEYTYPE,
+#                                     (op.args[1], op.args[2], op.args[3]),
+#                                     (op.args[4], op.args[5], op.args[6]))
+#         generator.db.pending_node(comparer)
+#         dict_type = generator.cts.lltype_to_cts(DICT)
+
+#         generator.ilasm.new(comparer.get_ctor())
+#         generator.ilasm.new('instance void %s::.ctor(class'
+#                             '[mscorlib]System.Collections.Generic.IEqualityComparer`1<!0>)'
+#                             % dict_type)
+
+#XXX adapt to new way of things
+#class _CastWeakAdrToPtr(MicroInstruction):
+#    def render(self, generator, op):
+#        RESULTTYPE = op.result.concretetype
+#        resulttype = generator.cts.lltype_to_cts(RESULTTYPE)
+#        generator.load(op.args[0])
+#        generator.ilasm.call_method('object class %s::get_Target()' % WEAKREF, True)
+#        generator.ilasm.opcode('castclass', resulttype)
+
+# class MapException(MicroInstruction):
+#     COUNT = 0
+    
+#     def __init__(self, instr, mapping):
+#         if isinstance(instr, str):
+#             self.instr = InstructionList([PushAllArgs, instr, StoreResult])
+#         else:
+#             self.instr = InstructionList(instr)
+#         self.mapping = mapping
+
+#     def render(self, generator, op):
+#         ilasm = generator.ilasm
+#         label = '__check_block_%d' % MapException.COUNT
+#         MapException.COUNT += 1
+#         ilasm.begin_try()
+#         self.instr.render(generator, op)
+#         ilasm.leave(label)
+#         ilasm.end_try()
+#         for cli_exc, py_exc in self.mapping:
+#             ilasm.begin_catch(cli_exc)
+#             ilasm.new('instance void class %s::.ctor()' % py_exc)
+#             ilasm.opcode('throw')
+#             ilasm.end_catch()
+#         ilasm.label(label)
+#         ilasm.opcode('nop')
+
+# class _Box(MicroInstruction): 
+#     def render(self, generator, op):
+#         generator.load(op.args[0])
+#         TYPE = op.args[0].concretetype
+#         boxtype = generator.cts.lltype_to_cts(TYPE)
+#         generator.ilasm.opcode('box', boxtype)
+
+# class _Unbox(MicroInstruction):
+#     def render(self, generator, op):
+#         v_obj, v_type = op.args
+#         assert v_type.concretetype is ootype.Void
+#         TYPE = v_type.value
+#         boxtype = generator.cts.lltype_to_cts(TYPE)
+#         generator.load(v_obj)
+#         generator.ilasm.opcode('unbox.any', boxtype)
+
+class _NewArray(MicroInstruction):
+    def render(self, generator, op):
+        v_type, v_length = op.args
+        assert v_type.concretetype is ootype.Void
+        TYPE = v_type.value._INSTANCE
+        typetok = generator.cts.lltype_to_cts(TYPE)
+        generator.load(v_length)
+        generator.ilasm.opcode('newarr', typetok)
+
+class _GetArrayElem(MicroInstruction):
+    def render(self, generator, op):
+        generator.load(op.args[0])
+        generator.load(op.args[1])
+        rettype = generator.cts.lltype_to_cts(op.result.concretetype)
+        generator.ilasm.opcode('ldelem', rettype)
+
+class _SetArrayElem(MicroInstruction):
+    def render(self, generator, op):
+        v_array, v_index, v_elem = op.args
+        generator.load(v_array)
+        generator.load(v_index)
+        if v_elem.concretetype is ootype.Void and v_elem.value is None:
+            generator.ilasm.opcode('ldnull')
+        else:
+            generator.load(v_elem)
+        elemtype = generator.cts.lltype_to_cts(v_array.concretetype)
+        generator.ilasm.opcode('stelem', elemtype)
+
+class _TypeOf(MicroInstruction):
+    def render(self, generator, op):
+        c_type, = op.args
+        assert c_type.concretetype is ootype.Void
+        if isinstance(c_type.value, ootype.StaticMethod):
+            FUNC = c_type.value
+            fullname = generator.cts.lltype_to_cts(FUNC)
+        else:
+            cliClass = c_type.value
+            fullname = cliClass._INSTANCE._name
+        generator.ilasm.opcode('ldtoken', fullname)
+        generator.ilasm.call('class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)')
+
+class _EventHandler(MicroInstruction):
+    def render(self, generator, op):
+        cts = generator.cts
+        v_obj, c_methname = op.args
+        assert c_methname.concretetype is ootype.Void
+        TYPE = v_obj.concretetype
+        classname = TYPE._name
+        methname = 'o' + c_methname.value # XXX: do proper mangling
+        _, meth = TYPE._lookup(methname)
+        METH = ootype.typeOf(meth)
+        ret_type, arg_types = functype_to_cts(cts, METH)
+        arg_list = ', '.join(arg_types)
+        generator.load(v_obj)
+        desc = '%s class %s::%s(%s)' % (ret_type, classname, methname, arg_list)
+        generator.ilasm.opcode('ldftn instance', desc)
+        generator.ilasm.opcode('newobj', 'instance void class [mscorlib]System.EventHandler::.ctor(object, native int)')
+
+class _GetStaticField(MicroInstruction):
+    def render(self, generator, op):
+        cli_class = op.args[0].value
+        fldname = op.args[1].value
+        TYPE = op.result.concretetype
+        cts_type = generator.cts.lltype_to_cts(TYPE)
+        desc = '%s::%s' % (cli_class._name, fldname)
+        generator.ilasm.load_static_field(cts_type, desc)
+
+class _SetStaticField(MicroInstruction):
+    def render(self, generator, op):
+        cli_class = op.args[0].value
+        fldname = op.args[1].value
+        TYPE = op.result.concretetype
+        cts_type = generator.cts.lltype_to_cts(TYPE)
+        desc = '%s::%s' % (cli_class._name, fldname)
+        generator.load(op.args[2])
+        generator.ilasm.store_static_field(cts_type, desc)
+
+class _FieldInfoForConst(MicroInstruction):
+    def render(self, generator, op):
+        from pypy.translator.cli.constant import CONST_CLASS
+        llvalue = op.args[0].value
+        constgen = generator.db.constant_generator
+        const = constgen.record_const(llvalue)
+        generator.ilasm.opcode('ldtoken', CONST_CLASS)
+        generator.ilasm.call('class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)')
+        generator.ilasm.opcode('ldstr', '"%s"' % const.name)
+        generator.ilasm.call_method('class [mscorlib]System.Reflection.FieldInfo class [mscorlib]System.Type::GetField(string)', virtual=True)
+
+
+OOTYPE_TO_MNEMONIC = {
+    ootype.Bool: 'i1', 
+    ootype.Char: 'i2',
+    ootype.UniChar: 'i2',
+    ootype.Signed: 'i4',
+    ootype.SignedLongLong: 'i8',
+    ootype.Unsigned: 'u4',
+    ootype.UnsignedLongLong: 'u8',
+    ootype.Float: 'r8',
+    }
+
+class _CastPrimitive(MicroInstruction):
+    def render(self, generator, op):
+        TO = op.result.concretetype
+        mnemonic = OOTYPE_TO_MNEMONIC[TO]
+        generator.ilasm.opcode('conv.%s' % mnemonic)
+
+Call = _Call()
+CallMethod = _CallMethod()
+IndirectCall = _IndirectCall()
+RuntimeNew = _RuntimeNew()
+NewCustomDict = _NewCustomDict()
+#CastWeakAdrToPtr = _CastWeakAdrToPtr()
+Box = _Box()
+Unbox = _Unbox()
+NewArray = _NewArray()
+GetArrayElem = _GetArrayElem()
+SetArrayElem = _SetArrayElem()
+TypeOf = _TypeOf()
+EventHandler = _EventHandler()
+GetStaticField = _GetStaticField()
+SetStaticField = _SetStaticField()
+FieldInfoForConst = _FieldInfoForConst()
+CastPrimitive = _CastPrimitive()

Added: pypy/branch/avm/pypy/translator/avm2/opcodes.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/opcodes.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,141 @@
+
+from pypy.translator.oosupport import metavm as om
+from pypy.translator.avm1 import metavm as am, avm2 as a
+
+DoNothing = [om.PushAllArgs]
+
+misc_ops = {
+    'new':           [om.New],
+    'runtimenew':    [om.RuntimeNew],
+    'oosetfield':    [am.SetField],
+    'oogetfield':    [am.GetField],
+    'oonewarray':    [om.OONewArray],
+    'oosend':        [am.CallMethod],
+}
+
+unary_ops = {
+    'same_as':                DoNothing,
+    'bool_not':               'not',
+    'int_neg':                'negate',
+    'int_neg_ovf':            'negate',
+    'int_abs':                [am.PushArgsForFunctionCall, am.CallConstantMethod("Math", "abs")],
+
+    'cast_int_to_char':       [am.PushArgsForFunctionCall, am.CallConstantMethod("String", "fromCharCode")],
+    'cast_int_to_unichar':    [am.PushArgsForFunctionCall, am.CallConstantMethod("String", "fromCharCode")],
+    'cast_int_to_float':      DoNothing,
+    'cast_int_to_longlong':   DoNothing,
+    'cast_int_to_uint':       DoNothing,
+    'cast_int_to_long':       DoNothing,
+    'cast_uint_to_float':     DoNothing,
+    'cast_uint_to_longlong':  DoNothing,
+    'cast_uint_to_int' :      DoNothing,
+    'cast_uint_to_long':      DoNothing,
+
+    'cast_bool_to_int':       'convert_to_number',
+    'cast_bool_to_uint':      'convert_to_number',
+    'cast_bool_to_float':     'convert_to_number',
+
+   
+}
+
+binary_ops = {
+    'int_add':              'typed_add',
+    'int_sub':              'subtract',
+    'int_mul':              'multiply',
+    'int_floordiv':         [om.PushAllArgs, 'divide', am.PushConst(1), am.CallConstantMethod("Math", "floor")],
+    'int_mod':              'modulo',
+    'int_lt':               'typed_less',
+    'int_le':               [om.PushAllArgs, 'greater', 'not'],
+    'int_eq':               'typed_equals',
+    'int_ne':               [om.PushAllArgs, 'typed_equals', 'not'],
+    'int_gt':               'greater',
+    'int_ge':               [om.PushAllArgs, 'typed_less', 'not'],
+
+    'int_and':              'bit_and',
+    'int_or':               'bit_or',
+    'int_lshift':           'shift_left',
+    'int_rshift':           'shift_right',
+    'int_xor':              'bit_xor',
+
+    'uint_add':              'typed_add',
+    'uint_sub':              'subtract',
+    'uint_mul':              'multiply',
+    'uint_floordiv':         [om.PushAllArgs, 'divide', am.PushConst(1), am.CallConstantMethod("Math", "floor")],
+    'uint_mod':              'modulo',
+    'uint_lt':               'typed_less',
+    'uint_le':               [om.PushAllArgs, 'greater', 'not'],
+    'uint_eq':               'typed_equals',
+    'uint_ne':               [om.PushAllArgs, 'typed_equals', 'not'],
+    'uint_gt':               'greater',
+    'uint_ge':               [om.PushAllArgs, 'typed_less', 'not'],
+
+    'uint_and':              'bit_and',
+    'uint_or':               'bit_or',
+    'uint_lshift':           'shift_left',
+    'uint_rshift':           'shift_right',
+    'uint_xor':              'bit_xor',
+    
+    'float_add':              'typed_add',
+    'float_sub':              'subtract',
+    'float_mul':              'multiply',
+    'float_floordiv':         [om.PushAllArgs, 'divide', am.PushConst(1), am.CallConstantMethod("Math", "floor")],
+    'float_mod':              'modulo',
+    'float_lt':               'typed_less',
+    'float_le':               [om.PushAllArgs, 'greater', 'not'],
+    'float_eq':               'typed_equals',
+    'float_ne':               [om.PushAllArgs, 'typed_equals', 'not'],
+    'float_gt':               'greater',
+    'float_ge':               [om.PushAllArgs, 'typed_less', 'not'],
+
+    'float_and':              'bit_and',
+    'float_or':               'bit_or',
+    'float_lshift':           'shift_left',
+    'float_rshift':           'shift_right',
+    'float_xor':              'bit_xor',
+    
+    'llong_add':              'typed_add',
+    'llong_sub':              'subtract',
+    'llong_mul':              'multiply',
+    'llong_floordiv':         [om.PushAllArgs, 'divide', am.PushConst(1), am.CallConstantMethod("Math", "floor")],
+    'llong_mod':              'modulo',
+    'llong_lt':               'typed_less',
+    'llong_le':               [om.PushAllArgs, 'greater', 'not'],
+    'llong_eq':               'typed_equals',
+    'llong_ne':               [om.PushAllArgs, 'typed_equals', 'not'],
+    'llong_gt':               'greater',
+    'llong_ge':               [om.PushAllArgs, 'typed_less', 'not'],
+
+    'llong_and':              'bit_and',
+    'llong_or':               'bit_or',
+    'llong_lshift':           'shift_left',
+    'llong_rshift':           'shift_right',
+    'llong_xor':              'bit_xor',
+
+    'ullong_add':              'typed_add',
+    'ullong_sub':              'subtract',
+    'ullong_mul':              'multiply',
+    'ullong_floordiv':         [om.PushAllArgs, 'divide', am.PushConst(1), am.CallConstantMethod("Math", "floor")],
+    'ullong_mod':              'modulo',
+    'ullong_lt':               'typed_less',
+    'ullong_le':               [om.PushAllArgs, 'greater', 'not'],
+    'ullong_eq':               'typed_equals',
+    'ullong_ne':               [om.PushAllArgs, 'typed_equals', 'not'],
+    'ullong_gt':               'greater',
+    'ullong_ge':               [om.PushAllArgs, 'typed_less', 'not'],
+    'ullong_lshift':           'shift_left',
+    'ullong_rshift':           'shift_right',
+}
+
+opcodes = misc_ops.copy()
+opcodes.update(unary_ops)
+opcodes.update(binary_ops)
+
+for key, value in opcodes.iteritems():
+    if isinstance(value, str):
+        value = [am.StoreResultStart, om.PushAllArgs, value, am.StoreResultEnd]
+    if am.StoreResultStart not in value:
+        value.insert(0, am.StoreResultStart)
+    if am.StoreResultEnd not in value:
+        value.append(am.StoreResultEnd)
+    value = om.InstructionList(value)
+    opcodes[key] = value

Added: pypy/branch/avm/pypy/translator/avm2/test/__init__.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/__init__.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1 @@
+#

Added: pypy/branch/avm/pypy/translator/avm2/test/autopath.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/autopath.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,135 @@
+"""
+self cloning, automatic path configuration 
+
+copy this into any subdirectory of pypy from which scripts need 
+to be run, typically all of the test subdirs. 
+The idea is that any such script simply issues
+
+    import autopath
+
+and this will make sure that the parent directory containing "pypy"
+is in sys.path. 
+
+If you modify the master "autopath.py" version (in pypy/tool/autopath.py) 
+you can directly run it which will copy itself on all autopath.py files
+it finds under the pypy root directory. 
+
+This module always provides these attributes:
+
+    pypydir    pypy root directory path 
+    this_dir   directory where this autopath.py resides 
+
+"""
+
+def __dirinfo(part):
+    """ return (partdir, this_dir) and insert parent of partdir
+    into sys.path.  If the parent directories don't have the part
+    an EnvironmentError is raised."""
+
+    import sys, os
+    try:
+        head = this_dir = os.path.realpath(os.path.dirname(__file__))
+    except NameError:
+        head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0]))
+
+    error = None
+    while head:
+        partdir = head
+        head, tail = os.path.split(head)
+        if tail == part:
+            # check if "../py/__init__.py" exists
+            checkfile = os.path.join(partdir, os.pardir, 'py', '__init__.py')
+            if not os.path.exists(checkfile):
+                error = "Cannot find %r" % (os.path.normpath(checkfile),)
+            break
+    else:
+        error = "Cannot find the parent directory %r of the path %r" % (
+            partdir, this_dir)
+    if not error:
+        # check for bogus end-of-line style (e.g. files checked out on
+        # Windows and moved to Unix)
+        f = open(__file__.replace('.pyc', '.py'), 'r')
+        data = f.read()
+        f.close()
+        if data.endswith('\r\n') or data.endswith('\r'):
+            error = ("Bad end-of-line style in the .py files. Typically "
+                     "caused by a zip file or a checkout done on Windows and "
+                     "moved to Unix or vice-versa.")
+    if error:
+        raise EnvironmentError("Invalid source tree - bogus checkout! " +
+                               error)
+    
+    pypy_root = os.path.join(head, '')
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
+
+    munged = {}
+    for name, mod in sys.modules.items():
+        if '.' in name:
+            continue
+        fn = getattr(mod, '__file__', None)
+        if not isinstance(fn, str):
+            continue
+        newname = os.path.splitext(os.path.basename(fn))[0]
+        if not newname.startswith(part + '.'):
+            continue
+        path = os.path.join(os.path.dirname(os.path.realpath(fn)), '')
+        if path.startswith(pypy_root) and newname != part:
+            modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep)
+            if newname != '__init__':
+                modpaths.append(newname)
+            modpath = '.'.join(modpaths)
+            if modpath not in sys.modules:
+                munged[modpath] = mod
+
+    for name, mod in munged.iteritems():
+        if name not in sys.modules:
+            sys.modules[name] = mod
+        if '.' in name:
+            prename = name[:name.rfind('.')]
+            postname = name[len(prename)+1:]
+            if prename not in sys.modules:
+                __import__(prename)
+                if not hasattr(sys.modules[prename], postname):
+                    setattr(sys.modules[prename], postname, mod)
+
+    return partdir, this_dir
+
+def __clone():
+    """ clone master version of autopath.py into all subdirs """
+    from os.path import join, walk
+    if not this_dir.endswith(join('pypy','tool')):
+        raise EnvironmentError("can only clone master version "
+                               "'%s'" % join(pypydir, 'tool',_myname))
+
+
+    def sync_walker(arg, dirname, fnames):
+        if _myname in fnames:
+            fn = join(dirname, _myname)
+            f = open(fn, 'rwb+')
+            try:
+                if f.read() == arg:
+                    print "checkok", fn
+                else:
+                    print "syncing", fn
+                    f = open(fn, 'w')
+                    f.write(arg)
+            finally:
+                f.close()
+    s = open(join(pypydir, 'tool', _myname), 'rb').read()
+    walk(pypydir, sync_walker, s)
+
+_myname = 'autopath.py'
+
+# set guaranteed attributes
+
+pypydir, this_dir = __dirinfo('pypy')
+import py
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
+
+if __name__ == '__main__':
+    __clone()

Added: pypy/branch/avm/pypy/translator/avm2/test/bootstrap.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/bootstrap.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,22 @@
+import autopath
+
+from pypy.translator.avm import swf as s, avm1 as a, tags as t, records as r
+
+if __name__ == "__main__":
+    with open("test.swf", "w") as f:
+        data = s.SwfData()
+        data.add_tag(t.SetBackgroundColor(0x333333))
+        data.add_tag(t.DefineEditText(r.Rect(0, 0, 0, 0), "txt", "Testing!", color=r.RGBA(0xFFFFFF)))
+        data.add_tag(t.PlaceObject(1, 2))
+        actions = t.DoAction()
+        actions.add_action(a.ActionPush("txt", "txt"))
+        actions.add_action(a.ActionGetVariable())
+        actions.add_action(a.ActionPush("\nTesting 2!"))
+        actions.add_action(a.ActionStringAdd())
+        actions.add_action(a.ActionSetVariable())
+        actions.add_action(a.ActionPush("/test.result", ""))
+        actions.add_action(a.ActionGetURL2("POST"))
+        data.add_tag(actions)
+        data.add_tag(t.ShowFrame())
+        data.add_tag(t.End())
+        f.write(data.serialize())

Added: pypy/branch/avm/pypy/translator/avm2/test/browsertest.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/browsertest.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,99 @@
+from BaseHTTPServer import HTTPServer as BaseHTTPServer, BaseHTTPRequestHandler
+from cgi import parse_qs
+
+import time
+import webbrowser
+
+class HTTPServer(BaseHTTPServer):
+    allow_reuse_address = True
+
+class config(object):
+    http_port = 10001
+
+    html_page = """<html>
+<head>
+<title>PyPy AVM Backend Test Case: %s</title>
+</head>
+<body>
+<object type="application/x-shockwave-flash" data="test.swf" width="%d" height="%d">
+<param name="movie" value="test.swf" />
+<param name="allowScriptAccess" value="always" />
+</object>
+</body>
+</html>"""
+
+    crossdomain_xml="""<cross-domain-policy>
+<allow-access-from domain="*" secure="false"/>
+</cross-domain-policy>"""
+
+def parse_result(string):
+    if string == "true":
+        return True
+    elif string == "false":
+        return False
+    elif string == "undefined" or string == "null":
+        return None
+    elif all(c in "123456789-" for c in string):
+        return int(string)
+    elif "," in string:
+        return [parse_result(s) for s in string.split(",")]
+    return string
+
+class TestCase(object):
+    def __init__(self, name, swfdata):
+        self.name = name
+        self.swfdata = swfdata
+        self.result = None
+    
+class TestHandler(BaseHTTPRequestHandler):
+    """The HTTP handler class that provides the tests and handles results"""
+
+    def do_GET(self):
+        testcase = self.server.testcase
+        if self.path == "/test.html":
+            data = config.html_page % (testcase.name, testcase.swfdata.width, testcase.swfdata.height)
+            mime = 'text/html'
+        elif self.path == "/test.swf":
+            data = testcase.swfdata.serialize()
+            mime = 'application/x-shockwave-flash'
+        elif self.path == "/crossdomain.xml":
+            data = config.crossdomain_xml
+            mime = 'text/xml'
+        self.serve_data(mime, data)
+        
+    def do_POST(self):
+        if self.path == "/test.result":
+            form = parse_qs(self.rfile.read(int(self.headers['content-length'])))
+            self.server.testcase.result = form['result'][0]
+
+    def serve_data(self, content_type, data):
+        self.send_response(200)
+        self.send_header("Content-type", content_type)
+        self.send_header("Content-length", len(data))
+        self.end_headers()
+        self.wfile.write(data)
+
+class BrowserTest(object):
+    """The browser driver"""
+
+    def start_server(self, port, testcase):
+        server_address = ('', port)
+        self.httpd = HTTPServer(server_address, TestHandler)
+        self.httpd.testcase = testcase
+
+    def get_result(self):
+        testcase = self.httpd.testcase
+        start_time = time.time()
+        while testcase.result is None:
+            if time.time() - start_time > 10:
+                assert False
+            self.httpd.handle_request()
+        return testcase.result
+
+def browsertest(name, swfdata):
+    testcase = TestCase(str(name), swfdata)
+    driver = BrowserTest()
+    driver.start_server(config.http_port, testcase)
+    webbrowser.open('http://localhost:%d/test.html' % config.http_port)
+    
+    return parse_result(driver.get_result())

Added: pypy/branch/avm/pypy/translator/avm2/test/harness.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/harness.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,68 @@
+
+from pypy.translator.avm1 import swf as s, tags as t, records as r
+from pypy.translator.avm2.test import browsertest as b
+from pypy.translator.avm2 import avm2gen as m
+
+class TestHarness(object):
+    def __init__(self, name):
+        self.testname  = name
+        self.swf = s.SwfData()
+        self.swf.add_tag(t.SetBackgroundColor(0x333333))
+        self.swf.add_tag(t.DefineEditText(r.Rect(0, 0, 0, 0), "txt",
+                                          "Testing %s." % (name,), color=r.RGBA(0xFFFFFF)))
+        self.swf.add_tag(t.PlaceObject2(1, 2))
+        self.actions = g.AVM1Gen(t.DoAction())
+        self.swf.add_tag(self.actions.block)
+        self.swf.add_tag(t.ShowFrame())
+        self.swf.add_tag(t.End())
+        self.start_test()
+        
+    def print_text(self, text):
+        self.actions.push_const("txt", "\n" + text)
+        self.actions.push_var("txt")
+        self.actions.swap()
+        self.actions.emit('typed_add')
+        self.actions.set_variable()
+
+    def print_var(self, prefix, varname):
+        self.actions.push_const("txt")
+        self.actions.push_var("txt")
+        self.actions.push_const("\n" + prefix)
+        self.actions.push_var(varname)
+        self.actions.emit('typed_add')
+        self.actions.emit('typed_add')
+        self.actions.set_variable()
+
+    def print_stack(self, prefix):
+        self.actions.push_const("txt")
+        self.actions.swap()
+        self.actions.push_var("txt")
+        self.actions.swap()
+        self.actions.push_const("\n" + prefix)
+        self.actions.swap()
+        self.actions.emit('typed_add')
+        self.actions.emit('typed_add')
+        self.actions.set_variable()
+    
+    def start_test(self):
+        self.print_text("Running test %s." % self.testname)
+        self.actions.push_const("result")
+        
+    def finish_test(self):
+        # result value is on the stack,
+        # followed by the string "result"
+        self.actions.set_variable()
+        self.print_var("Got: ", "result")
+        self.actions.push_const("/test.result", "") # URL, target
+        self.actions.action(a.ActionGetURL2("POST", True, True))
+        self.actions.push_const("javascript:window.close()", "") # Close the window.
+        self.actions.action(a.ActionGetURL2(""))
+
+    def do_test(self, debug=False):
+        self.finish_test()
+        self.actions.scope.block.seal()
+        if debug:
+            f = open("test.swf", "w")
+            f.write(self.swf.serialize())
+            f.close()
+        return b.browsertest(self.testname, self.swf)

Added: pypy/branch/avm/pypy/translator/avm2/test/mylib.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/mylib.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,5 @@
+from pypy.translator.cli.carbonpython import export
+
+ at export(int, int)
+def sum(a, b):
+    return a+b

Added: pypy/branch/avm/pypy/translator/avm2/test/runtest.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/runtest.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,138 @@
+import platform
+
+import py
+from pypy.translator.translator import TranslationContext
+from pypy.rpython.test.tool import BaseRtypingTest, OORtypeMixin
+from pypy.rpython.lltypesystem.lltype import typeOf
+from pypy.rpython.ootypesystem import ootype
+from pypy.annotation.model import lltype_to_annotation
+from pypy.translator.backendopt.all import backend_optimizations
+from pypy.translator.backendopt.checkvirtual import check_virtual_methods
+from pypy.translator.oosupport.support import patch_os, unpatch_os
+from pypy.translator.avm2.test.harness import TestHarness
+from pypy.translator.avm2.genavm import GenAVM1
+
+# def translate_space_op(gen, op):
+#     if op.opname == "cast_int_to_char":
+#         gen.push_arg(op.args[0])
+#         gen.push_const(1)
+#         gen.push_var("String")
+#         gen.call_method("fromCharCode")
+
+def compile_function(func, name, annotation=[], graph=None, backendopt=True,
+                     auto_raise_exc=False, exctrans=False,
+                     annotatorpolicy=None, nowrap=False):
+    olddefs = patch_os()
+    gen = _build_gen(func, annotation, name, graph, backendopt,
+                     exctrans, annotatorpolicy, nowrap)
+    harness = TestHarness(name)
+    gen.ilasm = harness.actions
+    gen.generate_source()
+    unpatch_os(olddefs) # restore original values
+    return gen, harness
+
+def _build_gen(func, annotation, name, graph=None, backendopt=True, exctrans=False,
+               annotatorpolicy=None, nowrap=False):
+    try: 
+        func = func.im_func
+    except AttributeError: 
+        pass
+    t = TranslationContext()
+    if graph is not None:
+        graph.func = func
+        ann = t.buildannotator(policy=annotatorpolicy)
+        inputcells = [ann.typeannotation(an) for an in annotation]
+        ann.build_graph_types(graph, inputcells)
+        t.graphs.insert(0, graph)
+    else:
+        ann = t.buildannotator(policy=annotatorpolicy)
+        ann.build_types(func, annotation)
+
+    t.buildrtyper(type_system="ootype").specialize()
+    if backendopt:
+        check_virtual_methods(ootype.ROOT)
+        backend_optimizations(t)
+    
+    main_graph = t.graphs[0]
+    tmpdir = py.path.local('.')
+    
+    return GenAVM1(tmpdir, t, None, exctrans)
+
+class AVM1Test(BaseRtypingTest, OORtypeMixin):
+    def __init__(self):
+        self._func = None
+        self._ann = None
+        self._genoo = None
+        self._harness = None
+
+    def _compile(self, fn, args, ann=None, backendopt=True, auto_raise_exc=False, exctrans=False):
+        if ann is None:
+            ann = [lltype_to_annotation(typeOf(x)) for x in args]
+        self._genoo, self._harness = compile_function(fn,
+                                                      "%s.%s" % (self.__class__.__name__, fn.func_name),
+                                                      ann,
+                                                      backendopt=backendopt,
+                                                      auto_raise_exc=auto_raise_exc,
+                                                      exctrans=exctrans)
+        self._func = fn
+        self._ann = ann
+        return self._harness
+
+    def _skip_win(self, reason):
+        if platform.system() == 'Windows':
+            py.test.skip('Windows --> %s' % reason)
+
+    def _skip_powerpc(self, reason):
+        if platform.processor() == 'powerpc':
+            py.test.skip('PowerPC --> %s' % reason)
+
+    def _skip_llinterpreter(self, reason, skipLL=True, skipOO=True):
+        pass
+
+    def _get_backendopt(self, backendopt):
+        if backendopt is None:
+            backendopt = getattr(self, 'backendopt', True) # enable it by default
+        return backendopt
+    
+    def interpret(self, fn, args, annotation=None, backendopt=None, exctrans=False):
+        backendopt = self._get_backendopt(backendopt)
+        harness = self._compile(fn, args, annotation, backendopt=backendopt, exctrans=exctrans)
+        harness.actions.call_function_constargs(fn.func_name, *args)
+        result = harness.do_test(True)
+        return result
+    
+    def interpret_raises(self, exception, fn, args, backendopt=None, exctrans=False):
+        import exceptions # needed by eval
+        backendopt = self._get_backendopt(backendopt)
+        try:
+            self.interpret(fn, args, backendopt=backendopt, exctrans=exctrans)
+        except ExceptionWrapper, ex:
+            assert issubclass(eval(ex.class_name), exception)
+        else:
+            assert False, 'function did raise no exception at all'
+
+    float_eq = BaseRtypingTest.float_eq_approx
+
+    def is_of_type(self, x, type_):
+        return True # we can't really test the type
+
+    def ll_to_string(self, s):
+        return s
+
+    def ll_to_unicode(self, s):
+        return s
+
+    def ll_to_list(self, l):
+        return l
+
+    def ll_to_tuple(self, t):
+        return t
+
+    def class_name(self, value):
+        return value.class_name.split(".")[-1] 
+
+    def is_of_instance_type(self, val):
+        return isinstance(val, InstanceWrapper)
+
+    def read_attr(self, obj, name):
+        py.test.skip('read_attr not supported on gencli tests')

Added: pypy/branch/avm/pypy/translator/avm2/test/runtest2.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/runtest2.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,213 @@
+
+import py, re, subprocess
+from pypy.translator.translator import TranslationContext
+from pypy.translator.avm.test.browsertest import browsertest
+# from pypy.translator.backendopt.all import backend_optimizations
+# from pypy.translator.js.js import JS
+# from pypy.translator.js.test.browsertest import jstest
+# from pypy.translator.js import conftest
+#from pypy.translator.js.log import log
+from pypy.conftest import option
+from pypy.rpython.test.tool import BaseRtypingTest, OORtypeMixin
+# from pypy.rlib.nonconst import NonConstant
+# from pypy.rpython.ootypesystem import ootype
+
+from pypy.rpython.llinterp import LLException
+
+log = log.runtest
+
+port = 8080
+
+class AVMException(LLException):
+    pass
+
+#def _CLI_is_on_path():
+#    if py.path.local.sysfind('js') is None:  #we recommend Spidermonkey
+#        return False
+#    return True
+
+class compile_function(object):
+    def __init__(self, function, annotations, stackless=False, view=False, html=None, is_interactive=False, root = None, run_browser = True, policy = None):
+
+        self.html = html
+        self.is_interactive = is_interactive
+        t = TranslationContext()
+        
+        if policy is None:
+            from pypy.annotation.policy import AnnotatorPolicy
+            policy = AnnotatorPolicy()
+            policy.allow_someobjects = False
+
+        ann = t.buildannotator(policy=policy)
+        ann.build_types(function, annotations)
+        if view or option.view:
+            t.view()
+        t.buildrtyper(type_system="ootype").specialize()
+
+        if view or option.view:
+            t.view()
+        #self.js = JS(t, [function, callback_function], stackless)
+        self.js = JS(t, function, stackless)
+        self.js.write_source()
+        if root is None and use_tg:
+            from pypy.translator.js.demo.jsdemo.controllers import Root
+            self.root = Root
+        else:
+            self.root = root
+        self.run_browser = run_browser
+        self.function_calls = []
+    
+    def source(self):
+        return self.js.tmpfile.open().read()
+
+    def _conv(self, v):
+        if isinstance(v, str):
+            return repr(v)
+        return str(v).lower()
+
+    def __call__(self, *kwds):
+        return self.call(None, kwds)
+    
+    def call(self, entry_function, kwds):
+        args = ', '.join([self._conv(kw) for kw in kwds]) #lowerstr for (py)False->(js)false, etc.
+
+        if entry_function is None:
+            entry_function = self.js.translator.graphs[0].name
+        else:
+            entry_function = self.js.translator.annotator.bookkeeper.getdesc(entry_function).cached_graph(None)
+        function_call = "%s(%s)" % (entry_function, args)
+        self.function_calls.append(function_call)
+        #if self.js.stackless:
+        #    function_call = "slp_entry_point('%s')" % function_call
+
+        if use_browsertest:
+            if not use_tg:
+                log("Used html: %r" % self.html)
+                output = browsertest(self.js.filename, function_call)
+            else:
+                global port
+                from pypy.translator.js.test.tgtest import run_tgtest
+                out = run_tgtest(self, tg_root = self.root, port=port, run_browser=self.run_browser).results
+                assert out[1] == 'undefined' or out[1] == ""
+                output = out[0]
+                port += 1
+            return self.reinterpret(output)
+        else:
+#            cmd = 'echo "load(\'%s\'); print(%s)" | js 2>&1' % (self.js.filename, function_call)
+#            log(cmd)
+#            output = os.popen(cmd).read().strip()
+            js = subprocess.Popen(["js"], 
+                                  stdin=subprocess.PIPE,
+                                  stdout=subprocess.PIPE,
+                                  stderr=subprocess.PIPE)
+            input = "load(%r);\n" % self.js.filename.strpath
+            for call in self.function_calls[:-1]:
+                input += "%s;\n" % call
+            input += "print(\"'\" + %s + \"'\");\n" % self.function_calls[-1]
+            js.stdin.write(input)
+            stdout, stderr = js.communicate()
+            output = (stderr + stdout).strip()
+        for s in output.split('\n'):
+            log(s)
+
+        m = re.match("'(.*)'", output, re.DOTALL)
+        if not m:
+            log("Error: %s" % output)
+            raise JSException(output)
+        return self.reinterpret(m.group(1))
+
+    def reinterpret(cls, s):
+        #while s.startswith(" "):
+        #    s = s[1:] # :-) quite inneficient, but who cares
+        if s == 'false':
+            res = False
+        elif s == 'true':
+            res = True
+        elif s == 'undefined':
+            res = None
+        elif s == 'inf':
+            res = 1e300 * 1e300
+        elif s == 'NaN':
+            res = (1e300 * 1e300) / (1e300 * 1e300)
+        elif s.startswith('[') or s.startswith('('):
+            l = s[1:-1].split(',')
+            res = [cls.reinterpret(i) for i in l]
+        else:
+            try:
+                res = float(s)
+                if float(int(res)) == res:
+                    return int(res)
+            except ValueError:
+                res = str(s)
+        return res
+    reinterpret = classmethod(reinterpret)
+
+class JsTest(BaseRtypingTest, OORtypeMixin):
+    def _compile(self, _fn, args, policy=None):
+        argnames = _fn.func_code.co_varnames[:_fn.func_code.co_argcount]
+        func_name = _fn.func_name
+        if func_name == '<lambda>':
+            func_name = 'func'
+        source = py.code.Source("""
+        def %s():
+            from pypy.rlib.nonconst import NonConstant
+            res = _fn(%s)
+            if isinstance(res, type(None)):
+                return None
+            else:
+                return str(res)"""
+        % (func_name, ",".join(["%s=NonConstant(%r)" % (name, i) for
+                                   name, i in zip(argnames, args)])))
+        exec source.compile() in locals()
+        return compile_function(locals()[func_name], [], policy=policy)
+
+    def string_to_ll(self, s):
+        return s
+    
+    def interpret(self, fn, args, policy=None):
+        f = self._compile(fn, args, policy)
+        res = f(*args)
+        return res
+
+    def interpret_raises(self, exception, fn, args):
+        #import exceptions # needed by eval
+        #try:
+        #import pdb; pdb.set_trace()
+        try:
+            res = self.interpret(fn, args)
+        except JSException, e:
+            s = e.args[0]
+            assert s.startswith('uncaught exception:')
+            assert re.search(exception.__name__, s)
+        else:
+            raise AssertionError("Did not raise, returned %s" % res)
+        #except ExceptionWrapper, ex:
+        #    assert issubclass(eval(ex.class_name), exception)
+        #else:
+        #    assert False, 'function did raise no exception at all'
+
+    def ll_to_string(self, s):
+        return str(s)
+
+    def ll_to_list(self, l):
+        return l
+
+    def ll_unpack_tuple(self, t, length):
+        assert len(t) == length
+        return tuple(t)
+
+    def class_name(self, value):
+        return value[:-8].split('.')[-1]
+
+    def is_of_instance_type(self, val):
+        m = re.match("^<.* object>$", val)
+        return bool(m)
+
+    def read_attr(self, obj, name):
+        py.test.skip('read_attr not supported on genjs tests')
+
+def check_source_contains(compiled_function, pattern):
+    import re
+    
+    source = compiled_function.js.tmpfile.open().read()
+    return re.search(pattern, source)

Added: pypy/branch/avm/pypy/translator/avm2/test/simpletest.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/simpletest.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,17 @@
+
+from pypy.translator.avm.swf import SwfData
+from pypy.translator.avm.tags import SetBackgroundColor, DefineShape, End
+from pypy.translator.avm.records import ShapeWithStyle, LineStyle, StraightEdgeRecord, StyleChangeRecord
+
+linestyle = LineStyle(3, 0x000000)
+
+shape = ShapeWithStyle()
+shape.add_line_style(linestyle)
+shape.add_shape_record(StyleChangeRecord(20, 20, linestyle))
+shape.add_shape_record(StraightEdgeRecord(100, 100))
+
+swf = SwfData(400, 300)
+swf.add_tag(SetBackgroundColor(0x333333))
+swf.add_tag(DefineShape(shape))
+swf.add_tag(End())
+print swf.serialize()

Added: pypy/branch/avm/pypy/translator/avm2/test/test_backendopt.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_backendopt.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,7 @@
+import py
+from pypy.translator.cli.test.runtest import compile_function
+from pypy.translator.oosupport.test_template.backendopt import BaseTestOptimizedSwitch
+
+class TestOptimizedSwitch(BaseTestOptimizedSwitch):
+    def getcompiled(self, fn, annotation):
+        return compile_function(fn, annotation, backendopt=True)

Added: pypy/branch/avm/pypy/translator/avm2/test/test_bool.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_bool.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,7 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.rpython.test.test_rbool import BaseTestRbool
+
+class TestCliBool(CliTest, BaseTestRbool):
+    pass
+

Added: pypy/branch/avm/pypy/translator/avm2/test/test_builtin.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_builtin.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,29 @@
+import platform
+import py
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.translator.oosupport.test_template.builtin import BaseTestBuiltin, BaseTestTime
+
+
+def skip_os(self):
+    py.test.skip("CLI doesn't support the os module, yet")
+
+def skip_win():
+    if platform.system() == 'Windows':
+        py.test.skip("Doesn't work on Windows, yet")
+
+class TestCliBuiltin(CliTest, BaseTestBuiltin):
+    test_os_path_exists = skip_os
+    test_os_isdir = skip_os
+    test_os_dup_oo = skip_os
+    test_os_access = skip_os
+        
+    def test_builtin_math_frexp(self):
+        self._skip_powerpc("Mono math floating point problem")
+        BaseTestBuiltin.test_builtin_math_frexp(self)
+
+    def test_debug_llinterpcall(self):
+        py.test.skip("so far, debug_llinterpcall is only used on lltypesystem")
+
+
+class TestCliTime(CliTest, BaseTestTime):
+    pass

Added: pypy/branch/avm/pypy/translator/avm2/test/test_carbonpython.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_carbonpython.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,175 @@
+import py
+py.test.skip("it passes usually, but fails on buildbot, no clue why")
+
+import os
+import os.path
+from pypy.tool import udir
+from pypy.translator.cli.rte import Target
+from pypy.translator.cli.carbonpython import DllDef, export, collect_entrypoints,\
+     collect_class_entrypoints, compile_dll
+from pypy.translator.cli.test.runtest import CliFunctionWrapper, CliTest
+
+TEMPLATE = """
+using System;
+using System.Collections;
+class CarbonPytonTest {
+    public static void Main() {
+        %s
+    }
+}
+"""
+
+class TestCarbonPython(CliTest):
+    
+    def _csharp(self, source, references=[], netmodules=[]):
+        tmpfile = udir.udir.join('tmp.cs')
+        tmpfile.write(TEMPLATE % source)
+        flags = ['/r:%s' % ref for ref in references]
+        flags += ['/addmodule:%s' % mod for mod in netmodules]
+        
+        class MyTarget(Target):
+            SOURCES = [str(tmpfile)]
+            FLAGS = flags
+            OUTPUT = 'tmp.exe'
+            SRC_DIR = str(udir.udir)
+
+        func = CliFunctionWrapper(MyTarget.get())
+        return func()
+
+    def test_compilation(self):
+        res = self._csharp('Console.WriteLine(42);')
+        assert res == 42
+
+    def test_func_namespace(self):
+        def foo(x):
+            return x+1
+        def bar(x):
+            return foo(x)
+        foo._namespace_ = 'MyNamespace.MyClass'
+        bar._namespace_ = 'MyClass'
+        res = self.interpret(bar, [41], backendopt=False)
+        assert res == 42
+
+    def test_simple_functions(self):
+        def foo(x):
+            return x+1
+        def bar(x):
+            return x*2
+        dll = DllDef('test', 'Test', [(foo, [int]),
+                                      (bar, [int])])
+        dll.compile()
+        res = self._csharp('Console.WriteLine("{0}, {1}", Test.foo(42), Test.bar(42));', ['test'])
+        assert res == (43, 84)
+
+    def test_export(self):
+        @export(int, float)
+        def foo(x, y):
+            pass
+        @export(int, float, namespace='test')
+        def bar(x, y):
+            pass
+        @export
+        def baz():
+            pass
+
+        assert foo._inputtypes_ == (int, float)
+        assert not hasattr(foo, '_namespace_')
+        assert bar._inputtypes_ == (int, float)
+        assert bar._namespace_ == 'test'
+        assert baz._inputtypes_ == ()
+
+    def test_collect_entrypoints(self):
+        @export(int, float)
+        def foo(x, y):
+            pass
+        def bar(x, y):
+            pass
+        mydict = dict(foo=foo, bar=bar, x=42)
+        entrypoints = collect_entrypoints(mydict)
+        assert entrypoints == [(foo, (int, float))]
+
+    def test_collect_class_entrypoints(self):
+        class NotExported:
+            def __init__(self):
+                pass
+            
+        class MyClass:
+            @export
+            def __init__(self):
+                pass
+            @export(int)
+            def foo(self, x):
+                return x
+
+        assert collect_class_entrypoints(NotExported) == []
+        entrypoints = collect_class_entrypoints(MyClass)
+        assert len(entrypoints) == 2
+        assert entrypoints[0][1] == () # __init__ inputtypes
+        assert entrypoints[1][1] == (MyClass, int) # foo inputtypes
+        
+    def test_compile_class(self):
+        py.test.skip('This test fails every other day. No clue why :-(')
+        class MyClass:
+            @export(int)
+            def __init__(self, x):
+                self.x = x
+            @export(int, int)
+            def add(self, y, z):
+                return self.x + y + z
+        MyClass.__module__ = 'Test' # put the class in the Test namespace
+
+        entrypoints = collect_entrypoints({'MyClass': MyClass})
+        dll = DllDef('test', 'Test', entrypoints)
+        dll.compile()
+        res = self._csharp("""
+            Test.MyClass obj = new Test.MyClass();
+            obj.__init__(39);
+            Console.WriteLine(obj.add(1, 2));
+        """, ['test'])
+        assert res == 42
+
+    def test_export_cliclass(self):
+        py.test.skip('it fails every other day on builbot, no clue why')
+        from pypy.translator.cli.dotnet import CLR
+        
+        @export(CLR.System.Collections.ArrayList, int)
+        def getitem(obj, i):
+            return obj.get_Item(i)
+
+        entrypoints = collect_entrypoints({'getitem': getitem})
+        dll = DllDef('test', 'Test', entrypoints)
+        dll.compile()
+        res = self._csharp("""
+            ArrayList obj = new ArrayList();
+            obj.Add(42);
+            Console.WriteLine(Test.getitem(obj, 0));
+        """, ['test'])
+        assert res == 42
+
+    def test_compile_dll(self):
+        py.test.skip('This test fails every other day. No clue why :-(')
+        cwd, _ = os.path.split(__file__)
+        mylib_py = os.path.join(cwd, 'mylib.py')
+        compile_dll(mylib_py, copy_dll=False)
+        res = self._csharp("""
+            Console.WriteLine(mylib.sum(20, 22));
+        """, ['mylib'])
+        assert res == 42
+
+    def test_compile_dll_alternative_name(self):
+        cwd, _ = os.path.split(__file__)
+        mylib_py = os.path.join(cwd, 'mylib.py')
+        compile_dll(mylib_py, 'mylibxxx.dll', copy_dll=False)
+        res = self._csharp("""
+            Console.WriteLine(mylibxxx.sum(20, 22));
+        """, ['mylibxxx'])
+        assert res == 42
+
+    def test_compile_netmodule(self):
+        def foo(x):
+            return x+1
+        dll = DllDef('mymodule', 'Test', [(foo, [int])], isnetmodule=True)
+        dll.compile()
+        res = self._csharp('Console.WriteLine("{0}", Test.foo(41));',
+                           netmodules = ['mymodule'])
+        

Added: pypy/branch/avm/pypy/translator/avm2/test/test_cast.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_cast.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,5 @@
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.translator.oosupport.test_template.cast import BaseTestCast
+
+class TestCast(BaseTestCast, CliTest):
+    pass

Added: pypy/branch/avm/pypy/translator/avm2/test/test_class.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_class.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,11 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.translator.oosupport.test_template.class_ import BaseTestClass, BaseTestSpecialcase
+
+# ====> ../../oosupport/test_template/class_.py
+
+class TestCliClass(CliTest, BaseTestClass):    
+    pass
+
+class TestCliSpecialCase(CliTest, BaseTestSpecialcase):
+    pass

Added: pypy/branch/avm/pypy/translator/avm2/test/test_constant.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_constant.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,5 @@
+from pypy.translator.oosupport.test_template.constant import BaseTestConstant
+from pypy.translator.cli.test.runtest import CliTest
+
+class TestConstant(BaseTestConstant, CliTest):
+    pass

Added: pypy/branch/avm/pypy/translator/avm2/test/test_cts.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_cts.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,24 @@
+from pypy.translator.cli import cts
+
+def test_primitive():
+    void = cts.CliPrimitiveType('void')
+    assert str(void) == void.typename() == 'void'
+    assert void == cts.CliPrimitiveType('void')
+
+def test_class():
+    Math = cts.CliClassType('mscorlib', 'System.Math')
+    assert str(Math) == Math.typename() == 'class [mscorlib]System.Math'
+    assert Math.classname() == '[mscorlib]System.Math'
+    assert Math == cts.CliClassType('mscorlib', 'System.Math')
+
+def test_generic():
+    Dict = cts.CliGenericType('mscorlib', 'System.Dict', 2)
+    assert str(Dict) == Dict.typename() == 'class [mscorlib]System.Dict`2<!0, !1>'
+    
+    int32 = cts.CliPrimitiveType('int32')
+    Math = cts.CliClassType('mscorlib', 'System.Math')
+    MyDict = Dict.specialize(int32, Math)
+    assert isinstance(MyDict, cts.CliSpecializedType)
+    classname = '[mscorlib]System.Dict`2<int32, class [mscorlib]System.Math>'
+    assert str(MyDict) == MyDict.typename() == 'class ' + classname
+    assert MyDict.classname() == classname

Added: pypy/branch/avm/pypy/translator/avm2/test/test_dict.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_dict.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,24 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+import pypy.translator.oosupport.test_template.dict as oodict
+
+class TestCliDict(CliTest, oodict.BaseTestDict):
+    def test_dict_of_dict(self):
+        py.test.skip("CLI doesn't support recursive dicts")
+
+    def test_recursive(self):
+        py.test.skip("CLI doesn't support recursive dicts")
+
+    def test_dict_of_void_special_case(self):
+        def fn(n):
+            d = {}
+            for i in xrange(n):
+                d[i] = None
+            return d[0]
+        assert self.interpret(fn, [2]) is None
+
+class TestCliEmptyDict(CliTest, oodict.BaseTestEmptyDict):
+    pass
+
+class TestCliConstantDict(CliTest, oodict.BaseTestConstantDict):
+    pass

Added: pypy/branch/avm/pypy/translator/avm2/test/test_dotnet.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_dotnet.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,711 @@
+import py
+from pypy.annotation.annrpython import RPythonAnnotator
+from pypy.annotation import model as annmodel
+from pypy.rpython.ootypesystem import ootype
+from pypy.rpython.ootypesystem.ootype import meth, Meth, Char, Signed, Float, String,\
+     ROOT, overload, Instance, new
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.translator.cli.dotnet import SomeCliClass, SomeCliStaticMethod,\
+     NativeInstance, CLR, box, unbox, OverloadingResolver, NativeException,\
+     native_exc, new_array, init_array, typeof, eventhandler, clidowncast,\
+     fieldinfo_for_const, classof, cast_record_to_object, cast_object_to_record
+
+System = CLR.System
+ArrayList = CLR.System.Collections.ArrayList
+OpCodes = System.Reflection.Emit.OpCodes
+DynamicMethod = System.Reflection.Emit.DynamicMethod
+Utils = CLR.pypy.runtime.Utils
+FUNCTYPE = ootype.StaticMethod([ootype.Signed, ootype.Signed], ootype.Signed)
+
+class TestDotnetAnnotation(object):
+
+    def test_overloaded_meth_string(self):
+        C = Instance("test", ROOT, {},
+                     {'foo': overload(meth(Meth([Char], Signed)),
+                                      meth(Meth([String], Float)),
+                                      resolver=OverloadingResolver),
+                      'bar': overload(meth(Meth([Signed], Char)),
+                                      meth(Meth([Float], String)),
+                                      resolver=OverloadingResolver)})
+        def fn1():
+            return new(C).foo('a')
+        def fn2():
+            return new(C).foo('aa')
+        def fn3(x):
+            return new(C).bar(x)
+        a = RPythonAnnotator()
+        assert isinstance(a.build_types(fn1, []), annmodel.SomeInteger)
+        assert isinstance(a.build_types(fn2, []), annmodel.SomeFloat)
+        assert isinstance(a.build_types(fn3, [int]), annmodel.SomeChar)
+        assert isinstance(a.build_types(fn3, [float]), annmodel.SomeString)
+
+    def test_class(self):
+        def fn():
+            return System.Math
+        a = RPythonAnnotator()
+        s = a.build_types(fn, [])
+        assert isinstance(s, SomeCliClass)
+        assert s.const is System.Math
+
+    def test_fullname(self):
+        def fn():
+            return CLR.System.Math
+        a = RPythonAnnotator()
+        s = a.build_types(fn, [])
+        assert isinstance(s, SomeCliClass)
+        assert s.const is System.Math
+
+    def test_staticmeth(self):
+        def fn():
+            return System.Math.Abs
+        a = RPythonAnnotator()
+        s = a.build_types(fn, [])
+        assert isinstance(s, SomeCliStaticMethod)
+        assert s.cli_class is System.Math
+        assert s.meth_name == 'Abs'
+
+    def test_staticmeth_call(self):
+        def fn1():
+            return System.Math.Abs(42)
+        def fn2():
+            return System.Math.Abs(42.5)
+        a = RPythonAnnotator()
+        assert type(a.build_types(fn1, [])) is annmodel.SomeInteger
+        assert type(a.build_types(fn2, [])) is annmodel.SomeFloat
+
+    def test_new_instance(self):
+        def fn():
+            return ArrayList()
+        a = RPythonAnnotator()
+        s = a.build_types(fn, [])
+        assert isinstance(s, annmodel.SomeOOInstance)
+        assert isinstance(s.ootype, NativeInstance)
+        assert s.ootype._name == '[mscorlib]System.Collections.ArrayList'
+
+    def test_box(self):
+        def fn():
+            return box(42)
+        a = RPythonAnnotator()
+        s = a.build_types(fn, [])
+        assert isinstance(s, annmodel.SomeOOInstance)
+        assert s.ootype._name == '[mscorlib]System.Object'
+        assert not s.can_be_None
+
+    def test_box_can_be_None(self):
+        def fn(flag):
+            if flag:
+                return box(42)
+            else:
+                return box(None)
+        a = RPythonAnnotator()
+        s = a.build_types(fn, [bool])
+        assert isinstance(s, annmodel.SomeOOInstance)
+        assert s.ootype._name == '[mscorlib]System.Object'
+        assert s.can_be_None
+
+    def test_unbox(self):
+        def fn():
+            x = box(42)
+            return unbox(x, ootype.Signed)
+        a = RPythonAnnotator()
+        s = a.build_types(fn, [])
+        assert isinstance(s, annmodel.SomeInteger)
+
+    def test_unbox_can_be_None(self):
+        class Foo:
+            pass
+        def fn():
+            x = box(42)
+            return unbox(x, Foo)
+        a = RPythonAnnotator()
+        s = a.build_types(fn, [])
+        assert isinstance(s, annmodel.SomeInstance)
+        assert s.can_be_None
+
+    def test_array(self):
+        def fn():
+            x = ArrayList()
+            return x.ToArray()
+        a = RPythonAnnotator()
+        s = a.build_types(fn, [])
+        assert isinstance(s, annmodel.SomeOOInstance)
+        assert s.ootype._isArray
+        assert s.ootype._ELEMENT._name == '[mscorlib]System.Object'
+
+    def test_array_getitem(self):
+        def fn():
+            x = ArrayList().ToArray()
+            return x[0]
+        a = RPythonAnnotator()
+        s = a.build_types(fn, [])
+        assert isinstance(s, annmodel.SomeOOInstance)
+        assert s.ootype._name == '[mscorlib]System.Object'
+
+    def test_mix_None_and_instance(self):
+        def fn(x):
+            if x:
+                return None
+            else:
+                return box(42)
+        a = RPythonAnnotator()
+        s = a.build_types(fn, [bool])
+        assert isinstance(s, annmodel.SomeOOInstance)
+        assert s.can_be_None == True
+
+    def test_box_instance(self):
+        class Foo:
+            pass
+        def fn():
+            return box(Foo())
+        a = RPythonAnnotator()
+        s = a.build_types(fn, [])
+        assert isinstance(s, annmodel.SomeOOInstance)
+        assert s.ootype._name == '[mscorlib]System.Object'
+
+    def test_unbox_instance(self):
+        class Foo:
+            pass
+        def fn():
+            boxed = box(Foo())
+            return unbox(boxed, Foo)
+        a = RPythonAnnotator()
+        s = a.build_types(fn, [])
+        assert isinstance(s, annmodel.SomeInstance)
+        assert s.classdef.name.endswith('Foo')
+
+    def test_can_be_None(self):
+        def fn():
+            ttype = System.Type.GetType('foo')
+            return ttype.get_Namespace()
+        a = RPythonAnnotator()
+        s = a.build_types(fn, [])
+        assert isinstance(s, annmodel.SomeString)
+        assert s.can_be_None
+
+
+class TestDotnetRtyping(CliTest):
+    def _skip_pythonnet(self, msg):
+        pass
+
+    def test_staticmeth_call(self):
+        def fn(x):
+            return System.Math.Abs(x)
+        assert self.interpret(fn, [-42]) == 42
+
+    def test_staticmeth_overload(self):
+        self._skip_pythonnet('Pythonnet bug!')
+        def fn(x, y):
+            return System.Math.Abs(x), System.Math.Abs(y)
+        res = self.interpret(fn, [-42, -42.5])
+        item0, item1 = self.ll_to_tuple(res)
+        assert item0 == 42
+        assert item1 == 42.5
+
+    def test_tostring(self):
+        StringBuilder = CLR.System.Text.StringBuilder
+        def fn():
+            x = StringBuilder()
+            x.Append(box("foo")).Append(box("bar"))
+            return x.ToString()
+        res = self.ll_to_string(self.interpret(fn, []))
+        assert res == 'foobar'
+    
+    def test_box(self):
+        def fn():
+            x = ArrayList()
+            x.Add(box(42))
+            x.Add(box('Foo'))
+            return x.get_Count()
+        assert self.interpret(fn, []) == 2
+
+    def test_whitout_box(self):
+        def fn():
+            x = ArrayList()
+            x.Add(42) # note we have forgot box()
+        py.test.raises(TypeError, self.interpret, fn, [])
+
+    def test_unbox(self):
+        def fn():
+            x = ArrayList()
+            x.Add(box(42))
+            return unbox(x.get_Item(0), ootype.Signed)
+        assert self.interpret(fn, []) == 42
+
+    def test_unbox_string(self):
+        def fn():
+            x = ArrayList()
+            x.Add(box('foo'))
+            return unbox(x.get_Item(0), ootype.String)
+        assert self.interpret(fn, []) == 'foo'
+
+    def test_box_method(self):
+        def fn():
+            x = box(42)
+            t = x.GetType()
+            return t.get_Name()
+        res = self.interpret(fn, [])
+        assert res == 'Int32'
+
+    def test_box_object(self):
+        def fn():
+            return box(System.Object()).ToString()
+        res = self.interpret(fn, [])
+        assert res == 'System.Object'
+
+    def test_array(self):
+        def fn():
+            x = ArrayList()
+            x.Add(box(42))
+            array = x.ToArray()
+            return unbox(array[0], ootype.Signed)
+        assert self.interpret(fn, []) == 42
+
+    def test_new_array(self):
+        def fn():
+            x = new_array(System.Object, 2)
+            x[0] = box(42)
+            x[1] = box(43)
+            return unbox(x[0], ootype.Signed) + unbox(x[1], ootype.Signed)
+        assert self.interpret(fn, []) == 42+43
+
+    def test_init_array(self):
+        def fn():
+            x = init_array(System.Object, box(42), box(43))
+            return unbox(x[0], ootype.Signed) + unbox(x[1], ootype.Signed)
+        assert self.interpret(fn, []) == 42+43
+
+    def test_array_setitem_None(self):
+        py.test.skip('Mono bug :-(')
+        def fn():
+            x = init_array(System.Object, box(42), box(43))
+            x[0] = None
+            return x[0]
+        assert self.interpret(fn, []) is None
+
+    def test_array_length(self):
+        def fn():
+            x = init_array(System.Object, box(42), box(43))
+            return len(x)
+        assert self.interpret(fn, []) == 2
+
+    def test_null(self):
+        def fn():
+            return System.Object.Equals(None, None)
+        assert self.interpret(fn, []) == True
+
+    def test_null_bound_method(self):
+        def fn():
+            x = ArrayList()
+            x.Add(None)
+            return x.get_Item(0)
+        assert self.interpret(fn, []) is None
+
+    def test_native_exception_precise(self):
+        ArgumentOutOfRangeException = NativeException(CLR.System.ArgumentOutOfRangeException)
+        def fn():
+            x = ArrayList()
+            try:
+                x.get_Item(0)
+                return False
+            except ArgumentOutOfRangeException:
+                return True
+        assert self.interpret(fn, []) == True
+
+    def test_native_exception_superclass(self):
+        SystemException = NativeException(CLR.System.Exception)
+        def fn():
+            x = ArrayList()
+            try:
+                x.get_Item(0)
+                return False
+            except SystemException:
+                return True
+        assert self.interpret(fn, []) == True
+
+    def test_native_exception_object(self):
+        SystemException = NativeException(CLR.System.Exception)
+        def fn():
+            x = ArrayList()
+            try:
+                x.get_Item(0)
+                return "Impossible!"
+            except SystemException, e:
+                ex = native_exc(e)
+                return ex.get_Message()
+        res = self.ll_to_string(self.interpret(fn, []))
+        assert res.startswith("Index is less than 0")
+
+    def test_native_exception_invoke(self):
+        TargetInvocationException = NativeException(CLR.System.Reflection.TargetInvocationException)
+        def fn():
+            x = ArrayList()
+            t = x.GetType()
+            meth = t.GetMethod('get_Item')
+            args = init_array(System.Object, box(0))
+            try:
+                meth.Invoke(x, args)
+                return "Impossible!"
+            except TargetInvocationException, e:
+                inner = native_exc(e).get_InnerException()
+                message = str(inner.get_Message())
+                return message
+        res = self.ll_to_string(self.interpret(fn, []))
+        assert res.startswith("Index is less than 0")
+
+    def test_typeof(self):
+        def fn():
+            x = box(42)
+            return x.GetType() ==  typeof(System.Int32)
+        res = self.interpret(fn, [])
+        assert res is True
+
+    def test_typeof_pypylib(self):
+        DelegateType = CLR.pypy.test.DelegateType_int__int_2
+        def fn():
+            return typeof(DelegateType) is not None
+        res = self.interpret(fn, [])
+        assert res is True
+
+    def test_typeof_functype(self):
+        # this test is overridden in TestPythonnet
+        def fn():
+            t = typeof(FUNCTYPE)
+            return t.get_Name()
+        res = self.interpret(fn, [])
+        assert res.startswith('StaticMethod__')
+
+    def test_clidowncast(self):
+        def fn():
+            a = ArrayList()
+            b = ArrayList()
+            a.Add(b)
+            c = a.get_Item(0) # type of c is Object
+            c = clidowncast(c, ArrayList)
+            c.Add(None)
+            return c.get_Item(0)
+        res = self.interpret(fn, [])
+        assert res is None
+
+    def test_clidowncast_lltype(self):
+        ARRAY_LIST = ArrayList._INSTANCE
+        def fn():
+            a = ArrayList()
+            b = ArrayList()
+            a.Add(b)
+            c = a.get_Item(0) # type of c is Object
+            c = clidowncast(c, ARRAY_LIST)
+            c.Add(None)
+            return c.get_Item(0)
+        res = self.interpret(fn, [])
+        assert res is None
+
+    def test_mix_None_and_instance(self):
+        def g(x):
+            return x
+        def fn(flag):
+            if flag:
+                x = None
+            else:
+                x = box(42)
+            return g(x)
+        res = self.interpret(fn, [1])
+        assert res is None
+
+    def test_box_unbox_instance(self):
+        class Foo:
+            pass
+        def fn():
+            obj = Foo()
+            b_obj = box(obj)
+            obj2 = unbox(b_obj, Foo)
+            return obj is obj2
+        res = self.interpret(fn, [])
+        assert res is True
+
+    def test_unbox_instance_fail(self):
+        class Foo:
+            pass
+        def fn():
+            b_obj = box(42)
+            return unbox(b_obj, Foo)
+        res = self.interpret(fn, [])
+        assert res is None
+
+    def test_box_unbox_ooinstance(self):
+        A = ootype.Instance('A', ootype.ROOT, {'xx': ootype.Signed})
+        def fn(flag):
+            a = ootype.new(A)
+            a.xx = 42
+            b_obj = box(a)
+            a2 = unbox(b_obj, A)
+            return a2.xx
+        res = self.interpret(fn, [True])
+        assert res == 42
+
+    def test_box_unbox_ooinstance_fail(self):
+        A = ootype.Instance('A', ootype.ROOT, {'xx': ootype.Signed})
+        def fn(flag):
+            b_obj = System.Object()
+            a2 = unbox(b_obj, A)
+            return a2
+        res = self.interpret(fn, [True])
+        assert res is None
+
+    def test_box_unbox_oorecord(self):
+        A = ootype.Record({'xx': ootype.Signed})
+        def fn(flag):
+            a = ootype.new(A)
+            a.xx = 42
+            b_obj = box(a)
+            a2 = unbox(b_obj, A)
+            return a2.xx
+        res = self.interpret(fn, [True])
+        assert res == 42
+
+    def test_instance_wrapping(self):
+        class Foo:
+            pass
+        def fn():
+            obj = Foo()
+            x = ArrayList()
+            x.Add(box(obj))
+            obj2 = unbox(x.get_Item(0), Foo)
+            return obj is obj2
+        res = self.interpret(fn, [])
+        assert res is True
+
+    def test_compare_string_None(self):
+        from pypy.rlib.nonconst import NonConstant
+        def null():
+            if NonConstant(True):
+                return None
+            else:
+                return ""
+        
+        def fn():
+            ttype = System.Type.GetType('Consts, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
+            namespace = ttype.get_Namespace()
+            if namespace is not None:
+                return False
+            else:
+                return True
+        res = self.interpret(fn, [], backendopt=False)
+        assert res is True
+
+    def test_delegate(self):
+        class Foo:
+            def __init__(self):
+                self.x = 0
+            def m(self, sender, args):
+                self.x = 42
+
+        def fn(flag):
+            f = Foo()
+            if flag:
+                f.m(None, None)
+            delegate = eventhandler(f.m)
+            delegate.Invoke(None, None)
+            return f.x
+        res = self.interpret(fn, [False])
+        assert res == 42
+
+    def test_static_fields(self):
+        DummyClass = CLR.pypy.test.DummyClass
+        def fn():
+            obj = System.Object()
+            DummyClass.myfield = obj
+            return DummyClass.myfield is obj
+        res = self.interpret(fn, [])
+        assert res
+
+    def test_pypylib(self):
+        def fn():
+            return CLR.pypy.runtime.Utils.OOString(42, -1)
+        res = self.interpret(fn, [])
+        assert self.ll_to_string(res) == '42'
+
+    def test_call_delegate(self):
+        def build_fn():
+            tInt = typeof(System.Int32)
+            args = init_array(System.Type, tInt, tInt)
+            meth = Utils.CreateDynamicMethod("add", tInt, args)
+            il = meth.GetILGenerator()
+            il.Emit(OpCodes.Ldarg_0)
+            il.Emit(OpCodes.Ldarg_1)
+            il.Emit(OpCodes.Add)
+            il.Emit(OpCodes.Ret)
+            myfunc = meth.CreateDelegate(typeof(FUNCTYPE))
+            return myfunc
+
+        def fn(x, y):
+            myfunc = unbox(build_fn(), FUNCTYPE)
+            a = myfunc(x, y)
+            mytuple = (x, y)
+            b = myfunc(*mytuple)
+            return a+b
+        res = self.interpret(fn, [10, 11])
+        assert res == 42
+
+    def test_bound_delegate(self):
+        def build_fn():
+            tObjArray = System.Type.GetType("System.Object[]")
+            tInt = typeof(System.Int32)
+            args = init_array(System.Type, tObjArray, tInt, tInt)
+            meth = Utils.CreateDynamicMethod("add", tInt, args)
+            il = meth.GetILGenerator()
+            il.Emit(OpCodes.Ldarg_1)
+            il.Emit(OpCodes.Ldarg_2)
+            il.Emit(OpCodes.Add)
+            il.Emit(OpCodes.Ret)
+            array = new_array(System.Object, 0)
+            myfunc = meth.CreateDelegate(typeof(FUNCTYPE), array)
+            return myfunc
+
+        def fn():
+            myfunc = unbox(build_fn(), FUNCTYPE)
+            return myfunc(30, 12)
+        res = self.interpret(fn, [])
+        assert res == 42
+
+    def test_valuetype_field(self):
+        class Foo:
+            def __init__(self, x):
+                self.x = x
+
+        def fn():
+            f = Foo(OpCodes.Add)
+            return f
+        self.interpret(fn, [])
+
+    def test_fieldinfo_for_const(self):
+        A = ootype.Instance('A', ootype.ROOT, {'xx': ootype.Signed})
+        const = ootype.new(A)
+        const.xx = 42
+        def fn():
+            fieldinfo = fieldinfo_for_const(const)
+            obj = fieldinfo.GetValue(None)
+            # get the 'xx' field by using reflection
+            t = obj.GetType()
+            x_info = t.GetField('xx')
+            x_value = x_info.GetValue(obj)
+            return unbox(x_value, ootype.Signed)
+        res = self.interpret(fn, [])
+        assert res == 42
+
+    def test_fieldinfo_for_const_pbc(self):
+        A = ootype.Instance('A', ootype.ROOT, {'xx': ootype.Signed})
+        const = ootype.new(A)
+        fieldinfo = fieldinfo_for_const(const)
+        def fn():
+            const.xx = 42
+            obj = fieldinfo.GetValue(None)
+            # get the 'xx' field by using reflection
+            t = obj.GetType()
+            x_info = t.GetField('xx')
+            x_value = x_info.GetValue(obj)
+            return unbox(x_value, ootype.Signed)
+        res = self.interpret(fn, [])
+        assert res == 42
+
+    def test_classof(self):
+        int32_class = classof(System.Int32)
+        def fn():
+            int32_obj = box(int32_class)
+            int32_type = clidowncast(int32_obj, System.Type)
+            return int32_type.get_Name()
+        assert self.interpret(fn, []) == 'Int32'
+
+    def test_classof_compare(self):
+        int32_a = classof(System.Int32)
+        int32_b = classof(System.Int32)
+        def fn():
+            return int32_a is int32_b
+        assert self.interpret(fn, [])
+
+    def test_classof_functype(self):
+        # this test is overridden in TestPythonnet
+        c = classof(FUNCTYPE)
+        def fn():
+            obj = box(c)
+            t = clidowncast(obj, System.Type)
+            return t.get_Name()
+        res = self.interpret(fn, [])
+        assert res.startswith('StaticMethod__')
+
+    def test_mix_classof(self):
+        a = classof(System.Int32)
+        b = classof(FUNCTYPE)
+        def fn(flag):
+            if flag:
+                x = a
+            else:
+                x = b
+            return clidowncast(box(x), System.Type).get_Name()
+        res = self.interpret(fn, [True])
+        assert res == 'Int32'
+
+    def test_cast_record(self):
+        T = ootype.Record({'x': ootype.Signed})
+        record = ootype.new(T)
+        def fn(flag):
+            if flag:
+                obj = cast_record_to_object(record)
+            else:
+                obj = System.Object()
+            record2 = cast_object_to_record(T, obj)
+            return record is record2
+        res = self.interpret(fn, [True])
+        assert res
+
+    def test_cast_record_pbc(self):
+        T = ootype.Record({'x': ootype.Signed})
+        record = ootype.new(T)
+        record.x = 42
+        obj = cast_record_to_object(record)
+        def fn():
+            record2 = cast_object_to_record(T, obj)
+            return record is record2
+        res = self.interpret(fn, [])
+        assert res
+
+    def test_cast_record_mix_object(self):
+        T = ootype.Record({'x': ootype.Signed})
+        NULL = ootype.null(System.Object._INSTANCE)
+        record = cast_record_to_object(ootype.new(T))
+        assert record != NULL
+        assert NULL != record
+        
+
+class TestPythonnet(TestDotnetRtyping):
+    # don't interpreter functions but execute them directly through pythonnet
+    def interpret(self, f, args, backendopt='ignored'):
+        return f(*args)
+
+    def _skip_pythonnet(self, msg):
+        py.test.skip(msg)
+
+    def test_whitout_box(self):
+        pass # it makes sense only during translation
+        
+    def test_typeof_functype(self):
+        def fn():
+            t = typeof(FUNCTYPE)
+            return t.get_Name()
+        res = self.interpret(fn, [])
+        assert res == 'DelegateType_int__int_2'
+
+    def test_classof_functype(self):
+        # this test is overridden in TestPythonnet
+        c = classof(FUNCTYPE)
+        def fn():
+            obj = box(c)
+            t = clidowncast(obj, System.Type)
+            return t.get_Name()
+        res = self.interpret(fn, [])
+        assert res == 'DelegateType_int__int_2'
+
+    def test_fieldinfo_for_const(self):
+        pass # it makes sense only during translation
+
+    def test_fieldinfo_for_const_pbc(self):
+        pass # it makes sense only during translation

Added: pypy/branch/avm/pypy/translator/avm2/test/test_exception.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_exception.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,22 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.translator.oosupport.test_template.exception import BaseTestException
+
+class TestCliException(CliTest, BaseTestException):
+    use_exception_transformer = False
+    backendopt = False
+
+    def interpret(self, *args, **kwds):
+        kwds['exctrans'] = self.use_exception_transformer
+        return CliTest.interpret(self, *args, **kwds)
+
+    def test_raise_and_catch_other(self):
+        pass
+
+    def test_raise_prebuilt_and_catch_other(self):
+        pass
+
+
+class TestCliExceptionTransformer(TestCliException):
+    use_exception_transformer = True
+    backendopt = False

Added: pypy/branch/avm/pypy/translator/avm2/test/test_float.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_float.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,26 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.rpython.test.test_rfloat import BaseTestRfloat
+
+class TestCliFloat(CliTest, BaseTestRfloat):
+
+    inf = 'Infinity'
+    minus_inf = '-Infinity'
+    nan = 'NaN'
+
+    def test_parse_float(self):
+        ex = ['', '    ', '0', '1', '-1.5', '1.5E2', '2.5e-1', ' 0 ', '?']
+        def fn(i):
+            s = ex[i]
+            try:
+                return float(s)
+            except ValueError:
+                return -999.0
+        
+        for i in range(len(ex)):
+            expected = fn(i)
+            res = self.interpret(fn, [i])
+            assert res == expected
+
+    def test_r_singlefloat(self):
+        py.test.skip("not implemented: single-precision floats")

Added: pypy/branch/avm/pypy/translator/avm2/test/test_harness.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_harness.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,14 @@
+import autopath
+
+from pypy.translator.avm.test import browsertest, harness as h
+from pypy.translator.avm import avm1 as a
+
+def test_harness():
+    harness = h.TestHarness("harness")
+    harness.start_test("harness")
+    harness.actions.add_action(a.ActionPush(True))
+    harness.finish_test(True)
+    harness.do_test()
+
+if __name__ == "__main__":
+    test_harness()

Added: pypy/branch/avm/pypy/translator/avm2/test/test_int.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_int.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,50 @@
+import autopath
+import py
+from pypy.translator.avm1.test.runtest import AVM1Test
+from pypy.rpython.test.test_rint import BaseTestRint
+from pypy.rlib.rarithmetic import r_longlong
+
+class TestAVM1Int(AVM1Test, BaseTestRint):
+    def test_char_constant(self):
+        def dummyfn(i):
+            return chr(i)
+        _ = self.interpret(dummyfn, [ord(' ')])
+        assert _ == ' '
+        _ = self.interpret(dummyfn, [ord('a')])
+        assert _ == 'a'
+
+    def test_rarithmetic(self):
+        pass # it doesn't make sense here
+
+    div_mod_iteration_count = 20
+    
+    def test_div_mod(self):
+        import random
+
+        for inttype in (int, r_longlong):
+
+            # def d(x, y):
+            #     return x/y
+
+            # for i in range(self.div_mod_iteration_count):
+            #     x = inttype(random.randint(-100000, 100000))
+            #     y = inttype(random.randint(-100000, 100000))
+            #     if not y: continue
+            #     res = self.interpret(d, [x, y])
+            #     print "x:", x, "y:", y, "result in Flash:", res, "result in Python:", d(x, y)
+            #     assert res == d(x, y)
+                
+            def m(x, y):
+                return x%y
+            
+            for i in range(self.div_mod_iteration_count):
+                x = inttype(random.randint(-100000, 100000))
+                y = inttype(random.randint(-100000, 100000))
+                if not y: continue
+                res = self.interpret(m, [x, y])
+                print "x:", x, "y:", y, "result in Flash:", res, "result in Python:", m(x, y)
+                assert res == m(x, y)
+    
+    
+if __name__=="__main__":
+    TestAVM1Int().test_div_mod()

Added: pypy/branch/avm/pypy/translator/avm2/test/test_list.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_list.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,27 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.rpython.test.test_rlist import BaseTestRlist
+from pypy.rlib.rarithmetic import r_uint
+
+class TestCliList(CliTest, BaseTestRlist):
+    def test_recursive(self):
+        py.test.skip("CLI doesn't support recursive lists")
+
+    def test_getitem_exc(self):
+        py.test.skip('fixme!')
+
+    def test_list_unsigned(self):
+        def fn(x):
+            lst = [r_uint(0), r_uint(1)]
+            lst[0] = r_uint(x)
+            return lst[0]
+        res = self.interpret(fn, [42])
+        assert res == 42
+
+    def test_list_bool(self):
+        def fn(x):
+            lst = [True, False]
+            lst[0] = x
+            return lst[0]
+        res = self.interpret(fn, [False])
+        assert res == False

Added: pypy/branch/avm/pypy/translator/avm2/test/test_objectmodel.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_objectmodel.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,10 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.translator.oosupport.test_template.objectmodel import \
+     BaseTestObjectModel
+
+def skip_r_dict(self):
+    py.test.skip('r_dict support is still incomplete')
+
+class TestCliObjectModel(CliTest, BaseTestObjectModel):
+    test_rtype_r_dict_bm = skip_r_dict

Added: pypy/branch/avm/pypy/translator/avm2/test/test_oo.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_oo.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,125 @@
+from pypy.translator.cli.test.runtest import CliTest
+
+class MyClass:
+    INCREMENT = 1
+
+    def __init__(self, x, y):
+        self.x = x
+        self.y = y
+
+    def compute(self):
+        return self.x + self.y
+
+    def compute_and_multiply(self, factor):
+        return self.compute() * factor
+
+    def static_meth(x, y):
+        return x*y
+    static_meth = staticmethod(static_meth)
+
+    def class_attribute(self):
+        return self.x + self.INCREMENT
+
+class MyDerivedClass(MyClass):
+    INCREMENT = 2
+
+    def __init__(self, x, y):
+        MyClass.__init__(self, x+12, y+34)
+
+    def compute(self):
+        return self.x - self.y
+
+
+# helper functions
+def call_method(obj):
+    return obj.compute()
+
+def init_and_compute(cls, x, y):
+    return cls(x, y).compute()
+
+def nonnull_helper(lst):
+    if lst is None:
+        return 1
+    else:
+        return 2
+
+
+class TestOO(CliTest):
+    def test_indirect_call(self):
+        def f():
+            return 1
+        def g():
+            return 2
+        def fn(flag):
+            if flag:
+                x = f
+            else:
+                x = g
+            return x()
+        assert self.interpret(fn, [True]) == 1
+        assert self.interpret(fn, [False]) == 2
+
+    def test_indirect_call_arguments(self):
+        def f(x):
+            return x+1
+        def g(x):
+            return x+2
+        def fn(flag, n):
+            if flag:
+                x = f
+            else:
+                x = g
+            return x(n)
+        assert self.interpret(fn, [True, 42]) == 43
+
+
+    def test_compute(self):
+        def fn(x, y):
+            obj = MyClass(x, y)
+            return obj.compute()
+        assert self.interpret(fn, [42, 13]) == fn(42, 13)
+
+    def test_compute_multiply(self):
+        def fn(x, y):
+            obj = MyClass(x, y)
+            return obj.compute_and_multiply(2)
+        assert self.interpret(fn, [42, 13]) == fn(42, 13)
+        
+    def test_inheritance(self):
+        def fn(x, y):
+            obj = MyDerivedClass(x, y)
+            return obj.compute_and_multiply(2)
+        assert self.interpret(fn, [42, 13]) == fn(42, 13)
+
+    def test_liskov(self):
+        def fn(x, y):
+            base = MyClass(x, y)
+            derived = MyDerivedClass(x, y)
+            return call_method(base) + call_method(derived)
+        assert self.interpret(fn, [42, 13]) == fn(42, 13)
+
+    def test_static_method(self):
+        def fn(x, y):
+            base = MyClass(x, y)
+            derived = MyDerivedClass(x, y)
+            return base.static_meth(x,y) + derived.static_meth(x, y)\
+                   + MyClass.static_meth(x, y) + MyDerivedClass.static_meth(x, y)
+        assert self.interpret(fn, [42, 13]) == fn(42, 13)
+
+    def test_class_attribute(self):
+        def fn(x, y):
+            base = MyClass(x, y)
+            derived = MyDerivedClass(x, y)
+            return base.class_attribute() + derived.class_attribute()
+        assert self.interpret(fn, [42, 13]) == fn(42, 13)
+
+    def test_runtimenew(self):
+        def fn(x, y):
+            return init_and_compute(MyClass, x, y) + init_and_compute(MyDerivedClass, x, y)
+        assert self.interpret(fn, [42, 13]) == fn(42, 13)
+
+    def test_nonnull(self):
+        def fn(x, y):
+            return nonnull_helper([]) + nonnull_helper(None)
+        assert self.interpret(fn, [42, 13]) == fn(42, 13)
+

Added: pypy/branch/avm/pypy/translator/avm2/test/test_op.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_op.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,19 @@
+import sys
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.translator.oosupport.test_template.operations import BaseTestOperations
+from pypy.rlib.rarithmetic import ovfcheck
+
+# ====> ../../oosupport/test_template/operations.py
+
+class TestOperations(CliTest, BaseTestOperations):
+    def test_int_div_overflow(self):
+        import py
+        py.test.skip('fixme!')
+        def fn(x, y):
+            try:
+                return x//y
+            except OverflowError:
+                return 42
+        res = self.interpret(fn, [-sys.maxint-1, -1])
+        assert res == 42
+

Added: pypy/branch/avm/pypy/translator/avm2/test/test_overflow.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_overflow.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,5 @@
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.translator.oosupport.test_template.overflow import BaseTestOverflow
+
+class TestOverflow(BaseTestOverflow, CliTest):
+    pass

Added: pypy/branch/avm/pypy/translator/avm2/test/test_pbc.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_pbc.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,6 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.rpython.test.test_rpbc import BaseTestRPBC
+
+class TestCliPBC(CliTest, BaseTestRPBC):
+    pass

Added: pypy/branch/avm/pypy/translator/avm2/test/test_primitive.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_primitive.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,13 @@
+import os
+import time
+
+from pypy.translator.cli.test.runtest import CliTest
+
+class TestPrimitive(CliTest):
+
+    def test_time_time(self):
+        def fn():
+            return time.time()
+        t1 = self.interpret(fn, [])
+        t2 = self.interpret(fn, [])
+        assert t1 <= t2

Added: pypy/branch/avm/pypy/translator/avm2/test/test_query.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_query.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,39 @@
+import py
+from pypy.translator.cli import query
+from pypy.translator.cli.dotnet import CLR, CliNamespace
+
+def setup_module(module):
+    from pypy.translator.cli.query import load_assembly, mscorlib
+    load_assembly(mscorlib)
+
+def test_load_assembly():
+    query.load_assembly(query.mscorlib)
+    assert 'System.Math' in query.Types
+    assert 'System.Collections.ArrayList' in query.Types
+
+def test_namespaces():
+    assert CLR.System._name == 'System'
+    assert CLR.System.Collections._name == 'System.Collections'
+    py.test.raises(AttributeError, getattr, CLR, 'Foo')
+    py.test.raises(AttributeError, getattr, CLR.System, 'Foo')
+
+def test_CLR_getattr():
+    System = CLR.System
+    assert isinstance(System, CliNamespace)
+    assert System._name == 'System'
+    assert hasattr(CLR, 'System')
+
+def test_static_fields():
+    desc = query.get_class_desc('System.Reflection.Emit.OpCodes')
+    assert ('Add', 'System.Reflection.Emit.OpCode') in desc.StaticFields
+
+def test_System_Object():
+    Object = CLR.System.Object
+    assert Object._name == '[mscorlib]System.Object'
+    assert 'Equals' in Object._static_methods
+    assert 'ToString' in Object._INSTANCE._methods
+
+def test_array():
+    cls = query.get_cli_class('System.Object[]')
+    assert cls._INSTANCE._isArray
+    assert cls._INSTANCE._ELEMENT is CLR.System.Object._INSTANCE

Added: pypy/branch/avm/pypy/translator/avm2/test/test_range.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_range.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,7 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.rpython.test.test_rrange import BaseTestRrange
+
+class TestCliRange(CliTest, BaseTestRrange):
+    def test_rlist_range(self):
+        pass # it doesn't make sense here

Added: pypy/branch/avm/pypy/translator/avm2/test/test_runtest.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_runtest.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,18 @@
+import autopath
+import py
+from pypy.translator.oosupport.test_template.runtest import BaseTestRunTest
+from pypy.translator.avm1.test.runtest import AVM1Test
+
+class TestRunTest(BaseTestRunTest, AVM1Test):
+
+    def test_auto_raise_exc(self):
+        def fn():
+            raise ValueError
+        f = self._compile(fn, [], auto_raise_exc=True)
+        py.test.raises(ValueError, f)
+
+    def test_big_arglist(self):
+        def fn(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9):
+            return a0
+        res = self.interpret(fn, [42]*10)
+        assert res == 42

Added: pypy/branch/avm/pypy/translator/avm2/test/test_snippet.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_snippet.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,47 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.translator.oosupport.test_template.snippets import BaseTestSnippets
+
+class TestSnippets(BaseTestSnippets, CliTest):
+    def test_llshl(self):
+        py.test.skip('llshl currently broken on CLI')
+
+    def test_link_SSA(self):
+        def fn():
+            lst = [42, 43, 44]
+            for i in range(len(lst)):
+                item = lst[i]
+                if i < 10:
+                    lst[i] = item+10
+            return lst
+        res = self.ll_to_list(self.interpret(fn, []))
+        assert res == [52, 53, 54]
+
+    def test_mangle(self):
+        class Foo:
+            def le(self):
+                return 42
+
+        def fn():
+            f = Foo()
+            return f.le()
+        res = self.interpret(fn, [], backendopt=False)
+        
+    def test_link_vars_overlapping(self):
+        from pypy.rlib.rarithmetic import ovfcheck, ovfcheck_lshift
+        def fn(maxofs):
+            lastofs = 0
+            ofs = 1
+            while ofs < maxofs:
+                lastofs = ofs
+                try:
+                    ofs = ovfcheck_lshift(ofs, 1)
+                except OverflowError:
+                    ofs = maxofs
+                else:
+                    ofs = ofs + 1
+            return lastofs
+        res = self.interpret(fn, [64])
+        expected = fn(64)
+        assert res == expected
+        

Added: pypy/branch/avm/pypy/translator/avm2/test/test_streamio.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_streamio.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,28 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.rlib.test.test_streamio import BaseTestBufferingInputStreamTests,\
+     BaseTestBufferingOutputStream, BaseTestLineBufferingOutputStream,\
+     BaseTestCRLFFilter, BaseTestBufferingInputOutputStreamTests,\
+     BaseTestTextInputFilter, BaseTestTextOutputFilter
+
+class TestBufferingInputStreamTests(CliTest, BaseTestBufferingInputStreamTests):
+    pass
+
+class TestBufferingOutputStream(CliTest, BaseTestBufferingOutputStream):
+    pass
+
+class TestLineBufferingOutputStream(CliTest, BaseTestLineBufferingOutputStream):
+    pass
+
+class TestCRLFFilter(CliTest, BaseTestCRLFFilter):
+    pass
+
+class TestBufferingInputOutputStreamTests(CliTest, BaseTestBufferingInputOutputStreamTests):
+    pass
+
+class TestTextInputFilter(CliTest, BaseTestTextInputFilter):
+    pass
+
+class TestTextOutputFilter(CliTest, BaseTestTextOutputFilter):
+    pass
+

Added: pypy/branch/avm/pypy/translator/avm2/test/test_string.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_string.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,40 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+import pypy.translator.oosupport.test_template.string as oostring
+
+class TestCliString(CliTest, oostring.BaseTestString):
+
+    EMPTY_STRING_HASH = 0
+
+    def test_unichar_const(self):
+        py.test.skip("CLI interpret doesn't support unicode for input arguments")
+    test_unichar_eq = test_unichar_const
+    test_unichar_ord = test_unichar_const
+    test_unichar_hash = test_unichar_const
+    test_char_unichar_eq = test_unichar_const
+    test_char_unichar_eq_2 = test_unichar_const
+
+    def test_upper(self):
+        py.test.skip("CLI doens't support backquotes inside string literals")
+    test_lower = test_upper
+
+    def test_hlstr(self):
+        py.test.skip("CLI tests can't have string as input arguments")
+
+    test_inplace_add = test_hlstr
+
+    def test_getitem_exc(self):
+        py.test.skip('fixme!')
+
+    def test_compare(self):
+        strings = ['aa', 'ZZ']
+        def fn(i, j):
+            return strings[i] < strings[j]
+        assert self.interpret(fn, [0, 1], backendopt=False) == fn(0, 1)
+
+    def test_literal_length(self):
+        strings = ['aa', 'a\x01', 'a\x00']
+        def fn():
+            for s in strings:
+                assert len(s) == 2
+        self.interpret(fn, [], backendopt=False)

Added: pypy/branch/avm/pypy/translator/avm2/test/test_tuple.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_tuple.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,12 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.rpython.test.test_rtuple import BaseTestRtuple
+
+class TestCliTuple(CliTest, BaseTestRtuple):
+    def test_builtin_records(self):
+        def fn(x, y):
+            return x, y
+        res = self.interpret(fn, [1.0, 1])
+        assert res.item0 == 1.0 and res.item1 == 1
+        res = self.interpret(fn, [1.0, 1.0])
+        assert res.item0 == 1.0 and res.item1 == 1.0

Added: pypy/branch/avm/pypy/translator/avm2/test/test_unicode.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_unicode.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,23 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.rpython.test.test_runicode import BaseTestRUnicode
+
+# ====> ../../../rpython/test/test_runicode.py
+
+class TestCliUnicode(CliTest, BaseTestRUnicode):
+
+    EMPTY_STRING_HASH = 0
+
+    def test_unichar_const(self):
+        py.test.skip("CLI interpret doesn't support unicode for input arguments")
+    test_unichar_eq = test_unichar_const
+    test_unichar_ord = test_unichar_const
+    test_unichar_hash = test_unichar_const
+    test_char_unichar_eq = test_unichar_const
+    test_char_unichar_eq_2 = test_unichar_const
+
+    def test_getitem_exc(self):
+        py.test.skip('fixme!')
+
+    def test_inplace_add(self):
+        py.test.skip("CLI tests can't have string as input arguments")

Added: pypy/branch/avm/pypy/translator/avm2/test/test_weakref.py
==============================================================================
--- (empty file)
+++ pypy/branch/avm/pypy/translator/avm2/test/test_weakref.py	Wed Nov  4 00:51:35 2009
@@ -0,0 +1,6 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.rpython.test.test_rweakref import BaseTestRweakref
+
+class TestCliWeakRef(CliTest, BaseTestRweakref):
+    pass



More information about the Pypy-commit mailing list