Adobe® Flex® 4 Language Reference
Show Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
com.adobe.viewsource 
ViewSource 
Packagecom.adobe.viewsource
Classpublic class ViewSource
InheritanceViewSource Inheritance Object

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The ViewSource class adds support for the "View Source" context menu item. If you set the viewSourceURL property of the application container to the URL of your source code, the user can view the source code by selecting the "View Source" context menu item.

See also



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined By
  
addMenuItem(obj:InteractiveObject, url:String, hideBuiltIns:Boolean = true):void
[static] Adds a "View Source" context menu item to the context menu of the given object.
ViewSource
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Method Detail

addMenuItem

()method
public static function addMenuItem(obj:InteractiveObject, url:String, hideBuiltIns:Boolean = true):void

Adds a "View Source" context menu item to the context menu of the given object. Creates a context menu if none exists.

Parameters

obj:InteractiveObject — The object to attach the context menu item to.
 
url:String — The URL of the source viewer that the "View Source" item should open in the browser.
 
hideBuiltIns:Boolean (default = true) — Optional, defaults to true. If true, and no existing context menu is attached to the given item, then when we create the context menu, we hide all the hideable built-in menu items.