|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.FSTransformObject
com.flagstone.transform.FSActionObject
com.flagstone.transform.FSGetUrl2
public class FSGetUrl2
The FSGetUrl2 action is used to either load a web page or movie clip or load or submit variable values to/from a server.
It extends the functionality provided by the FSGetUrl action by allowing the variables defined in a movie to be submitted as form values to a server. Variables defined in a movie can also be initialised by loading a file containing variable name / value assignments.
Attributes | |
---|---|
type | Identifies the action when it is encoded. Read-only. |
requestType | The type of request generated by the action. |
FSGetUrl2 is a stack-based action, however the type of request being submitted to the server is defined by the requestType attribute. Two arguments, url and target/level are popped from the stack. The url is the first argument popped from the stack and is a fully qualified uniform resource location where the movie clip or web page will be retrieved from. The second argument is either a target - the name of a specific movie clip, e.g. _root.movieClip or the name of a level in the main movie into which a movie clip has been loaded, e.g. _level1.
Request Types
The request type is specified as an
attribute of the FSGetUrl2 action. Whether a new web page, movie clip or
variable values are loaded is specified by the following types of request:
Type of Request | Description |
---|---|
MovieToLevel | Load a movie to the specified level. |
MovieToLevelWithGet | Load a movie submitting the movie variables using the HTTP GET method. |
MovieToLevelWithPost | Load a movie submitting the movie variables using the HTTP POST method. |
MovieToTarget | Load a new Flash movie or web page to the specified target. |
MovieToTargetWithGet | Load a new Flash movie or web page to the specified target, submitting the movie variables using the HTTP GET method. |
MovieToTargetWithPost | Load a new Flash movie or web page to the specified target, submitting the movie variables using the HTTP POST method. |
VariablesToLevel | Load values for selected movie variables to the specified level. |
VariablesToLevelWithGet | Load values for selected movie variables to the specified level, submitting the movie variables using the HTTP GET method. |
VariablesToLevelWithPost | Load values for selected movie variables to the specified level, submitting the movie variables using the HTTP POST method. |
VariablesToTarget | Load values for selected movie variables to the specified level. |
VariablesToTargetWithGet | Load values for selected movie variables to the specified target, submitting the movie variables using the HTTP GET method. |
VariablesToTargetWithPost | Load values for selected movie variables to the specified target, submitting the movie variables using the HTTP POST method. |
When variables are submitted they are encoded using standard x-www-urlencoded encoding.
Targets
The target can either be the name of the frame
can be one of the following reserved words:
"name"
opens the new page in the frame with the name
defined in the HTML <frame> tag._blank
opens the new page in a new window._self
opens the new page in the current window._top
opens the new page in the top level frame of the
current window._parent
opens the new page in the parent frame of the
frame where the Flash Player id displayed.""
(blank string) opens the new page in the current frame
or window.
Levels
Levels are virtual layers (analogous to the layers in
the Display List). Higher levels are displayed in front of lower levels. The
background of each level is transparent allowing movie clips on lower levels
to be visible in areas not filled by the movie clip on a given level. The
main movie is loaded into level 0. Movie clips are loaded into any level
above this (1, 2, 124, etc.). If a movie clip is loaded into a level that
already contains a movie clip then the existing clip is replaced by the new
one. The level follows the general form: "_leveln" loads a movie
clip into the current movie at level n.
Display a movie in the named frame:
FSDoAction frameActions = new FSDoAction(); // Push the target followed by the url frameActions.add(new FSPush("http://www.server.com/movie.swf")); frameActions.add(new FSPush("aFrame")); frameActions.add(new FSGetUrl2(FSGetUrl2.MovieToTarget));
Load a movie clip into the current movie at level 1:
frameActions.add(new FSPush("http://www.server.com/movieClip.swf")); frameActions.add(new FSPush("_level1")); frameActions.add(new FSGetUrl2(FSGetUrl2.MovieToLevel));
Submit the value of a variable as an argument to a server script:
// Set the variable frameActions.add(new FSPush("MyVariable")); frameActions.add(new FSPush(23)); frameActions.add(FSAction.SetVariable()); // Submit it to the server script frameActions.add(new FSPush("http://www.server.com/cgi-bin/form.php")); frameActions.add(new FSPush("")); frameActions.add(new FSGetUrl2(FSGetUrl2.VariablesToTargetWithPost));
Initialise the variables in a movie clip using name/value pairs returned from a server script:
// Specify the level where the movie clip is loaded. frameActions.add(new FSPush("http://www.server.com/cgi-bin/form.php")); frameActions.add(new FSPush("_level1")); frameActions.add(new FSGetUrl2(FSGetUrl2.VariablesToLevelWithGet));
The FSGetUrl2 is a class for representing the ActionGetUrl2 action of the Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 4.
Field Summary | |
---|---|
static int |
MovieToLevel
Load a movie without submitting the movie variables. |
static int |
MovieToLevelWithGet
Load a movie submitting the movie variables using HTTP GET. |
static int |
MovieToLevelWithPost
Load a movie submitting the movie variables using HTTP POST. |
static int |
MovieToTarget
Load a movie or web page without submitting the movie variables. |
static int |
MovieToTargetWithGet
Load a movie or web page submitting the movie variables using HTTP GET. |
static int |
MovieToTargetWithPost
Load a movie or web page submitting the movie variables using HTTP POST. |
static int |
VariablesToLevel
Load variables without submitting the movie variables. |
static int |
VariablesToLevelWithGet
Load variables submitting the movie variables using HTTP GET. |
static int |
VariablesToLevelWithPost
Load variables submitting the movie variables using HTTP POST. |
static int |
VariablesToTarget
Load variables without submitting the movie variables. |
static int |
VariablesToTargetWithGet
Load variables submitting the movie variables using HTTP GET. |
static int |
VariablesToTargetWithPost
Load variables submitting the movie variables using HTTP POST. |
Fields inherited from class com.flagstone.transform.FSActionObject |
---|
Call, ExceptionHandler, GetUrl, GetUrl2, GotoFrame, GotoFrame2, GotoLabel, If, Jump, length, NewFunction, NewFunction2, Push, RegisterCopy, SetTarget, Table, type, WaitForFrame, WaitForFrame2, With |
Constructor Summary | |
---|---|
FSGetUrl2(FSCoder coder)
Construct an FSGetUrl2 object, initialising it with values decoded from an encoded object. |
|
FSGetUrl2(FSGetUrl2 obj)
Constructs an FSGetUrl2 object by copying values from an existing object. |
|
FSGetUrl2(int aType)
Constructs an FSGetUrl2 using the specified request type. |
Method Summary | |
---|---|
void |
appendDescription(java.lang.StringBuffer buffer,
int depth)
AppendDescription is used to present a string description of the object including all nested objects up to a specified depth. |
void |
decode(FSCoder coder)
|
void |
encode(FSCoder coder)
|
boolean |
equals(java.lang.Object anObject)
Returns true if anObject is equal to this one. |
int |
getRequestType()
Gets the request type. |
int |
length(FSCoder coder)
|
void |
setRequestType(int aType)
Sets the request type. |
Methods inherited from class com.flagstone.transform.FSActionObject |
---|
getType, length |
Methods inherited from class com.flagstone.transform.FSTransformObject |
---|
clone, name, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MovieToLevel
public static final int MovieToLevelWithGet
public static final int MovieToLevelWithPost
public static final int MovieToTarget
public static final int MovieToTargetWithGet
public static final int MovieToTargetWithPost
public static final int VariablesToLevel
public static final int VariablesToLevelWithGet
public static final int VariablesToLevelWithPost
public static final int VariablesToTarget
public static final int VariablesToTargetWithGet
public static final int VariablesToTargetWithPost
Constructor Detail |
---|
public FSGetUrl2(FSCoder coder)
coder
- an FSCoder containing the binary data.public FSGetUrl2(int aType)
aType
- the type of request to be performed. Must be one of the
constants defined in this class.public FSGetUrl2(FSGetUrl2 obj)
obj
- an FSGetUrl2 object.Method Detail |
---|
public int getRequestType()
public void setRequestType(int aType)
aType
- the type of request to be performed. Must be one of the
constants defined in this class.public boolean equals(java.lang.Object anObject)
FSActionObject
equals
in class FSActionObject
public void appendDescription(java.lang.StringBuffer buffer, int depth)
FSTransformObject
appendDescription
in class FSTransformObject
buffer
- a StringBuffer to which the description of each object is
appended.depth
- the maximum level of nesting up to which objects will be
displayed.public int length(FSCoder coder)
length
in class FSActionObject
public void encode(FSCoder coder)
encode
in class FSActionObject
public void decode(FSCoder coder)
decode
in class FSActionObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |