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]


Thursday, November 28, 2002

News.Flash MX: Screenweaver MX Beta 3 is released.

The current Flash player is primarily used to display Flash content that was initially created for the web. Screenweaver is an extension to the Flash player that aims at providing Flash developers with a toolset to produce rich media desktop applications. By doing so it enables the developer to apply their existing skill set to new uses of Flash technology.

Screenweaver enables the Flash MX, C++, VB, Delphi or C# programmer to create Win32 desktop applications that utilize Flash content as interface.

Screenweaver MX is a product by Rubberduck who is the developer of flashcomponents.net.

Now beta 3 is available for download which is fully functional except that it will expire on December 7th. Visit their website for more details

posted by Arul | link | ^top | next> | comments [4]
Monday, November 25, 2002

Tips.Director: Enabling Flash Links in Director.

It's time for Director again (time for Director MX in fact!). Somebody sent me a mail asking why the getURL functions which are supposed to open the links are failing when we embed the flash movie in director?

The reason is simple, both getURL and FSCommand are methods for flash to communicate to the container application. When we embed the flash file in a HTML page Flash plugin for the Browser is the container which receives and executes this commands. But when we embed the swf in Director, it becomes the container which doesn't know how to handle the requests. That's why it fails, we can write the following lingo as a moviescript to solve the problem.
on getURL(me,url,target)
   gotoNetPage url,target
end  
Then the next problem is your flash buttons will not change the cursor. Use the following lingo as a behavior attached to the flash sprites for the rescue
on mouseWithin me
     if sprite(the currentSpriteNum).hitTest(the mouseLoc) = #button then
       cursor 280
     else
       cursor -1
     end if
end
on mouseLeave me
     cursor -1
end

posted by Arul | link |<prev. | ^top | next> | comments [1]
Sunday, November 24, 2002

News.Flash MX: Server Side ActionScript in ColdFusion MX vs JRun.

Both JRun and ColdFusion MX support Server Side ActionScript, but there is a difference.

In ColdFusion there is an Object called CF with two exposed methods query and http. Using CF.query we can retrieve data from the database by executing SQL query.

