Would you like to react to this message? Create an account in a few clicks or log in to continue.


Pakistan is contributing at its best in the field of latest technologies, platforms and approaches. Here,Flex developers share their experience, knowledge and ideas to assure their best talent in the world.

Latest topics
» Advice sought on recruiting a Senior Flex developer in Lahore
URLLoader and  URLRequest application EmptyTue May 11, 2010 2:41 pm by anjum

» steam boiler efficency calculator
URLLoader and  URLRequest application EmptyWed Dec 23, 2009 4:55 am by imranmalik

» URLLoader and URLRequest application
URLLoader and  URLRequest application EmptyTue Dec 15, 2009 6:01 pm by imranmalik

» Time display by ILOG ELIXIER PACKAGE
URLLoader and  URLRequest application EmptyThu Dec 10, 2009 9:28 am by imranmalik

» how Filter XML data by Flash Builder
URLLoader and  URLRequest application EmptySat Dec 05, 2009 6:33 pm by imranmalik

» drag and drop (Advance Data Grid to List Box)
URLLoader and  URLRequest application EmptyThu Nov 19, 2009 7:12 pm by imranmalik

» access the xml file through HTTPService request
URLLoader and  URLRequest application EmptySun Nov 15, 2009 11:46 am by imranmalik

» CURRENCY VALIDATOR
URLLoader and  URLRequest application EmptyTue Nov 03, 2009 2:06 pm by imranmalik

» Synchronous Behavior
URLLoader and  URLRequest application EmptySun Nov 01, 2009 8:04 pm by imranmalik

Social bookmarking
Social bookmarking reddit      

Bookmark and share the address of on your social bookmarking website


You are not connected. Please login or register

URLLoader and URLRequest application

Go down  Message [Page 1 of 1]

1URLLoader and  URLRequest application Empty URLLoader and URLRequest application Tue Dec 15, 2009 6:01 pm

imranmalik



///////folder valueobjects/Employee.as class//////////
//////and make images folder///////
////////id variable may be a image name that you want to show////////////
package valueObjects
{
[Bindable]
public class Employee
{
public var firstName:String;
public var lastName:String;
public var id:String;
public var title:String;
public function Employee()
{
}

}
}
//////////////////mxml file///////////////
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import valueObjects.Employee;
import flash.net.URLLoader;
[Bindable]
private var _selectedEmployee:Employee;
private var loader:URLLoader;
[Bindable]
private var imagePath:String;
public function init():void
{
loader=new URLLoader();
loader.addEventListener(Event.COMPLETE,loaderHandler);
loader.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
}
public function loaderHandler(success:String):void
{
if(success)
{
imagePath="images/"+_selectedEmployee.id+".JPG";
}

}
public function ioErrorHandler(event:IOErrorEvent):void
{
imagePath="images/uavail.JPG";
}
public function set selectedEmployee(employee:Employee):void
{
_selectedEmployee=employee;
var requestURL:URLRequest=new URLRequest("images/"+_selectedEmployee.id+".JPG");
loader.load(requestURL);
}
]]>
</mx:Script>
<mx:Image height="48" source="{imagePath}">
</mx:Image>
</mx:Application>

http://www.jumusic.tv

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum