Arul's Blog On Multimedia, Flash MX, Director And Dreamweaver MX
Recent Entries | Guest Book | QuickView | XML-RSS feed | My Profile | Home
::: About this Blog :::
Welcome to Arul's Blog!
Weblog on Multimedia,
Macromedia Flash MX Flash MX
Macromedia Director Shockwave Studio 8.51 Director
Macromedia Dreamweaver MX Dreamweaver MX
View my profile And me :)
Here I'm going to share my views, opinions and code with you all.

::: Services :::

:. ActionScript Highlighting
:. AS Highlighter v2 new!


::: ActionScript :::
:. toString
:. skipCache
:. getWords
:. getDateFromString
:. colorUtils
:. XMLNode-transformTags
:. Object-copyProperties
:. Object-clone

::: ActionScript 2 :::
:. XMLHighlighter
:. PriorityQueue

::: Archives :::
[September 2002]
[October 2002]
[November 2002]
[December 2002]
[January 2003]
[February 2003]
[March 2003]
[April 2003]
[May 2003]
[June 2003]
[July 2003]
[September 2003]
[October 2003]
[December 2003]
[January 2004]
[February 2004]
[March 2004]
[April 2004]
[May 2004]
[June 2004]
[July 2004]
[December 2004]
[January 2005]
[February 2005]
[March 2005]
[May 2005]
[June 2005]
[July 2005]
[August 2005]
[June 2006]
[July 2006]
[November 2006]
[December 2006]
[January 2007]

::: Time Zone :::
All Times on this blog are
GMT + 5:30 Hours
(Indian Standard Time)

::: Flash Resources :::
:. Flash Components
:. Were-Here Forum
:. Digital Illusion
:. Flashmove Forum
:. Flash Goddess
:. Prototypes
:. Actionscript Toolbox
:. UltraShock
:. Chattyfig
:. Full as a Goog
:. Flog

::: Flashers :::
:. Mike Chambers
:. Greg Burch
:. Branden Hall
:. Samuel Wan
:. Stuart Schoneveld
:. Guy Watson
:. Robin Debreuil
:. Mario Klingemann
:. Moises
:. Aral Balkan
:. Peter Hall
:. Josh Dura
:. Alessandro
:. Brajeshwar
:. Nik Khilnani

::: Small Print :::

© Copyright 2002
R.Arul Kumaran

[Made with Blogger]


Monday, September 29, 2003

Tips.Flash MX: Compiled components and Actionscript Viewer version 4.

With Flash MX 2004 we can create and use Compiled components so source need not be distributed. It is good for many component developers because they need not worry about exposing their code. But when you produce your swf with the component, everything is byte code and can be translated back to Actionscript by the tools like ActionScript Viewer.

Compiled components has the extension "swc" and the same extension is used for the Flash Elements in Dreamweaver MX 2004. While trying to open one such file with Burak's ActionScript Viewer, I got a prompt which says, "Select SWF file. Following swf candidates are found in the file " It showed the swf file inside and I could see all the actionscript there. (Great Job Burak! Also I recommend you to use the style I use for displaying objects in my latest ActionScript tracing function it is more readable.) From that I got a clue that .swc contains an .swf file embedded inside. Then I did a funny thing! I just renamed the file to have .zip instead of .swc then......

Wow! I could see all the files inside, there is an "catalog.xml" which has the info about all the files included and then an .swf and a .png file for the icon in the library and many files with the extension "asi". I opened those files in notepad and found them to be actionscript files with class definition.

to conclude, now compiled components made it a bit tough to see the source code; that's all. Now burak started with decompiling the swf to FLA using the JavaScript API provided by the Flash 2004 IDE. Even though it is in the preliminary stage now, it may be improved and perfected in the days to come. We developers have to wait for some obfuscator to come to protect our code to some extent. I'm waiting for Robin Debreuil to come up with one.

posted by Arul | link | ^top | next> | comments [2]
Sunday, September 28, 2003

Examples.Flash MX: Comparing components version 1 and 2: PushButton.

The purpose of showing this is two fold. One is to show difference in the properties and methods exposed by the Push Button component in V1 and V2. Second is to show case how easy and useful it is to use my ActionScript() function to see what's inside a component.

I just dragged and dropped a push button on stage and named it as "_btn" then used the following code to trace.
#include "toString.as"
//
trace(ActionScript(_btn,"Button_v1"));
// use trace(ActionScript(_btn,"Button_v2")); for V2 button
Here is the result!
Button_v1 = {
        EVENT_OBJECT_NAMECHANGE:32780,
        EVENT_OBJECT_STATECHANGE:32778,
        STATE_SYSTEM_PRESSED:8,
        ROLE_SYSTEM_PUSHBUTTON:43,
        togy:1.95,
        togx:4,
        inity:0.95,
        initx:3,
        incrVal:1,
        hitArea:_root._btn.fpb_hitArea_mc,
        enabled:true,
        handlerObj:_root,
        btnState:false,
        keyListener:{},
        methodTable:{},
        tabFocused:true,
        tabChildren:false,
        focusEnabled:true,
        tabEnabled:true,
        styleTable:[],
        _accImpl:{
                stub:false
        },
        useHandCursor:false,
        focused:false,
        enable:true,
        textStyle:{
                bullet:null,
                tabStops:null,
                blockIndent:null,
                leading:null,
                indent:null,
                rightMargin:1,
                leftMargin:1,
                align:"center",
                underline:null,
                italic:null,
                bold:null,
                target:null,
                url:null,
                color:null,
                size:null,
                font:null
        },
        height:20,
        width:100,
        clickHandler:"",
        label:"Push Button",
        fpb_hitArea_mc:_root._btn.fpb_hitArea_mc,
        fLabel_mc:_root._btn.fLabel_mc,
        fpbState_mc:_root._btn.fpbState_mc,
        deadPreview:_root._btn.deadPreview,
        boundingBox_mc:_root._btn.boundingBox_mc
}
Button_v1.registerSkinElement = function(){
}
Button_v1.setStyleProperty = function(){
}
Button_v1.updateStyleProperty = function(){
}
Button_v1.myOnKillFocus = function(){
}
Button_v1.drawFocusRect = function(){
}
Button_v1.pressFocus = function(){
}
Button_v1.drawRect = function(){
}
Button_v1.cleanUINotSize = function(){
}
Button_v1.cleanUI = function(){
}
Button_v1.invalidate = function(){
}
Button_v1.setChangeHandler = function(){
}
Button_v1.accDoDefaultAction = function(){
}
Button_v1.get_accDefaultAction = function(){
}
Button_v1.get_accState = function(){
}
Button_v1.get_accName = function(){
}
Button_v1.get_accRole = function(){
}
Button_v1.myOnKeyUp = function(){
}
Button_v1.myOnKeyDown = function(){
}
Button_v1.onDragOver = function(){
}
Button_v1.onDragOut = function(){
}
Button_v1.onReleaseOutside = function(){
}
Button_v1.onRollOut = function(){
}
Button_v1.onRollOver = function(){
}
Button_v1.onRelease = function(){
}
Button_v1.onPress = function(){
}
Button_v1.myOnSetFocus = function(){
}
Button_v1.getBtnState = function(){
}
Button_v1.setBtnState = function(){
}
Button_v1.initContentPos = function(){
}
Button_v1.executeCallBack = function(){
}
Button_v1.setClickHandler = function(){
}
Button_v1.drawFrame = function(){
}
Button_v1.txtFormat = function(){
}
Button_v1.setEnabled = function(){
}
Button_v1.getEnabled = function(){
}
Button_v1.setLabel = function(){
}
Button_v1.getLabel = function(){
}
Button_v1.arrangeLabel = function(){
}
Button_v1.setSize = function(){
}
Button_v1.setHitArea = function(){
}
Button_v1.init = function(){
}
Button_v1.keyListener.onKeyUp = function(){
}
Button_v1.keyListener.onKeyDown = function(){
}
Button_v1.keyListener.controller = Button_v1;
Button_v1._accImpl.accDoDefaultAction = function(){
}
Button_v1._accImpl.get_accDefaultAction = function(){
}
Button_v1._accImpl.get_accState = function(){
}
Button_v1._accImpl.get_accName = function(){
}
Button_v1._accImpl.get_accRole = function(){
}
Button_v1._accImpl.master = Button_v1;
Button_v1.textStyle.getTextExtent = function(){
}
Button_v2 = {
        getTopLevel:undefined,
        embedFonts:undefined,
        textDecoration:undefined,
        fontSize:undefined,
        marginRight:undefined,
        marginLeft:undefined,
        fontStyle:undefined,
        textIndent:undefined,
        fontFamily:undefined,
        fontWeight:undefined,
        textAlign:undefined,
        childrenCreated:true,
        rolloverIcon:"falseUpIcon",
        useHandCursor:false,
        stylecache:{},
        __height:22,
        __width:100,
        _minWidth:0,
        _minHeight:0,
        enabled:true,
        __toggle:false,
        __labelPlacement:"right",
        invalidateFlag:true,
        tfList:{
                labelPath:{
                        styleSheet:undefined,
                        mouseWheelEnabled:true,
                        condenseWhite:false,
                        restrict:null,
                        textHeight:0,
                        textWidth:0,
                        bottomScroll:1,
                        length:0,
                        selectable:true,
                        multiline:false,
                        password:false,
                        wordWrap:false,
                        background:false,
                        border:false,
                        html:false,
                        embedFonts:false,
                        maxChars:null,
                        maxhscroll:0,
                        hscroll:0,
                        variable:null,
                        htmlText:"",
                        type:"dynamic",
                        text:"",
                        autoSize:"none",
                        tabIndex:undefined,
                        textColor:0,
                        backgroundColor:16777215,
                        borderColor:0,
                        maxscroll:1,
                        scroll:1,
                        value:"",
                        enabled:undefined,
                        visible:false,
                        bottom:NaN,
                        right:NaN,
                        y:0,
                        top:0,
                        x:0,
                        left:0,
                        height:5,
                        width:5,
                        invalidateFlag:true,
                        __text:"Button",
                        _color:{
                                color:1,
                                disabledColor:1
                        }
                }
        },
        labelPath:{
                styleSheet:undefined,
                mouseWheelEnabled:true,
                condenseWhite:false,
                restrict:null,
                textHeight:0,
                textWidth:0,
                bottomScroll:1,
                length:0,
                selectable:true,
                multiline:false,
                password:false,
                wordWrap:false,
                background:false,
                border:false,
                html:false,
                embedFonts:false,
                maxChars:null,
                maxhscroll:0,
                hscroll:0,
                variable:null,
                htmlText:"",
                type:"dynamic",
                text:"",
                autoSize:"none",
                tabIndex:undefined,
                textColor:0,
                backgroundColor:16777215,
                borderColor:0,
                maxscroll:1,
                scroll:1,
                value:"",
                enabled:undefined,
                visible:false,
                bottom:NaN,
                right:NaN,
                y:0,
                top:0,
                x:0,
                left:0,
                height:5,
                width:5,
                invalidateFlag:true,
                __text:"Button",
                _color:{
                        color:1,
                        disabledColor:1
                }
        },
        boundingBox_mc:_root._btn.boundingBox_mc
}
Button_v2.setStyle = function(){
}
Button_v2.notifyStyleChangeInChildren = function(){
}
Button_v2.changeColorStyleInChildren = function(){
}
Button_v2.changeTextStyleInChildren = function(){
}
Button_v2.buildDepthTable = function(){
}
Button_v2.getDepthByFlag = function(){
}
Button_v2.shuffleDepths = function(){
}
Button_v2.findNextAvailableDepth = function(){
}
Button_v2.setDepthBelow = function(){
}
Button_v2.setDepthAbove = function(){
}
Button_v2.setDepthTo = function(){
}
Button_v2.createChildAtDepth = function(){
}
Button_v2.createClassChildAtDepth = function(){
}
Button_v2.getStyle = function(){
}
Button_v2.getStyleName = function(){
}
Button_v2._getTextFormat = function(){
}
Button_v2.__getTextFormat = function(){
}
Button_v2.destroyObject = function(){
}
Button_v2.createEmptyObject = function(){
}
Button_v2.createClassObject = function(){
}
Button_v2.createObject = function(){
}
Button_v2.createLabel = function(){
}
Button_v2.drawRoundRect = function(){
}
Button_v2.dispatchQueue = function(){
}
Button_v2.dispatchEvent = function(){
}
Button_v2.removeEventListener = function(){
}
Button_v2.__origAddEventListener = function(){
}
Button_v2.addEventListener = function(){
}
Button_v2.adjustFocusRect = function(){
}
Button_v2.drawFocus = function(){
}
Button_v2.onEnterFrame = function(){
}
Button_v2.tfList.labelPath.getFocusManager = function(){
}
Button_v2.tfList.labelPath.onKillFocus = function(){
}
Button_v2.tfList.labelPath.onSetFocus = function(){
}
Button_v2.tfList.labelPath.setFocus = function(){
}
Button_v2.tfList.labelPath.changeTextStyleInChildren = function(){
}
Button_v2.tfList.labelPath.setStyle = function(){
}
Button_v2.tfList.labelPath.adjustFocusRect = function(){
}
Button_v2.tfList.labelPath.drawFocus = function(){
}
Button_v2.tfList.labelPath.getPreferredHeight = function(){
}
Button_v2.tfList.labelPath.getPreferredWidth = function(){
}
Button_v2.tfList.labelPath._getTextFormat = function(){
}
Button_v2.tfList.labelPath.getValue = function(){
}
Button_v2.tfList.labelPath.setValue = function(){
}
Button_v2.tfList.labelPath.__getTextFormat = function(){
}
Button_v2.tfList.labelPath.getStyle = function(){
}
Button_v2.tfList.labelPath.setColor = function(){
}
Button_v2.tfList.labelPath.draw = function(){
}
Button_v2.tfList.labelPath.invalidateStyle = function(){
}
Button_v2.tfList.labelPath.setSize = function(){
}
Button_v2.tfList.labelPath.move = function(){
}
Button_v2.tfList.labelPath.styleName = Button_v2;
Button_v2.labelPath.getFocusManager = function(){
}
Button_v2.labelPath.onKillFocus = function(){
}
Button_v2.labelPath.onSetFocus = function(){
}
Button_v2.labelPath.setFocus = function(){
}
Button_v2.labelPath.changeTextStyleInChildren = function(){
}
Button_v2.labelPath.setStyle = function(){
}
Button_v2.labelPath.adjustFocusRect = function(){
}
Button_v2.labelPath.drawFocus = function(){
}
Button_v2.labelPath.getPreferredHeight = function(){
}
Button_v2.labelPath.getPreferredWidth = function(){
}
Button_v2.labelPath._getTextFormat = function(){
}
Button_v2.labelPath.getValue = function(){
}
Button_v2.labelPath.setValue = function(){
}
Button_v2.labelPath.__getTextFormat = function(){
}
Button_v2.labelPath.getStyle = function(){
}
Button_v2.labelPath.setColor = function(){
}
Button_v2.labelPath.draw = function(){
}
Button_v2.labelPath.invalidateStyle = function(){
}
Button_v2.labelPath.setSize = function(){
}
Button_v2.labelPath.move = function(){
}
Button_v2.labelPath.styleName = Button_v2;

