Monday, December 11, 2006

Bug with V2 Alert component?

A collegue was telling me that he was having troubles with displaying alerts using the V2 Alert component. The alert message was getting truncated at some point or other. I set out to investigate the problem, and saw that this only happens when the alert displays an icon in it. A simple alert (with no icon) didn't seem to exhibit this problem.
Try this out:

Alert.show("Hello world, this is a test implementation", "Alert", Alert.OK, this, alertHandler, "alertIcon", Alert.OK);

"alertIcon" is the linkage ID of a 25 * 35 px movieclip in library.
Do a test movie, and the alert displays "Hello world, this is a test implement". As you see, the last word is partially truncated.
After a few minutes of fiddling around with the mx.controls.alertClasses.AlertForm class, I figured out that editing the following statement(lin no 213) in getSize method helps
before:
width = Math.min(extent.width + 4 + 8, 2 * bWidth);
after:
width = Math.max(extent.width + 4 + 8, 2 * bWidth);
Please note that when you do this change, And when your alert message is really small ( like "hello world") you'll still see that the alert box is a lil too wider. But in a practical sense, most messages that you alert users are atleast 3 -4 words long, so this wouldn't be as much as a problem as losing out some data!

I googled for this issue a bit, and since I didn't find much info on that, thought I'd post it up here.

Monday, November 13, 2006

Using Flashdevelop on a limited user account in Windows

I've been using flashdevelop for writing my AS these days, and its a pretty nice editor, I'd say. This new work place that I joined a few days back, everyone-except the Flash developers-(the C++ devs and Java devs, that is) use Linux for their development. And when I was given a user account for this windows machine, I ended up getting a limited access user account. Now that meant that I have to go through all those 'request for software installation-get sysadmin to install software' process. After a few unsuccessful attempts to get a local admin access - or a power user access, I had to accept the limited user account.

Now as I was getting started with coding, I started missing FlashDevelop. And went on to raise a request for installation of the same. And the sysadmin was kind enough to install it for me - from his admin account. But when I logged in from my account, I wasn't able to use it. FlashDevelop saves (and loads) the panel settings and stuff in xmls in the settings folder inside the flashdevelop program files folder. Now when I was logging in from the other user account, the folder was becoming unaccessible for my account. Doh!

We tried adding access to that particular folder for my user, and all that, and nothing seemed to help. And I had almost given up. Thought of going back to Eclipse + ASDT combo, and got it up and running. But at the back of my heart, I was still missing flashDevelop. Thats when this sysadmin came up with a idea. He temporarily added me to the powerusers user group, and then installed flashdevelop from my own account. Then removed me from the poweruser group, and hurray! It works now!!

Thursday, November 09, 2006

MAX 2006 - Singapore

Two days after the MAX here in Singapore, am still high from the feeling of having been there. Having read a whole lot of things about the Las Vegas MAX conference on various blogs, this one was more of a selective re-run of a few sessions. So there wasn't something that made me go 'wow', but ya, you always get to learn a lot, when people are talking.

My agenda for this MAX was to go meet the people behind FSUG of Singapore. But it looked like the community isn't very active in here. I met Timothée Groleau and Arul Kumaran, and that was it. Tried to look around for Ryan but didn't get to see him. He was more in the creative track sessions I believe.

Robin and Ted and flexDaddy were pretty impressive. I did want to attend a few sessions on the Mobile track and a few in the creative track, but the sessions on the 'application development' track were pretty impressive that I couldn't switch to the other halls. Missed sessions from
Jeremy Clark and Bill Perry and Eric Natzke.

And as an aftermath of MAX, I've taken up evangelising Apollo this year. At work we are discussing about building a desktop client of a Flash app we are building, and I've already started 'selling' the idea of making it an apollo app. For now, looks like it might go wrapped in mProjector though.

A few pictures I took on the first day are in here. Haven't uploaded pics from the second day. After the second day at MAX, I came back to work- to spend the next 23 hrs straight at work! And went back home and slept abt 12 hrs in one go. Need to tune back to a normal 24 hr day schedule now!

