<mx:Flexing> A Paritosh Bisi’s Blog

On Rich Internet Applications, Adobe Flex, ActionScript, Web Technologies and more…

Archive for September, 2008

Customize Alert Box by applying styles

Posted by Paritosh Bisi on September 22, 2008

Tired of seeing the dull looking default flex alert box…? Need to show some alert box somewhat like this below? This can be achieved by applying styles. The code is as follows…

Inside script tab function:-

<mx:Script>
    <![CDATA[
      import mx.controls.Alert;
      private function alertTest():void{
        var alert:Alert;
        alert = Alert.show("Designed by Paritosh Bisi","Heloo...!!!");
        alert.styleName = "myalertstyle";
      }
    ]]>
  </mx:Script>

Inside style tag:-

<mx:Style>
    .myalertstyle
    {
      background-color: #00FFFF;
      cornerRadius: 0;
      creationCompleteEffect: myEffect;
      title-style-name:alertTitle;
      color:#000000;
      font-family:verdana;
      font-size:11;
      area-fill:#000000;
      border-color:#000000;
      border-style:solid;
      drop-shadow-enabled:true;
      shadow-direction:center;
      shadow-distance:0;
      drop-shadow-color:#000000;
      button-style-name:mybuttonstyle;
      fill-colors:#000000;
    }
    .mybuttonstyle
    {
      cornerRadius: 0;
      color:#000000;
      background-color: #330000;
    }
  </mx:Style>

We have to put the above code in the main application.

Instead of putting this style codes inside style tag, we can create a .css file and put these style codes. in style tag we need to refer the .css file with the source propery as follows…

<mx:Style source=”myCss.css”/>

Please note that, it is better to put the .css file reference in the main application file. Refering from some other places may result in different looking styles.

This code will give us some different looking, colorful and stylish alert box.

Happy Flexing…:-)

Posted in Flex Builder | Tagged: , , | Leave a Comment »

Script execution time limit

Posted by Paritosh Bisi on September 20, 2008

The default time for executing actionscript file is 15 sec’s and if the the file takes more that 15 sec’s it throws an Runtime Exception, Error #:1502, as below.

 

If you want Script to execute more than the default time then we need to specify the time limit at the main Application tag .

The property to use is: scriptTimeLimit as follows, in application tag we have to add,

<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute” scriptTimeLimit=”50″>

It takes the value for sec’s specification, in the above code I have set the execution time limit to 50 sec’s. And the max value it can have is 60 sec. It means that the Script can be executed for maximum 60 sec’s.

Happy Flexing…:-)

Posted in Flex Builder | Tagged: , | Leave a Comment »

Organize Imports in Flex Builder

Posted by Paritosh Bisi on September 15, 2008

To Organize Import statements in Flex Builder , click on Source > Organize Imports to organize imports alphabetically.

The shortcut keys for it is : CTRL + Shift + o

Please note that that imports can only be organized in this manner in ActionScript files only. We can not Organize Imports in MXML files.

In Flex Builder 3, the above action will remove Unwanted Import Statements also.

Happy Flexing…:)

Posted in Flex Builder | Tagged: | Leave a Comment »

Flashtracer for Firefox 3

Posted by Paritosh Bisi on September 14, 2008

The FlashTracer addon tool for Firefox 2 which is a very useful tool to debug Flex and Flash applications is not directly available for Firefox 3. But we can now install FlashTracer for Firefox 3. Please check the following link.

http://www.sephiroth.it/firefox/flashtracer/

Happy Flexing…:)

Posted in Firefox | Tagged: , | Leave a Comment »

Flash Player 10 FileReference Changes

Posted by Paritosh Bisi on September 14, 2008

In Flashplayer 10  some new security enhancements to the FileReference class has been implemented.In previous versions of the Flash Player (upto 9.0.124.0), we could programmatically call the FileReference.browse() method to open a file browser dialog window which enables users to locate a file on their system so that it could be uploaded to a server. Most of the developers use this feature for various document uploader applications. In Flash Player 10 you can no longer spawn this dialog window programmatically and it must be initiated by a user click. The attempt to launch the dialog with code will throw a security exception and break the application.

For more detailed informations please check the following links.

http://www.adobe.com/devnet/flashplayer/articles/fplayer10_security_changes.html#head3

http://www.mikechambers.com/blog/2008/08/19/flash-player-10-security-changes/

So, anyone has any solutions or workarounds do let me know.

Happy Flexing…:)

Posted in Flash Player | Tagged: | Leave a Comment »

My First Post

Posted by Paritosh Bisi on September 13, 2008

I wrote my first post today.

Posted in Blogging | Tagged: | Leave a Comment »