com.flagstone.transform.action
Class GetUrl

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

public final class GetUrl
extends Object
implements Action

GetUrl is used to display a web page or load a movie clip into the Flash Player.

In addition to the URL to be loaded, GetUrl also contains a target which is either a level in the Flash Player where the movie clip will be loaded or frame or window in the browser where the web page will be displayed. The following reserved words may be used to identify a specific frame or window in a web browser:

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

To load a movie clip into the currently playing movie then the target is a string literal of the form "_leveln". The Flash Player supports the concept of 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 _level0. Movie clips are loaded into any level above this (1, 2, 3, ...). 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.

See Also:
GetUrl2

Constructor Summary
GetUrl(GetUrl object)
          Creates and initialises a GetUrl action using the values copied from another GetUrl action.
GetUrl(String urlString)
          Creates a GetUrl with the specified url.
GetUrl(String urlString, String targetString)
          Creates a GetUrl with the specified url and target frame.
GetUrl(SWFDecoder coder)
          Creates and initialises a GetUrl action using values encoded in the Flash binary format.
 
Method Summary
 GetUrl copy()
          Creates a complete copy of this object.
 void encode(SWFEncoder coder, Context context)
          Encode an object to the Flash binary format.
 String getTarget()
          Get the name of the target frame where the web page or movie clip will be displayed.
 String getUrl()
          Get the URL from where the web page or movie clip will be loaded.
 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

GetUrl

public GetUrl(SWFDecoder coder)
       throws IOException
Creates and initialises a GetUrl 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.

GetUrl

public GetUrl(String urlString,
              String targetString)
Creates a GetUrl with the specified url and target frame.

Parameters:
urlString - a fully qualified URL. Must not be null.
targetString - the location (in the Flash Player or web browser) where the contents of file retrieved via the url will be displayed. Must not be null.

GetUrl

public GetUrl(String urlString)
Creates a GetUrl with the specified url. The target defaults to the current window.

Parameters:
urlString - a fully qualified URL. Must not be null or an empty string.

GetUrl

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

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

getUrl

public String getUrl()
Get the URL from where the web page or movie clip will be loaded.

Returns:
the URL.

getTarget

public String getTarget()
Get the name of the target frame where the web page or movie clip will be displayed.

Returns:
the name of the target frame.

copy

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