So a few new things I learnt in there:
1. There will be a workflow that will suppport Apollo development in CS3 version of Flash, Dreamweaver and a future version of FlexBuilder.
2. Guys have started thinking/designing a 2-and-half D support in a upcoming version of flash player.
3.

Sunday, November 05, 2006

Project BlackBox from Sun

Probably a lot of people have by now heard about the project blackBox, from Sun Microsystems. For those who haven't heard yet, BlackBox is a prototype of the "world's first virtualized data center". Its a complete datacenter system packed into a standard shipment container! Check out the video tour here.

I read it through Tim Bray's weblog . He describes the blackBox to be 'just totally drop-dead fucking cool'. And thats more or less the same I felt after going through their videos! ( he seems to have gone through some bashing for using the f-word in there, but thats out-of-scope of this post ;o)

Btw, I also came across this advertisement from Sun for Java - Java is everywhere: Pretty neat and appealing. Probably we should have some TV commercials for Flash as well :) What say?

Saturday, October 07, 2006

code Search - google / Krugle ?

Google launched their codeSearch tool(http://google.com/codesearch) yesterday. And it doesn't know that there is a language called 'Actionscript' ?

Krugle(http://www.krugle.com) knows Actionscript. And I like what they have done for the UI as well.

How do you "code search" ? Google / Krugle ?

Monday, October 02, 2006

Full-time / Part-time flash developers required in Bangalore, India

A friend of mine is looking for a flash developers to work with them for Attomic Labs (http://www.attomiclabs.com/), either part-time or full-time.

The expected skillset includes:

Atleast a couple of years of RIA development experience in AS2.0 using OOP methodologies
Working Knowledge of XML
Should be a good team player
Understanding of AS1.0, Flash components-V1 & V2
and good communication skills, of course.

Component development experience in AS2.0 experience would be greatly appreciated.

If you feel that you have the above mentioned skills, please mail me your CV at [arulprasad at gmail dot com], and lets talk.

They are setting up a office in Bangalore, so candidates applying for a full-time position should ideally be willing to re-locate to Bangalore (if not currently in Bangalore, that is). Remote involvement is possible, for successful part-time candidates.

Monday, July 24, 2006

Showing list of fonts in a Flash V2 comboBox formatted with the corresponding fonts

I was browsing the actionscript.org forums today and found a query by a user. It read "I have a combobox full of font names. I was thinking that it would be pretty cool to have the actual font format show in the label as well. ...."

I had a lil free time and thought I'd give it a shot.

This is what you need to do:

1. Drag a comboBox component from the components Panel to your FLA's Library.

2. Add the following code:


/* --------------------------- code starts here --------------------------- */
import mx.controls.ComboBox;
var myCB:ComboBox;

function init ()
{
myCB = ComboBox(createClassObject(ComboBox,"myCB", this.getNextHighestDepth()));
myCB.setSize(175,22);
myCB.rowCount = 7;
myCB.dataProvider = TextField.getFontList ();
myCB.open ();
myCB.addEventListener ("change", function ()
{
myCB.textField.setStyle ("fontFamily", myCB.value);
});
myCB.addEventListener ("load", setCBListFonts);
myCB.addEventListener ("scroll", setCBListFonts);
}
function setCBListFonts ()
{
for (var i in myCB.dropdown.listContent)
{
var _tf:TextFormat = myCB.dropdown.listContent[i].cell.getTextFormat ();
_tf.font = myCB.dropdown.listContent[i].cell.text;
myCB.dropdown.listContent[i].cell.setTextFormat (_tf);
}
}

init();
/* --------------------------- code ends here --------------------------- */


3. Test Movie, and you should be done!

This is how the final SWF looks: (If SWF doesnt show up below,check it out here
)



Tuesday, July 18, 2006

[OT] : blogspot.com, typepad.com, geocities.com banned in India!

I had been wondering why a few of my favourite blogs were not accessible today morning. And only by evening(when a friend of mine told over chat) did I know that my blog was blocked too! I figured out the govt of India had asked the ISPs to block a few blogs because they were supposed to have 'objectionable content'. Wonder if they mistook me when I said i'm a flasher ;o)

On a serious note, I'm pretty seriously pissed off!

More info here.

Meanwhile someone let me know about this site:http://www.pkblogs.com And guess what was the first blog I read through this proxy? The one which was supposed to be the reason behind this ban (na, am not gonna provide a link) - and I never even knew about this blog before! Guess the Govt of India has ended up providing some indirect advertising for those bloggers with 'objectionable content'!

Oops, now will the sue me for saying this? :P

May be I'll cut it short here. Hoping they lift the ban soon! - Or may be its time I booked my own domain name...

Update:07/ 22/ 06 : the ban seems to have been lifted off now!

Monday, July 03, 2006

18 Errors - No comments found

I was browsing through the AS3LR on LiveDocs today and at some point in time stopped at this (http://livedocs.macromedia.com/specs/actionscript/3/as3_specification195.html) page. Returning back to the FF window after a while freaked me out for a second.

LoL

Wednesday, June 21, 2006

saving XML from Flash, using PHP

I was trying to create a XML file on the server, using PHP. The XML string was being sent from Flash, by adding the same as a property to a LoadVars obj. ( Since I had to send few other data items as well - other than the XML string, I couldn't use Flash's XML.sendAndLoad method; Ok, I can see you guys yelling out, "why not AMFPHP!", but then the app was designed by non Flash clients and they didn't know AMFPHP then)

On the PHP end the following was the code to save the doc.

$doc = new DomDocument();
$doc->loadXML($xmlstr);
$doc->save($picture_path);

When I tried saying the xml, I wasn't able to get it saved. The error was at the loadXML method call. PHP wasnt able to load the XML, from the XMLString. But I was able to trace the XML string. Except for the escape characters for double Quotes ('"' were '\"' at the php end) for the XML node attributes, things looked fine. I tried copying the same string and hardcoding it on the php page, and the XML file was being created, with no issues.

After a few attempts, I was able to narrow down the problem to the attributes in the XMLNodes. the escape characters were indeed the problem. ( am not a php programmer, so, i dont know why)

Now this is what I have as a solution to this:

in the php end, i have done a stripslashes call, before i load it on the DomDocument Object. Like this:

$doc = new DomDocument();
$xmlstr = stripSlashes($xmlstr);
$doc->loadXML($xmlstr);
$doc->save($picture_path);

And it works!

Tuesday, June 06, 2006

[OT] - Look what they did to Flash 8!

Found this link on flashcoders list today. Awesome stuff!

http://abum.com/file/shadow/animations/17632.swf

Reminded me of the XIAO - XIAO movies that used to make rounds loong time back, when i was in college, (and I barely knew flash then)

Wednesday, May 24, 2006

OT - Microsoft Office Professional Plus 2007 Beta available

My first observations:

  1. The UI is ultra cool. Makes me want to use word 2007 all the time
  2. The default font wasn’t Times New Roman anymore. This “calibri” font is real nice on screen!
  3. You have a “Save As” PDF option. You can publish to a PDF file straight from Word. No plugins required anymore!
  4. The default file format is .docx – the new XML based file format,
  5. You can write a post for your blog in word, and have it published at blogger. That’s what I'm doing right now!
  6. Creating tables, ‘Smart Art’ the “roll over to get a live preview“ feature, the page layout “themes”– They just rock!
  7. Lots of features that were hidden below menus are now exposed in the toolbars – and to avoid cluttering of too many tools, they have put them neatly under different tabs. Neat!
  8. Select some text, and a mini format toolbar popups up just along the text. And unless you want to use it, it stays out of your way, as a semi transparent popup.
  9. Press ‘Alt’ and every control in the UI that has a shortcut shows the shortcut key combination to be pressed in a small layer above the control itself.

And many more!

Just like IE 7 and Win Media Player 11 beta, the classic File menu( that’s what they call it ) has been hidden.1

I’ve just gone tried out MS Word 2007- am yet to check out Excel and Powerpoint. This is just too impressive.

Check it out here - <http://www.microsoft.com/office/preview/default.mspx>


And ya, the page has a splash animation, using Flash

Tuesday, April 11, 2006

wmode = transparent in FF plugin - its Key.isDown() this time!

Had there never been transparent windowless mode (wmode), I wouldn’t have proposed a solution using it, to my team. And it wouldn’t have fired back on me now.

As I had mentioned in a previous post I had problems with wmode onMouseWheel event. Finally we ended up with a workaround for this, using our good old hitTest method. Not a great work around, but solved our purpose.

Today pick is the Key.isDown method. With wmode=”transparent”, Key.isDown always returns false even when the corresponding key is pressed.

Try this:

Reproduction steps:

  1. Create a movie with a text field on stage( give it a instance name “log”).
  2. Draw some shape. Make it a button. On that button have the following code:


on (keyPress "")

{

_root.log.text += "\nShift is pressed : " + Key.isDown(Key.SHIFT);

}

  1. Now publish this FLA to SWF and HTML. Open the html file in FF and IE
  2. Try pressing SHIFT + TAB
  3. Verify Result 1.
  4. Now open the FLA and set wmode to “transparent windowless” and then publish
  5. Refresh the pages in IE and FF.
  6. Try pressing SHIFT + TAB
  7. Verify Result 2.

Actual Results:

  1. You’ll see both the browser pages trace Shift is pressed :true
  2. FF traces Shift is pressed :false and IE traces Shift is pressed :true

Expected results:

Both IE and FF should trace Shift is pressed :true at step 8.

Bad bad bad bad bad bad bad bad (read it like how Mallory says ;o) )

Work around: ( I hate this part)

Make a keyListener object in the root level(or anywhere you need it) of ur SWF and onKeyDown check if SHIFT is pressed and toggle a variable to true. on KeyUp, toggle it back to false. And everytime u want to do a Key.isDown (Key.SHIFT), check ur variable instead.

Doh!

Sunday, April 02, 2006

China Buys Google - Oh man, Did I just get fooled??

It just isn't making much sense in Google being bought over by China's ministry of Info.. And when I read the article again, Every other detail seems to be wierdly made up! And worst of all, its still April 1st out there!!!

Pranks by Google on previous April Fool's days just struck me now!!!

If its a april fool's game, they seem to have planned it great - I read that on theregistrar's site and I found the link in scobleizer's blog, and there are other 'breaking news' as well!

I tried reading the 'breaking news' posts as well, but am not able read thru.. Probably I should get back to sleep!

Doh!

But hey, it isnt a far game after all.. Its April 2nd here already :D

China Buys Google

Its 4 AM here in Bangalore, I was still struggling to sleep, so woke up to check on whats happening with the world :) - And I reached this: http://www.theregister.co.uk/2006/04/01/china_buys_google/

There seem to be many other interesting things happening around. I was just going through Eddie Awad's compilation of breaking news. Woah! Just enough to keep me awake over the rest of the night ;)

Wednesday, March 22, 2006

About Adobe Flash Player 8.5

Just noticed, the new Flash player 8.5 beta that gets installed with Flex Builder 2 Beta 2 has the "About Macromedia Flash player x" replaced with "Adobe Flash player 8.5" string in the context menu.

I still remember seeing the "About Macromedia Flash player 5..." link in the Windows XP tour, way back in 2000. Thats how I first came to know about flash (that was pretty late, I know) Forget working for Macromedia Flash team, little did I know I would make a living with Flash then :p

The menu looks little thinner now. (with "Macromedia" being replaced by the smaller string "adobe")

The settings dialog title still reads "Macromedia Flash player settings" though!

Tuesday, March 21, 2006

LG licenses Flash lite and flash player SDK

Following the paths of Samsung, Nokia etc. LG has signed an agreement with Adobe for licensing Flash Lite and Flash Player SDK.

LG is one of the major mobile handsets as far as the Indian CDMA market is concerned. Hopefully we will get to see Flash enabled LG mobile phones soon.

Monday, March 20, 2006

Windows XP on Intel -Mac is ready!

Thick secret has an article about the windows XP boot available for Intel Macs - Exactly what many people would have been waiting for. How I wish I had a Intel Mac!!

The XP on mac project home page: http://onmac.net/
Download: http://download.onmac.net/

And they have a Wiki also put up here.

Wednesday, March 01, 2006

Microsoft Virtual Earth - MS's answer to Google Earth

Microsoft replies to Google Earth with its new feature they call 'interactive Street-side browsing' in the preview release of Virtual Earth. And I should say, they did that in Style!

Check out their weblog here.It was announced on Channel9 in this article.

Currently they have street images of Seattle and SF. Lucky that I had been to SF, I could 'drive' around on the streets that I know!!

Awesome stuff!

Friday, February 24, 2006

mouseWheel has issues when used with wMode=transparent

I've been facing a lot of issues with wmode='transparent'. (We needed it to be transparent because we had to show a java applet showing a 3D interactivity above the SWF in our app).

I have come across a few blog posts about the transparent setting for wmode making the input text fields appear without a I-beam mouse pointer in FF.

The recent one that I see is that when wmode = transparent, the scrollTarget being sent as the second parameter to the onMouseWheel event handler function is the path to a movieclip tats a few (about 50- 60 , i guess) pixels above / below the actual movieclip that the mouse is currently on. I tried turning off wmode and it works as expected.

I put together a test file to test this (I tested it out on both Flash 8 and MTASC) , and I see the same problem there.
Here is the test Class:

class App {
function App(ref) {
drawMe(ref);
var o:Object = new Object();
o.onMouseWheel = function(n:Number, s:String) {
ref.log.text += s+"\n";
}
Mouse.addListener(o);
}
static function main(ref) {
var o:App = new App(ref);
}
function drawMe(timelineRef) {
var w:Number = Stage.width;
var h:Number = Stage.height;
var bg_mc:MovieClip = timelineRef.createEmptyMovieClip("bg_mc", timelineRef.getNextHighestDepth());
var box_mc:MovieClip = timelineRef.createEmptyMovieClip("box_mc", timelineRef.getNextHighestDepth());
bg_mc.lineStyle(1, 0xFF0000, 100);
bg_mc.beginFill(0xFF0000, 100);
bg_mc.moveTo(0, 0);
bg_mc.lineTo(w, 0);
bg_mc.lineTo(w, h);
bg_mc.lineTo(0, h);
bg_mc.lineTo(0, 0);
box_mc._x = box_mc._y=100;
box_mc.lineStyle(1, 0x00FF00, 100);
box_mc.beginFill(0x00FF00, 100);
box_mc.moveTo(0, 0);
box_mc.lineTo(w/4, 0);
box_mc.lineTo(w/4, h/4);
box_mc.lineTo(0, h/4);
box_mc.lineTo(0, 0);
timelineRef.createTextField("log", timelineRef.getNextHighestDepth(), 0, 0, 200, 0);
timelineRef.log.autoSize = true;
}
}

And in my FLA, I have the following code:

App.main(this);

Does anybody else see this? is this a known issue? If it is,dDo we have a technote about all these known issues with wmode?

Workaround:

We developed (actually a collegue of mine wrote it all) a work around. As you might guess, we resorted back to hitTest. We have a onMouseWheel listener and when it triggers, we dont use the target that Flash player returns itself. Instead we do a hitTest with _xmouse and _ymouse and figure out the bounds. Though not a great solution, it solves the purpose. Am planning to think about doing something generic enough for this. Let me think!

Wednesday, February 15, 2006

Points to remember when using SSL + IE + Flash

(I got no time to write it in detail. Bear with me, please ;-))

Flash UI (built using AMES), Java for backend code (on Websphere app server), OpenAMF to communicate between Flash and Java. Thats the basic tech stack of the application that I am current working on.

We use SSL to send / receive sensitive information to / from the server. The development machines use Tomcat server instead of websphere. Things were fine until we tested the app with HTTPS on Websphere. Only on IE, the netConnection call returned with a "Call failed" error. Logs showed that the Java code was receiving calls and was returning the data, But the connection kept failing.everytime a HTTPS connection was made.

Thanks to Abdul Qabiz, who was quick to point me into sniffing the HTTPS headers being received. This tip off helped us narrow down our 'googling' and we figured out that there was an issue with IE and SSL that was causing this issue.

The following pages came to be of great help:
macromedia Technote
Microsoft Knowledge base:
http://support.microsoft.com/kb/323308/
http://support.microsoft.com/kb/815313/

and of course this post from Gary Matthew Rogers.

And the solution, we added the following line of code in Java before sending the response back to Flash:

HttpServeletResponseObj.setHeader("Cache-Control", "no-store");

That solved the problem!

Wednesday, February 01, 2006

Flex 2.0 Beta available at macromedia Labs!

Flex 2.0 beta is available to the public, at Macromedia(Adobe) labs. Click here to download the flex SDK,Flex Charting Components 2, Flex Enterprise Services 2, and Flash Player 8.5 (Alpha 3).

With this beta, You don't have to download the entire flex installers to install Flash Player 8.5. Installers (& uninstallers) for Flash player 8.5 (Win and Mac) are available as separate downloads!!

There are some really exciting offerings today from Adobe. As the press release goes "The Flex Framework will be made available free of charge through the Flex Software Development Kit, which will include the command line compiler and documentation required to develop, compile, and deploy Flex applications that connect to XML and SOAP web services with no additional charges or server licensing required. ...Flex Builder 2.0 will be sold for less than $1,000 ... Flex Enterprise Services 2.0 will be free of charge for use by a limited number of concurrent users on a single, non-clustered server. "

There has been a lot of talks in the open source community about what would happen post AS3.0 release, since the next revision of the currently available open source AS compiler MTASC isn't going to support AS3.0.With Flex 2.0's release, Developers will get a standalone AS3.0 compiler, straight from the source, for free!

Can't wait to get my download done ;-)

Wednesday, January 25, 2006

Sparkle beta is out

Probably you would've read about this by now; Microsoft has released the first public beta of Microsoft® Expression™ Interactive Designer(Sparkle). You can get it here

EWeek has already started asking if its gonna be a Flash killer!

There is a video which was released sometime in September last year, which showed some sneak peaks about the product. You can get it here

Wednesday, January 11, 2006

iMac on Intel Chips.

The announcement has been made - in style.

Read the complete news article here and here.

Tuesday, January 10, 2006

Loading crossdomain.xml file from a custom location using System.security.loadPolicyFile

This post expects the reader to have a basic familiarity about Cross domain policy and the crossdomain.xml file. If they sound alien to you, check this technote by Colin Moock

Crossdomain policy was introduced with the security restrictions in Flash player 7 (r7.0.14.0). Right then, the only place where the flash player would look for a crossdomain.xml file was the root directory. Since it was difficult for site administrators to add a crossdomain.xml file to the site root location, a update was released over Flash player 7 (r 7.0.19.0) which included a new method called 'loadPolicyFile', which basically tells the Flash player to look for a custom location, other than the default root directory.

The usage for this method is as follows:
System.security.loadPolicyFile (url:String)

You can read more about this method from Macromedia LiveDocs.

So if you are still developing Flash 7 content, and are planning to use System.security.loadPolicyFile method, make sure your users have flash player 7.0.19.0 or more.

Monday, January 09, 2006

Adobe Lightroom beta available on Labs

Adobe Lightroom beta is available for download at Adobe labs(formerly macromedia labs). Check out the introductory video here

To me, Adobe Lightroom looked like a revamped version of Adobe Photoshop album, which was launched as a free download, to join the likes of Google's Picasa. However I should say that I'vent gotten enough time to go through the video completely.Adobe says Lightroom will be a pro photographer tool. The windows version of the beta is not yet released. Only Mac download is available. I'll have to wait till windows version of the beta is available.