There is no such object in JRun. :(

I came to know about this when I was trying to port my server side actionscript file (.asr) from ColdFusion MX to JRun.

You can read more about this in Macromedia Forum.

posted by Arul | link |<prev. | ^top | next> | comments [2]
Wednesday, November 20, 2002

News.Flash MX: Yet Another Action Script Highlighter.

Cyberfunk (Flash-tools) has come out with his own actionscript highlighter in Perl.
He calls it PASH (Perl Action Script Highlighter) and it is also available for download. You can read more on his site.

posted by Arul | link |<prev. | ^top | next> | add comment
Sunday, November 17, 2002

Bug.Flash MX: DRK Message Board Data Grid Sample Errata.

Creating a custom cell symbol for datagrid is very easy. Every cell gets a function, setValue and setSize. When the grid is built, resized or value is changed, these functions will be called.

Message Board is a datagrid sample application that comes with the The Macromedia MX Developer Resource Kit in which you can send and receive message like a email application.

In that sample they have created a custom cell symbol for showing indicating new messages. The following code is used for building the custom cell component
#initclip 2

/* IsNewCellClass

Don't panic, this is quite easy. Every cell gets a function,
setLabel (also setSize, but not covered here). In our case,
          setLabel checks for the "X" and displays if it's there.
*/

function IsNewCellClass()
{
        this.check._visible = false;
}

Object.registerClass("IsNewCell", IsNewCellClass);
IsNewCellClass.prototype = new MovieClip();

IsNewCellClass.prototype.setLabel = function(obj)
{
        this.check._visible = (obj=="X");
}

#endinitclip
Here setValue function is wrongly mentioned as setLabel function. Find and replace 'setLabel' with 'setValue' to make it work.

posted by Arul | link |<prev. | ^top | next> | comments [1]
Wednesday, November 13, 2002

Examples.Flash MX: Creating Dynamic Chart with Flash Charting Components.

Here is the dynamic chart example from my Singapore User group Seminar.

Steps:

  • Create a text file with the following text and name it chartData1.txt. I'm using &name= value& syntax instead of usual name1=value1&name2=value2 for better readability (LoadVars will ignore the extra '&' and the line brakes)
    &label=Singapore,US,India&
    &value=1240,780,360&
    &dataName=Page Views&
    &ChartTitle=Stats for Arul's Blog&
    &XAxisTitle=Country of origin&
    &YAxisTitle=Number of Visits&
  • Drag and drop a Pie Chart component, name it myPieChart and increase the span to 2 frames in the time line
  • Add another layer on top and create a shape in the same color as the chart to hide it in the first frame (It will hide the chart until the dynamic chart data is loaded)
  • Add a static text in the same layer as the shape and type "Loading Chart Data..." to show while loading
  • Add another frame, name it actions and copy & paste the following code
//Keep it in the first frame until chartData is loaded
stop();
_global.chartLoader = new LoadVars();
chartLoader.chartData = new DataProviderClass();
chartLoader.onLoad = parseChartData;
chartLoader.load("chartData1.txt");
function parseChartData(loadSuccess) {
        if (loadSuccess) {
                with (chartLoader) {
                        label = label.split(",");
                        value = value.split(",");
                        for (var i = 0; i<label.length; i++) {
                                var item = {value:(Number(value[i]))};
                                item[dataName] = label[i];
                                chartData.addItem(item);
                        }
                }
        }
        //applyChartData(myLineChart);
        //applyChartData(myBarChart);
        applyChartData(myPieChart);
        //Now go to frame 2 to show the chart
        gotoAndStop(2);
}
function applyChartData(Chart) {
        with (Chart) {
                setDataProvider(chartLoader.chartData);
                setLabelSource(chartLoader.dataName);
                setChartTitle(chartLoader.ChartTitle);
                setXAxisTitle(chartLoader.XAxisTitle);
                setYAxisTitle(chartLoader.YAxisTitle);
        }
}

It will result in the following graph

Once it is up and running you can dynamically generate the data using server side scripting instead of static text file.

posted by Arul | link |<prev. | ^top | next> | comments [1]
Monday, November 11, 2002

Examples.Flash MX: DataGrid Component Example.

Finally I received the Macromedia MX Developer Resource Kit today!
I'm right now playing with the DataGrid component.

The following example is just to show how simple it is to use the data grid component. I've created it by

  • dragging and dropping a data grid component and naming it as my_dg.
  • adding a dynamic text box and naming it as my_txt
  • adding the following actionscript in frame 1.
my_dg.setColumns("Name", "Purity");
my_data =  [
	{
	Name:"Arul", Purity:90, 
	Description:"very much human"
	},
	{
	Name:"GOD", Purity:100, 
	Description:"the perfect, omnipotent, omniscient originator and ruler of the universe"
	}
	];
my_dg.setDataProvider(my_data);
my_dg.setChangeHandler("dgChange");
function dgChange() {
        var sel = my_dg.getSelectedItem();
        my_txt.text = sel.Name+" is "+sel.Description+". He is "+sel.Purity+"% pure";
}

Which resulted in the following

posted by Arul | link |<prev. | ^top | next> | comments [5]
Monday, November 11, 2002

Update.Arul's Blog: I'm back.

Thanks to all my well wishers. Now I'm alright and back to work. I will start posting the seminar examples one by one as and when I find time. (I have to cleanup the code before doing it)

posted by Arul | link |<prev. | ^top | next> | add comment
Thursday, November 07, 2002

Update.Arul's Blog: Not Feeling Well.

Last Saturday suddenly I've fainted and after that I had little blurred vision for 2 days and having head ache till now. :(

I didn't take it seriously, but my family forced me to take a medical test. So I've undergone the tests including X-ray. I've been told to take rest for 2 days. With the given tablets I should be alright otherwise I need to under go other tests.

Well, this is the reason for the lack of posts for couple of days.

posted by Arul | link |<prev. | ^top | next> | comments [5]
Sunday, November 03, 2002

Extension.Dreamweaver MX: Change Case.

Yesterday after finishing the change case ActionScript for flash, I thought why not to port it as an extension for dreamweaver?

Because Dreamweaver supports javascript for extensibility which is also an ECMA script like ActionScript.

After some search, I found an article written by Bob Berry on "Creating a simple Commands extension for Dreamweaver" in which he expanined how to create change case command which can convert strings to either uppercase or lowercase.

Also Hawa Edelstein already created an extension for the same.

Based on these two codes and my "Title Case", "Sentense Case" and "Toggle Case" code, I've come up with this extension which can change the case of selected text to one of the following,

  • Sentence case - Capitalizes the first letter of the word in the selected sentences.
  • Lowercase - Changes all selected text to lowercase letters.
  • Uppercase - Changes all selected text to capital letters.
  • Title Case - Capitalizes the first letter of each word in the selection
  • tOGGLE cASE - Changes all uppercase letters to lowercase in the selection and vice versa.
You can download and try it your self from here. It is still a BETA version only, if you find any bugs please post it in the comments.

posted by Arul | link |<prev. | ^top | next> | comments [6]
Saturday, November 02, 2002

Code.Flash MX: String.changeCase(Title || Sentence || Toggle).

ActionScript Standard Library project is really picking up. For those who are hearing it for the first time, the ActionScript Standard Library is a collection of ActionScript classes and libraries that aims to create and provide a standard library of functionality to ActionScript. ASL is an Open Source initiative by Mike Chambers, the community manager of macromedia.

Currently 33 developers (including me) started putting in their efforts. If you want to get updated with the latest development about that project you can visit the forum and/or subscribe to the mailing list.

We are going to start with extending String, Date, Math Objects and then proceed to other complex Objects.

Here are some of my ideas to extend the String object.

Title Case:
String.prototype.toTitleCase = function() {
        var str = "";
        var prevWhite = true;
        for (var i = 0; i<this.length; i++) {
                str += prevWhite ? this.charAt(i).toUpperCase() : this.charAt(i).toLowerCase();
                prevWhite = this.charCodeAt(i)<=32;
        }
        return str;
};
Example:
trace("message to the universe of girls: i'm having a mechanical life here :(".toTitleCase());
//outputs 'Message To The Universe Of Girls: I'm Having A Mechanical Life Here :('
Sentence case:
String.prototype.toSentenceCase = function() {
        var str = "";
        var SentenceBrake = true;
        for (var i = 0; i<this.length; i++) {
                str += SentenceBrake ? this.charAt(i).toUpperCase() : this.charAt(i).toLowerCase();
                SentenceBrake = (SentenceBrake && this.charCodeAt(i)<=32) || "\r\n.,?:;!".indexOf(this.charAt(i)) != -1;
        }
        return str;
};
Example:
trace("i'm searching for my soul mate. if you feel you are the one (at least try to feel like that)".toSentenceCase());
// outputs 'I'm searching for my soul mate. If you feel you are the one (at least try to feel like that)'
tOGGLE cASE:
String.prototype.toToggleCase = function() {
        var str = "";
        for (var i = 0; i<this.length; i++) {
                str += this.charCodeAt(i)<=90 ? this.charAt(i).toLowerCase() : this.charAt(i).toUpperCase();
        }
        return str;
};
Example:
trace("i'M wAITING fOR yOU, dO dROP mE a mAIL".toToggleCase());
//outputs 'I'm Waiting For You, Do Drop Me A Mail'
Single Space: - Clears the extra spaces and line brakes in the given String
String.prototype.toSingleSpace = function() {
        var str = "";
        var prevWhite = true;
        for (var i = 0; i<this.length; i++) {
                var code = this.charCodeAt(i);
                white = code<=32;
                if (white) {
                        if (!prevWhite && (code == 9 || code == 32)) {
                                str += " ";
                        }
                } else {
                        str += this.charAt(i);
                }
                prevWhite = white;
        }
        return str;
};
Example:
trace("I     have      waited for 	you so	\rl o     n     g \n !".toSingleSpace());
//outputs 'I have waited for you so l o n g !'
//note:-
//   the text used in the examples is just for fun, 
//   should not be taken seriously [except by the willing girl(s!?)]

posted by Arul | link |<prev. | ^top | next> | comments [4]
Friday, November 01, 2002

Events.Flash MX: User Group Session in Singapore.

FlashMove's Singapore user group is going to organize a seminar on 3D Tools, Optimising Movies and Using Components.

I'm one going to be of the speakers covering the following topics

  • Understanding Components
  • Putting components in to real use
    • Building dynamic graphs using charting components
    • Building dynamic tree navigation using FTree component
  • Making Flash to Speak - Creating a light weight talking application in flash
  • Creating interactive 3D text in Director 8.5

Event Date: November 9, 2002
Start Time: 2:00 pm
End Time: 4:00 pm
Venue: Temasek Polytechnic. LT 25 Design School Ground Level
Cost: Free
Registration: http://www.flashmove.com/sg/

If you are in Singapore, hope to see you there :)
For others may be I can post the articles and give the source code for download

posted by Arul | link |<prev. | ^top | next> | comments [3]

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