V16

PowerSDK Framework V16

COPYRIGHT © 2001-2004 ALL RIGHTS RESERVED

PowerSDK Software Corp. "Code for a distributed world"
PowerSDK Development Site
License

Author Theodore E Patrick
Created May 16, 2003
Modified Sept 25, 2003

Development Notes

Development Notes. This release adds support for auto-depth management. It currently lacks support for legacy MovieClip Class methods as follows

  • attachMovie
  • duplicateMovieClip
  • createEmptyMovieClip
  • createTextField
  • swapDepths
  • removemovieclip
These methods will be replaced with legacy compatible versions. This release also provides simple services via strings to assist with the PSDK:FLOW XML transition. If you are reading this then you see we are supporting generated documentation from comments thanks TwinText! Also look a the samples provided they highlight aspects of the release that provide a simple development metaphor across complex topics.

The current depth implementation supports the following fully

  • Duplicate MCD overwrite based on Path/Name vs based on depth
  • A variable can overwrite a MovieClipDatatype
  • All depths are able to be removed
  • Changine depths does not require a depth parameter
  • getDepth and setDepth provide all depth information
  • attach allows you to add several types of mcd's to stage via linkage id, url or textfeild or emptyMovieClip
  • all attach types support a common interface of a single object argument
  • string properties set functioality, supporting the transition to xml/text based generation
I would really like to push for greater development participation by the developer community. If you have any feedback or questions about powersdk. Please do not hesitiate to ask, no questions are out of bounds. Please make sure to join the developer site at powersdk and sign-up for the list-serve.


Development Site

Thanks & More to come ;)
Ted Patrick

Function.prototype.extend

Extend a function to provide inheritance as a class.

myclass.extend( superClass )

myclass.extend(mySuperClass)
myclass.extend('mySuperClass')

Parameters

superClass - (s,o) class to extend the function

MovieClip.prototype.attach

Attach and MovieClipDatatype (MCD) to another MCD. This method handles move attach cases in Flash and supports adding without specifying depth. Items added with attach can also be overwritten by a variable of the came path.

myMovieClip.attach(attachobject)

myMovieClip.attach({_name:'ted', _id:'window'})
myMovieClip.attach({_name:'ted', _url:'myswf.swf', _class:window})
myMovieClip.attach({_name:'ted', _x:300, _y:100,myNum:23, myObj:{age:1)}}

Parameters

attachObject - defines properties of the attached movieclipDatatype

The attachObject supports the following special properties. All other properties will be added to the attached mcd.

_name - (s) name of the movieclip to be attached
_id - (s) name of the library linkage id to be attached. 'textfield' adds a textfield > requires _x, _y, _height, _width
_url - (s) url of the movie to load. When _url is used, items are added to the mcd on init and will persist loading. see MC.Load!!!
_class - (s,f) class to bind to the MCD. Does not have to inherit from MovieClip (automatic).
_classarguments - (a) arguments array to supply to the class constructor on initialization
_depth - (s)specifies depth setting to add MovieClipDatatype - 'top', 'bottom', 'above:{target}', 'below:{target}'
_depthtarget - (s,mcd)specifies depth target

Return

ref - reference to new movieclip

MovieClip.prototype.attachMovie

Attach a MovieClip - legacy interface.

_root.attachMovie(id, newName, depth [, initObj])

Parameters

id - library Linkage ID
newName - InstanceName for the new Clip
depth - Specifies depth setting to add MovieClipDatatype - 'top', 'bottom', 'above:{target}', 'below:{target}'. Integer input is overridden and added at 'top'

Return

ref - reference to the attached MCD

MovieClip.prototype.createEmptyMovieClip

Attach an empty MovieClip - legacy interface.

_root.createEmptyMovieClip( newName, depth [, initObj])

Parameters

newName - InstanceName for the new Clip
depth - Specifies depth setting to add MovieClipDatatype - 'top', 'bottom', 'above:{target}', 'below:{target}'. Integer input is overridden and added at 'top'
initObj - an initObject is now supported

Return

ref - reference to the attached MCD

MovieClip.prototype.createTextField

Attach a TextField - legacy interface.

_root.createTextField(newName, depth ,x,y,width,height[, initObj])

Parameters

newName - InstanceName for the new Clip
depth - Specifies depth setting to add MovieClipDatatype - 'top', 'bottom', 'above:{target}', 'below:{target}'. Integer input is overridden and added at 'top'
x - x coordinate of the TextField
y - y coordinate of the TextField
width - width of the textfield
height - height of the textfield
initObj - an initObject is now supported

Return

ref - reference to the attached MCD

MovieClip.prototype.duplicateMovieClip