posted by Arul | link |<prev. | ^top | next> | add comment
Friday, September 26, 2003

Code.Flash MX: New Version of ActionScript() function for improved AS Tracing.

I've completely re-written my ActionScript function. For those who are hearing about it for the first time ActionScript(Object, 'name_of_the_variable') - gets complete reusable actionscript string of the Object including circular references.

Now it takes care of special characters in properties and also shows null values properly
Now the actionscript produced is more readable. See the following example for better understanding.
#include "toString.as"
//
var x ={a:null,b:undefined}
x.obj ={}
x.obj["special#."]=true
trace(ActionScript(x,'x'));
It Produces the following output
x = {
        obj:{},
        a:null,
        b:undefined
}
x.obj["special#."] = true;
You can download the toString.as from the actionscript section of this blog.

posted by Arul | link |<prev. | ^top | next> | add comment
Thursday, September 18, 2003

News.Flash MX: Flash MX 2004 JSFL Reference.

While the Macromedia's official documentation for JSFL(The Flash JavaScript API) is not yet released, Steve Webster has put in some effort and created a reference for JSFL. Thanks for your efforts Steve!

Have a look at it here!

posted by Arul | link |<prev. | ^top | next> | add comment
Wednesday, September 17, 2003

Tips.Flash MX: __bytecode__ and its use.

