com.flagstone.transform.action
Class GetUrl2

java.lang.Object
  extended by com.flagstone.transform.action.GetUrl2
All Implemented Interfaces:
Action, Copyable<Action>, SWFEncodeable

public final class GetUrl2
extends Object
implements Action

The GetUrl2 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 GetUrl 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.

GetUrl2 gets the URL and the target from the Flash Player 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 target - is either 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.

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 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.


Nested Class Summary
static class GetUrl2.Request
          Request defines the different types of request that can be submitted to a server using a GetUrl action.
 
Constructor Summary
GetUrl2(GetUrl2.Request req)
          Creates a GetUrl2 using the specified request type.
GetUrl2(GetUrl2 object)
          Creates and initialises a GetUrl2 action using the values copied from another GetUrl2 action.
GetUrl2(SWFDecoder coder)
          Creates and initialises a GetUrl2 action using values encoded in the Flash binary format.
 
Method Summary
 GetUrl2 copy()
          Creates a complete copy of this object.
 void encode(SWFEncoder coder, Context context)
          Encode an object to the Flash binary format.
 GetUrl2.Request getRequest()
          Gets the request that will be executed by this action.
 int prepareToEncode(Context context)
          Prepare an object for encoding, returning the expected size of an object when it is encoded.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GetUrl2

public GetUrl2(SWFDecoder coder)
        throws IOException
Creates and initialises a GetUrl2 action using values encoded in the Flash binary format.

Parameters:
coder - an SWFDecoder object that contains the encoded Flash data.
Throws:
IOException - if an error occurs while decoding the data.

GetUrl2

public GetUrl2(GetUrl2.Request req)
Creates a GetUrl2 using the specified request type.

Parameters:
req - the type of request to be performed.

GetUrl2

public GetUrl2(GetUrl2 object)
Creates and initialises a GetUrl2 action using the values copied from another GetUrl2 action.

Parameters:
object - a GetUrl2 action from which the values will be copied.
Method Detail

getRequest

public GetUrl2.Request getRequest()
Gets the request that will be executed by this action.

Returns:
the type of Request that will be performed.

copy

public GetUrl2 copy()
Creates a complete copy of this object.

Specified by:
copy in interface Copyable<Action>
Returns:
a deep-copy of this object. New instances of mutable objects are copied and immutable instances are shared.

toString

public String toString()

Overrides:
toString in class Object

prepareToEncode

public int prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. This method also used to initialise variables, such as offsets and flags that will be used when the object is encoded. Generally the method returns the size in bytes, however when called on objects that use bit fields such as shapes the methods will return the size in bits.

Specified by:
prepareToEncode in interface SWFEncodeable
Parameters:
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Returns:
the size of the object when it is encoded.

encode

public void encode(SWFEncoder coder,
                   Context context)
            throws IOException
Encode an object to the Flash binary format.

Specified by:
encode in interface SWFEncodeable
Parameters:
coder - an SWFEncoder object.
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Throws:
IOException - if an error occurs while encoding the object.


Copyright © 2002-2010 Flagstone Software Ltd.. All Rights Reserved.