Skip to main content

python-as3toplevel

Do not use version 0.0.3. I forgot to remove the stuff I used for debugging

A python implementation of some of the ActionScript3 toplevel functions and classes. They are as close as I could get them with my knowledge and the very limited documentation that adobe provides.

The types (Array, Boolean, Int, Number, and String) are actual types so you can use them as such. They include almost everything that they did in ActionScript3. The length method in each type can only be used to get the length, I didn't implement the length assignment for Arrays.

Most of the inherited properties would be too hard to implement so I didn't bother with them.

I implemented the type conversion functions inside the types themselves (ex: instead of String(expression) use String.String(expression)).

For functions that needed a placeholder value for input(s) that aren't easily definable, like multiple possible types or they relied on other factors to be set, I use an empty dictionary as a placeholder. The values that these empty dictionaries represent aren't actually dictionaries, I just used something that would never be used in these functions so that I could detect it.

I have no way as of current to test the accuracy of these functions as I can't find a compiler for actionscript that I could get to work so if anything doesn't work or there is undocumented functionality please let me know on the github page.

Currently Implemented


ArgumentError(Error Class)
Array(Function) - Moved to Array.Array()
Array(Data Type)
 Array(Constructor) - Create from values moved to class init function, create to size moved to toSize(Function).
 length(Property) - Moved to length(Function). Length assignment functionality not implemented yet
 concat(Function)
 every(Function)
 filter(Function)
 forEach(Function)
 indexOf(Function)
 insertAt(Function)
 join(Function)
 lastIndexOf(Function)
 map(Function)
 pop(Function)
 push(Function)
 removeAt(Function)
 reverse(Function)
 shift(Function)
 slice(Function)
 some(Function)
 splice(Function)
 toLocaleString(Function)
 toString(Function)
 unshift(Function)
Boolean(Function) - Moved to Boolean.Boolean()
Boolean(Data Type) - Data representation changed from "true" and "false" to "True" and "False"
 Boolean(Constructor) - Moved to class init function
 toString(Function)
 valueOf(Function)
DefinitionError(Error Class)
Error(Error Class)
EvalError(Error Class)
int(Data Type) - Moved to Int
 toExponential(Function)
 toFixed(Function)
isFinite(Function)
isNaN(Function)
valueOf(Function)

Math(Class) - All functions in this class had corresponding functions in python
 E(Constant)
 LN10(Constant)
 LN2(Constant)
 LOG10E(Constant)
 LOG2E(Constant)
 PI(Constant)
 SQRT1_2(Constant)
 SQRT2(Constant)
 abs(Function)
 acos(Function)
 asin(Function)
 atan(Function)
 atan2(Function)
 ceil(Function)
 cos(Function)
 exp(Function)
 floor(Function)
 log(Function)
 max(Function)
 min(Function)
 pow(Function)
 random(Function)
 round(Function)
 sin(Function)
 sqrt(Function)
 tan(Function)
Number(Function) - Moved to Number.Number()
Number(Data Type)
 Number(Constructor) - Moved to class init function
 valueOf(Function)
RangeError(Error Class)
ReferenceError(Error Class)
SecurityError(Error Class)
String(Function) - Moved to String.String()
String(Data Type)
 String(Constructor) - Moved to class init function
 length(Property) - Moved to length(Function)
 charAt(Function)
 charCodeAt(Function)
 concat(Function)
 indexOf(Function)
 lastIndexOf(Function)
 substring(Function)
 toLocaleLowerCase(Function)
 toLocaleUpperCase(Function)
 toLowerCase(Function)
 toUpperCase(Function)
 valueOf(Function)
SyntaxError(Error Class)
TypeError(Error Class)
URIError(Error Class)
VerifyError(Error Class)

Partially Implemented


Date(Data Type)
escape(Function)
Number(Data Type)
 toString(Function)
int(Data Type)
 toString(Function) - Don't know what is supposed to happen when radix is outside of the given range (not documented)
Number(Data Type)
 toExponential(Function)
String(Data Type)
 substr(Function) - Don't know what happens when startIndex is outside of string (not documented)
trace(Function) - Don't know how to accept which file to write to (not documented)
unescape(Function)

Future Plans


Array(Data Type)
 sort(Function)
 sortOn(Function)
Date(Function)
Date(Data Type)
decodeURI(Function)
decodeURIComponent(Function)
encodeURI(Function)
encodeURIComponent(Function)
int(Function)
int(Data Type)
 toPrecision(Function)
RegExp(Data Type)
Number(Data Type)
 toExponential(Function)
 toFixed(Function)
 toPrecision(Function)
 toString(Function)
parseFloat(Function)
parseInt(Function)
String(Data Type)
 localeCompare(Function)
 match(Function)
 replace(Function)
 search(Function)
 slice(Function)
 split(Function)
uint(Function)
uint(Data Type)
Vector(Function)
Vector(Data Type)

Functions I added


listtoarray - converts a given list to an Array. Returns the Array.
Array.toSize - Creates an Array to specified size. If nothing is specified, assumes 0 elements
Dunder methods to relavent data types
escapeFullConvert - converts all characters to URL-encoded format

Metadata

Release files for as3toplevel 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for as3toplevel 0.0.4
File Size Uploaded
as3toplevel-0.0.4.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for as3toplevel 0.0.4
File Interpreter ABI Platform
as3toplevel-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 26.8 kB

Release files / as3toplevel-0.0.4.tar.gz

Download URL as3toplevel-0.0.4.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
414b93d4e93c6eedd8488132d1a1dad3ded7802b2d739189e58b06c8a36251fc
BLAKE2b-256 checksum
How to use checksums
7bec8d23f726f058626ebed7b8dfb99d4374c842b89447254b70d3f3a75540f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release files / as3toplevel-0.0.4-py3-none-any.whl

Download URL as3toplevel-0.0.4-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5951f1d2e8b86174e0328d5e5869b9bf7bcf669f8c5161a055ccf4b82ea4e70
BLAKE2b-256 checksum
How to use checksums
3d8a92842efb78b9309f942087c1e52daf2808c5849b865a667e41713ad68702
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page