Mathew Easow Jacob’s Blog–India

a enthusiast…developer…on technology,RIA,flex,web,startup….

Archive for the ‘Flex 2.0.1’ Category

Flex 2.0.1

undrgable flex alert

Posted by easow83 on September 14, 2008

Here is the source for undgragable alert ….set  “isPopUp” property “true” to make it dgragable.

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application
xmlns:mx=”http://www.adobe.com/2006/mxml
layout=”
vertical”
verticalAlign=”middle”
backgroundColor=”white”>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private var myAlert:Alert;
private function showAlert():void
{
title =
"Undraggable Alert"
;

myAlert = Alert.show("My undgragable alert!!",title);
myAlert.isPopUp = false;
myAlert.status = Capabilities.version;
}
]]>
</mx:Script>
<mx:Button id=”btn”
label=”Show Alert”
click=”showAlert()”
/>
</mx:Application>

 

 

 

 

 

 

 

 

 

Posted in Flex, Flex 2.0.1, Flex 3 | Leave a Comment »

Update system time dynamically..

Posted by easow83 on September 11, 2008

Here is the sample code were you can display the system time..its like a digital clock..usually the timer we can use to update the time ,running a an application similar to stop watch ,alarm and lot more ..

<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute” creationComplete=”init()”>
<mx:Script>
 <![CDATA[
 [Bindable]
 private var sec:String;
 
  private function init():void {
   var ti:Timer = new Timer(1000);
   ti.addEventListener(TimerEvent.TIMER,timerFun);
   ti.start();
  }
  private function timerFun(e:TimerEvent):void{
     var dt:Date = new Date();
   sec = dt.getHours() +’:'+dt.getMinutes()+’:'+dt.getSeconds();
   
  }
 ]]>
</mx:Script>
 <mx:HBox>
  <mx:Label id=”lbl” text=”{sec}”/>
 </mx:HBox>
</mx:Application>

Posted in Flex, Flex 2.0.1, Flex 3 | Leave a Comment »

Flex custom tooltip speech bubble

Posted by easow83 on September 11, 2008

Here is a sample that should help demonstrate the approach.

click here

Posted in Flex, Flex 2.0.1, Flex 3 | Leave a Comment »

How to turn off horizontalScrollPolicy and verticalScrollPolicy for all conatiners

Posted by easow83 on September 9, 2008

 Application.application.scrollPolicy = “no” that can be overrided by individual containers..

Posted in Flex, Flex 2.0.1, Flex 3 | 1 Comment »

What makes a flex app big in size ??

Posted by easow83 on September 9, 2008

Generally what makes a flex app big in size
1.Try to load your assets (images/animations) at runtime.
2. Try not to embed fonts. If you don’t really need a special font, or advanced anti-aliasing and you are not applying any effects and transformations (alpha, rotation etc.) to your text, you don’t need to embed fonts.
3.Another important concept is that of modular applications. Here are the docs:
http://livedocs.adobe.com/flex/3/html/help.html?content=modular_1.html
4.make sure you are looking at a “production” compile and not a debug compile.  There is significant difference in swf size.
5.not forget the Runtime Shared Libraries.  If you can offload the Flex Framework into and RSL that will significantly decrease your swf’s size.  The initial load will be the full 1mb, unless the user has been to another site that loaded the RSLs already into the flash player cache.  Every subsequent load will be reduced by about 500kb if you’re using the full flex framework.

Posted in Flex, Flex 2.0.1, Flex 3, GeneralDiscussion, RIA | Leave a Comment »

Firebug for Flex 2.0/3.0 applications

Posted by easow83 on June 5, 2008

from http://code.google.com/p/fxspy/

Check it out a live at: http://www.mieuxcoder.com/data/2007/12/FlexSpy-1.2/dashboard.html (in the application, click the flexSpy button on the top-right corner)