Robin Debreuil mentioned about it in his nice new blog(Welcome Robin!) and further discussed in FlashCoders mailinglist.

Using __bytecode("SomeByteCodeHere"); in your actionscript you can inject some bytecode into swf (It will be inserted at compile time).

It can be used to compactly represent some actionscript and hide the code behind in your FLA. But the swf produced is no different from that produced by normal actionscript unless you use some special optimization.

I decompiled the swf which had the script provided by Robin using both ActionScript Viewer and Kinetic Fusion and got the following script :)
var i = 0;
while (i < 10)
{
        trace("Holy shit, bytecode in the fla!");
        i = i + 1;
}

posted by Arul | link |<prev. | ^top | next> | add comment
Tuesday, September 16, 2003

Events.Flash MX: Intro to Flash MX 2004 User Group Session in Singapore.

Lucian Beebe, Senior Product Manager for Flash is coming to Singapore for both the Launch of MX 2004 and this session.

Date: Friday 19, September 2003
Time: 6 pm to 8 pm (right after the launch of MX 2004)
Venue: Suntec City Convention Center
Price: Free

For more details and registration rush to Flash Move, because today is the last day for registration.

posted by Arul | link |<prev. | ^top | next> | add comment
Tuesday, September 16, 2003

Events.Flash MX: Macromedia MX 2004 - Corporate Launch (Singapore).

Event Date: 19-09-2003
Start Time: 13:30
End Time: 17:30

Description:
New capabilities in Dreamweaver MX 2004, Flash MX 2004 & Fireworks MX 2004

Venue :
Suntec Convention Centre, Level 3, Auditorium

For more details and registration visit Macromedia website.

posted by Arul | link |<prev. | ^top | next> | add comment

footnote:-
Also check the recent entries and feel free to add your comments. I need your comments to improve this blog