Duplicate an exisitng MovieClip - legacy interface.

_root.duplicateMovieClip(newName, depth [, initObj])

Parameters

newName - InstanceName for the new Clip
depth - Specifies depth setting to add MovieClipDatatype - 'top', 'bottom', 'above:{target}', 'below:{target}'. Integer input is overridden and added at 'top'
initObj - an initObject is now supported

Return

ref - reference to the attached MCD

MovieClip.prototype.extend

Extend a movieclipdatatype to support a class ending in MovieClip. The class is added to the MCD and the end of the proto chain is attached to MovieClip.

a = myMovieClip.extend( c [,ca] )

myMovieClip.extend(myMovieClipClass,)
myMovieClip.extend('myMovieClipClass',['dog','frog',34])

Parameters

c - (s,o) class to extend the movieclip with
ca - (a) contains arguments array to initalize class constructor

MovieClip.prototype.getDepth

Retrieve extended information about movieclip depth.

a = myMovieClip.getDepth(n)

a = myMovieClip.getDepth('top')
b = myMovieClip.getDepth('bottom')
c = myMovieClip.getDepth('all')

if there were 3 mcd's within myMovieClip named > fred,ted,ned listed top to bottom

a = {depth:3,name:'fred',ref:_level0.myMovieClip.fred}
b = {depth:1,name:'ned',ref:_level0.myMovieClip.ned}
c == [
    {depth:3,name:'fred',ref:_level0.myMovieClip.fred},
    {depth:2,name:'ted',ref:_level0.myMovieClip.ted},
    {depth:1,name:'ned',ref:_level0.myMovieClip.ned}
  ]

Parameters

n - specifies information needed options are undefined, 'top', 'bottom', 'all'

Return

data - an object containing depth information as follows
{depth:2, name:"name", ref:{MCD Reference}}

MovieClip.prototype.load

Load a MCD with properties.

a = myMovieClip.load(loadObject)

myMovieClip.load()
myMovieClip.load()
myMovieClip.load()

Parameters

loadObject - defines properties of the loaded movieclipDatatype

The loadObject supports the following special properties. All other properties will be added to the loaded mcd.

_url - (s) url of the movie to load. When _url is used, items are added to the mcd on init and will persist loading. see MC.Load!!!
_class - (s,f) class to bind to the MCD. Does not have to inherit from MovieClip (automatic).
_classarguments - (a) arguments array to supply to the class constructor on initialization

MovieClip.prototype.remove

Removes a MovieclipDatatype added with attach. Used to remove special properties added via attach

myMovieClip.remove()

MovieClip.prototype.removeMovieClip

remove a MovieClip - legacy interface.

{{_root.dog.removeMovieClip()

MovieClip.prototype.setDepth

Used to position a MovieClipDatatype via the z(depth) axis.

myMovieClip.setDepth(pos[,tar])

myMovieClip.setDepth('top')
myMovieClip.setDepth('bottom')
myMovieClip.setDepth('above',fred)
myMovieClip.setDepth('above','fred')
myMovieClip.setDepth('below',fred)
myMovieClip.setDepth('below','fred')
myMovieClip.setDepth('swap',fred)
myMovieClip.setDepth('swap','fred')

Parameters

pos - (string)position command options 'top', 'bottom', 'above', 'below', 'swap'
tar - (string or reference) target for the position commands 'above', 'below','swap'

Object.prototype.apply

Apply the contents of an object to another object.

a.apply( target )

a = {}
b = {age:23,mc:MovieClip,s_name:'myStringahhhh'}
a.apply(b)

a == {age:23,mc:MovieClip,s_name:'myStringahhhh'}

Parameters

target - target from which properties are applied

PSDK.addPath

PSDK.addPath(
name,
overwrite,
delete,
hidden)
Provides path creation and protection of path objects

PSDK.addPath(name, overwrite, delete, hidden)

Parameters

name - (s) full pathname desired
overwrite - (b) flag protects from overwrite
method - (b) flag protects from delete
error - (b) flag hides contents

PSDK.exemption

PSDK.exemption(
[instance,
args,
method,
error,
kill])
Provides error handling within ActionScript

PSDK.exemption([instance, args, method, error, kill])

Parameters

instance - (o) the object in context of the called method, or this
args - (a) argument array within the callee function
method - (s) the path to the method
error - (s) error message
kill - (b) true unloads everything > "crash early" support

PSDK.protect

PSDK.protect(
overwrite,
delete,
hidden)
Modifies status of protection

PSDK.protect(overwrite, delete, hidden)

Parameters

overwrite - (b) flag protects from overwrite
method - (b) flag protects from delete
error - (b) flag hides contents

Created with TwinText