Flex-Spy allow you to inspect and dynamically change most properties and styles of the visual components in your Flex application. You can – for example – try out a specific width or a background color for your component before changing it in your code.

To install it in your application, follow the InstallationInstructions.

Posted in Flex, Flex 2.0.1 | Leave a Comment »

Flex 2 and IFrames

Posted by easow83 on April 7, 2008

 

If you’re looking for a way to get multiple HTML pages in a Flex application without using Apollo, check out this code.

to use multiple iframes check out this code

Posted in Flex, Flex 2.0.1 | Leave a Comment »

URL Link in Flex Application

Posted by easow83 on April 6, 2008

  You have  a user click on a link ,button, label
  whatever… from within a Flex application and have it take the user to a
  non-Flex, regular web page within their browser.. It’s probably a
  simple answer but I’m still getting up to speed your Flex!!!…….

try this

<mx:Button label=”Click Here” click=”navigateToURL(new
URLRequest(‘htp://mathewjacob.wordpress.com’),’_mine)” />

Posted in Flex, Flex 2.0.1, Flex 3 | 4 Comments »

Application Creation Life Cycle Events for FLEX

Posted by easow83 on April 2, 2008

First lets go over what events there are for an application creation life cycle. These include preinitialize, initialize, creationComplete, and applicationComplete. Below is a diagram that explains when each happens and shows the order.  Application Creation Life Cycle Events

Looking at the code below we see that all that is done in the example is that when each event is fired I call a small function. This function, recordEvent, takes in a FlexEvent and adds some text to our report string. Also you see that not only is a little bit of text added, the time from flash.utils.getTimer() is printed. This getTimer() function returns the amount of milliseconds that have gone by since the start of the application. So what we get printed out is event.type and the time at which the event occurred.

<?xml version=“1.0″ encoding=“utf-8″?>
<mx:Application xmlns:mx=“http://www.adobe.com/2006/mxml”
  layout=“absolute” width=“349″ height=“319″
  viewSourceURL=“../files/LifeCycleEventsTutorial.mxml”
  preinitialize=“recordEvent(event)”
  initialize=“recordEvent(event)”
  creationComplete=“recordEvent(event)”
  applicationComplete=“recordEvent(event)”>

  <mx:Script>
    <![CDATA[
      import mx.events.FlexEvent;
      import flash.utils.getTimer;
     
      [Bindable]
      private var reportTxt:String = “”;
     
      private function recordEvent(event:FlexEvent):void
      {
        reportTxt += (event.type + ” event occured at “
          + flash.utils.getTimer() + “ms” + \n);
      }
    ]]>
  </mx:Script>

  <mx:Panel x=“0″ y=“0″ width=“349″ height=“319″
    layout=“absolute” title=“Life Cycle Events”>

    <mx:TextArea x=“10″ y=“10″ width=“309″ height=“259″
      editable=“false” id=“txtReport” text=“{reportTxt}”/>

  </mx:Panel>
</mx:Application>

Now once the last event applicationCreation is fired all other events can start firing, such as click events and so on. Understanding how the application is created is an important aspect to any program but it is especially so in Flex because of its event driven nature.

I hope this quick run through helps you out when trying to figure out what starup event(s) you should hook into. If you would like more info on these check out the Adobe livedocs and a special thanks to Ted Patrick, who has great info on all aspects of Flex.

Posted in Flex, Flex 2.0.1, Flex 3 | Leave a Comment »

call to .net dll from flex

Posted by easow83 on March 16, 2008

 
FluorineFx provides an implementation of Flex/Flash Remoting, Flex Data Services and real-time messaging functionality for the .NET framework.
 
check the following links.
http://www.fluorinefx.com/
 
Fluorine Projector is an open source SWF2Exe Framework based upon Fluorine Remoting Gateway, Macromedia Flash® and Microsoft .NET Framework.
 
http://fluorine.thesilentgroup.com/projector.htm

Posted in Flex, Flex 2.0.1, Flex 3 | Leave a Comment »