[flexcoders] Refreshing issues in Gumbo: Is that the bug or am i doing something wrong?

2009-05-19 Thread anuj181
Hi Guys 
I am trying to make a simple app in Gumbo(flex 4) but it does not seem to be 
working, I am just trying to change the color of the a simple rectangle (which 
is in the form of the path data for the SVG image), I am not sure whats going 
on here but it does not seem to be working. Am I doing something wrong or is 
this the bug in the adobe Flex 4?
Please let me know if you have any idea,
Thanks a lot for your help


?xml version=1.0 encoding=utf-8?
s:Skin xmlns:fx=http://ns.adobe.com/mxml/2009;
xmlns:s=library://ns.adobe.com/flex/spark
xmlns:mx=library://ns.adobe.com/flex/halo

fx:Declarations
s:SolidColor id=normalFill color=0x949EA3/
s:SolidColor id=overFill color=0xFF/
s:SolidColor id=downFill color=0x0066FF/
s:SolidColor id=disabledFill color=0x00/
/fx:Declarations

fx:Script
![CDATA[

]]
/fx:Script

!-- host component --
fx:Metadata
[HostComponent(spark.components.Button)]
/fx:Metadata

!-- states --
s:states
s:State name=up /
s:State name=over /
s:State name=down /
s:State name=disabled/
/s:states

s:Rect width=100% height=100%
s:fill
s:SolidColor color=0x00 alpha=0.0/
/s:fill
/s:Rect

s:Path fill={normalFill} fill.over={overFill} 
fill.down={downFill} fill.disabled={disabledFill} scaleX=12500 
scaleY=12500
data=M0.0021747 0.00326205c0.0021744,0 0.00434941,0 
0.00652411,0 0,0.0014495 0,0.00289991 0,0.00434941 -0.0021744,0 -0.00434941,0 
-0.00652411,0 0,-0.0014495 0,-0.00289991 0,-0.00434941z/
/s:Skin




[flexcoders] Error Loading the SOAP mathod from AIR Application

2009-04-28 Thread anuj181
Hi Guys
I have used Web Service in REST in the past but this is my first attempt to 
call SOAP method from WSDL and for some reason it is failing, I have never 
called a single method through SOAP so please bear my beginner mistakes,Below 
is my MXML code and my WSDL has following schema, Anyone has any idea why it is 
failing ? Any guidance and help will be appreciated
Thanks

/WSDL/
wsdl:definitions 
targetNamespace=urn:schemas-pelco-com:service:UDIConfiguration:1
âˆ'
wsdl:types
âˆ'
xsd:schema targetNamespace=urn:schemas-pelco-com:service:UDIConfiguration:1
âˆ'
xsd:complexType name=Channels
âˆ'
xsd:sequence
xsd:element name=channelId type=xsd:string/
xsd:element name=channelNumber type=xsd:int/
/xsd:sequence
/xsd:complexType...
âˆ'
xsd:element name=GetAvailableChannels
xsd:complexType/
/xsd:element
/MXML*/
mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml;
xmlns:myService=generated.webservices.* layout=absolute 
creationComplete=start(); 

mx:Script
![CDATA[
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.soap.LoadEvent;
import mx.rpc.soap.WebService;
import generated.webservices.*;

public var webServices:WebService = new WebService();

public function start():void
{
webServices.wsdl = 
http://10.1.4.1:5000/WSDL/UDIConfigurationV1.wsdl;;
webServices.loadWSDL();

webServices.addEventListener(LoadEvent.LOAD,wsdlLoaded);

}

public function wsdlLoaded(event:LoadEvent):void
{
webServices.GetAvailableChannels();

webServices.GetAvailableChannels.addEventListener(ResultEvent.RESULT,onNumerOfPlugins);

webServices.GetAvailableChannels.addEventListener(FaultEvent.FAULT,onFault);
}

public function onNumerOfPlugins(event:ResultEvent):void
{
Alert.show(event.result.toString());
}

 public function onFault(event:FaultEvent):void
{
Alert.show(Error Loading Function);
}
 

]]
/mx:Script

/mx:WindowedApplication




[flexcoders] How to clear cache for all major browsers (IE, Mozilla, Safari and Chrome)

2009-03-17 Thread anuj181
Hi Guys
Anyone has any idea which is the best way to clear the cache for my web 
application (which is made in Flex and PHP), For some reason it keeps on 
pulling old entries from cache and is confusing user and me with the 
inconsistent results, I guess that it is pulling values from the cache as 
everything works fine when I manually clear the cache.I did little research and 
tried following tags in the index.template.html but somehow it is not working 
efficiently , Whats the best way to clear the cache for all the major browsers 
(IE, Mozilla, Safari and Chrome) for my web application? Anyone has any idea?
Thanks in advance for your help,


head
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
meta http-equiv=Pragma content=no-cache /
meta http-equiv=Expires content=-1 /
/head



[flexcoders] Weired Focus Change behaviour on tab pressing

2009-03-13 Thread anuj181
Hi Guys
I am trying to make the focus changed consistently to different components in 
my app but it is showing different behavior when user presses tab. Few things 
are happening here if one of the radio button from the first radio group has 
been selected then pressing tab button will keep on cycling through first 3 
components and if the radio buttons are not selected then changing focus on the 
tab pressing works fine, All I need is that whenever user presses tab key, it 
changes the focus consistently through all of the components(doesn't matter if 
the radio button is selected or not) and the same behavior will be followed 
when user presses the shift+Tab.
Anyone has any idea about whats going on here,Please help me in fixing this 
issue,
Thanks a lot
geekyDeveloper
/***CODE***/
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute
mx:VBox width=100% height=100% 
paddingTop=5 paddingRight=5 paddingBottom=5 
paddingLeft=5

mx:Label text=NSM Settings styleName=textLarge 
fontStyle=italic width=200/

mx:Form id=formMainContainer width=100% verticalGap=5 
indicatorGap=25 labelWidth=200
paddingTop=0 paddingRight=0 paddingBottom=0 
paddingLeft=0 height=262

!-- Unit Settings --  
mx:FormItem label=Unit Settings 
labelStyleName=textLarge width=100% height=25 paddingTop=10
mx:HRule width=100% height=2/ 
/mx:FormItem
mx:FormItem label=Unit Role 
labelStyleName=textMedium
mx:RadioButtonGroup id=unitRoleGroup /
mx:HBox
mx:RadioButton label=Manager 
group={unitRoleGroup} styleName=textMedium/
mx:RadioButton label=Member 
group={unitRoleGroup} styleName=textMedium/
/mx:HBox
/mx:FormItem
mx:FormItem label=Unit Name labelStyleName=textMedium
mx:TextInput id=txtUnitName 
styleName=inputTextMedium restrict=a-zA-Z0-9_ 
/
/mx:FormItem
mx:FormItem label=Time Zone labelStyleName=textMedium
mx:ComboBox id=cboTimeZone /
/mx:FormItem

!-- Network Settings --
mx:FormItem id=networkSettingsForm 
mx:RadioButtonGroup id=networkSettingsGroup/
mx:HBox
mx:RadioButton id=radioButtonDHCP 
label=DHCP group={networkSettingsGroup} styleName=textMedium/
mx:RadioButton label=Static 
group={networkSettingsGroup} styleName=textMedium/
/mx:HBox
/mx:FormItem
mx:FormItem label=Label
mx:Button label=Button/
/mx:FormItem
mx:FormItem label=Label
mx:Button label=Button/
/mx:FormItem
mx:FormItem label=Label
mx:Button label=Button/
/mx:FormItem

/mx:Form

/mx:VBox

/mx:Application




[flexcoders] Problem in sorting XMLList collection as a dataProvider for the list

2009-03-05 Thread anuj181
Hi Guys
I am trying to sort the xmllist collection which is the dataprovider for the 
list. As the implementation of name-value pairs, i am displaying the entries in 
form of string in List and would like to sort all the data displayed in the 
List alphabetically, I am making a call through amfphp call to grab data from 
backend and populate XMLListCollection but now I need to sort the data in the 
list. Below is the code,Can anyone please help me where I am messing things up. 
Also please let me know if there is any question regarding the code and if 
there is better way of doing it.

Thanks

/**CODE/

mx:RemoteObject id=amfSetup source=Setup destination=amfphp  
mx:method name=getList result=getListHandler(event); 
fault=getListFault(event);/
/mx:RemoteObject


[Bindable] private var entriesXmlListFull:XMLList;
[Bindable] private var entriesXmlCollection:XMLListCollection;


public function getListHandler(event:ResultEvent):void
{   

entriesXmlListFull = XML(event.result).device;
populateEntries();
}
private function getListFault(event:FaultEvent):void
{
Alert.Show(Error retreiving Data);
}

//Displaying names need to be displayed in the List box
private function entriesLabelFunc(item:Object):String
{
var xmlItem:XML = item as XML;

return xmlItem..attribute.(@name==friendlyname);
}

//Populating List with XML Objects
private function populateEntries():void
{
entriesXmlCollection = new XMLListCollection(); 


for each(var item:XML in entriesXmlListFull)
{

var friendlyName:String = 
item..attribute.(@name==friendlyname);
//Only add camera type
if ( !recordValue  hasFriendlyName  
(itemType.toUpperCase() == CAMERA) )
{
entriesXmlCollection.addItem(item);
}
}

//Calling Sort on XMLList collection
entriesXmlCollection.sort = sortList;
entriesXmlCollection.refresh();  


}


mx:Sort id=sortList
mx:fields
mx:SortField name=* caseInsensitive=true /
/mx:fields
/mx:Sort

mx:List id=listData dataProvider={entriesXmlCollection} 
labelFunction=entriesLabelFunc/



[flexcoders] Problem in Sorting XMLListCollection (which is dataProvider for) the List

2009-03-05 Thread anuj181
Hi Guys 
I am trying to sort the dataProvider in the list which is in the form of 
XMLListCollection, I am using amfPHP for grabbing data in the form of 
XMLListCollection and for the display purpose I am using labelfunction to 
display just the friendly name of my entries which is the specific attribute 
from the XMLListCollection. I went through few tutorials online for sorting and 
came up with the following code but some how this is not working, Can any one 
please help me in figruing out whats going on here and why sorting of the list 
is not working,
Thanks


/**CODE*/
mx:RemoteObject id=amfSetup source=Setup destination=amfphp  
mx:method name=getList result=getListHandler(event); 
fault=getListFault(event);/
/mx:RemoteObject


[Bindable] private var entriesXmlListFull:XMLList;
[Bindable] private var entriesXmlCollection:XMLListCollection;


public function getListHandler(event:ResultEvent):void
{   

entriesXmlListFull = XML(event.result).device;
populateEntries();
}
private function getListFault(event:FaultEvent):void
{
Alert.Show(Error retreiving Data);
}

//Displaying names need to be displayed in the List box
private function entriesLabelFunc(item:Object):String
{
var xmlItem:XML = item as XML;

return xmlItem..attribute.(@name==friendlyname);
}

//Populating List with XML Objects
private function populateEntries():void
{
entriesXmlCollection = new XMLListCollection(); 


for each(var item:XML in entriesXmlListFull)
{

var friendlyName:String = 
item..attribute.(@name==friendlyname);
//Only add camera type
if ( !recordValue  hasFriendlyName  
(itemType.toUpperCase() == CAMERA) )
{
entriesXmlCollection.addItem(item);
}
}

//Calling Sort on XMLList collection
entriesXmlCollection.sort = sortList;
entriesXmlCollection.refresh();  


}


mx:Sort id=sortList
mx:fields
mx:SortField name=* caseInsensitive=true /
/mx:fields
/mx:Sort

mx:List id=listData dataProvider={entriesXmlCollection} 
labelFunction=entriesLabelFunc/




[flexcoders] Re: Problem in Sorting XMLListCollection (which is dataProvider for) the List

2009-03-05 Thread anuj181
This is my first e-mail to this group with the new e-mail address, i am just 
trying to make sure if this group is receiving my e-mails as nobody has replied 
yet, Please send me the test reply so that I know if you guys are receiving my 
mails
Thanks
--- In flexcoders@yahoogroups.com, anuj181 geekydevelo...@... wrote:

 Hi Guys 
 I am trying to sort the dataProvider in the list which is in the form of 
 XMLListCollection, I am using amfPHP for grabbing data in the form of 
 XMLListCollection and for the display purpose I am using labelfunction to 
 display just the friendly name of my entries which is the specific attribute 
 from the XMLListCollection. I went through few tutorials online for sorting 
 and came up with the following code but some how this is not working, Can any 
 one please help me in figruing out whats going on here and why sorting of the 
 list is not working,
 Thanks
 
 
 /**CODE*/
 mx:RemoteObject id=amfSetup source=Setup destination=amfphp
   mx:method name=getList result=getListHandler(event); 
 fault=getListFault(event);/
   /mx:RemoteObject
 
 
   [Bindable] private var entriesXmlListFull:XMLList;
   [Bindable] private var entriesXmlCollection:XMLListCollection;
   
 
   public function getListHandler(event:ResultEvent):void
   {   
   
   entriesXmlListFull = XML(event.result).device;
   populateEntries();
   }
   private function getListFault(event:FaultEvent):void
   {
   Alert.Show(Error retreiving Data);
   }
 
   //Displaying names need to be displayed in the List box
   private function entriesLabelFunc(item:Object):String
   {
   var xmlItem:XML = item as XML;
 
   return xmlItem..attribute.(@name==friendlyname);
   }
 
   //Populating List with XML Objects
   private function populateEntries():void
   {
   entriesXmlCollection = new XMLListCollection(); 
 
 
   for each(var item:XML in entriesXmlListFull)
   {
   
   var friendlyName:String = 
 item..attribute.(@name==friendlyname);
   //Only add camera type
   if ( !recordValue  hasFriendlyName  
 (itemType.toUpperCase() == CAMERA) )
   {
   entriesXmlCollection.addItem(item);
   }
   }
   
   //Calling Sort on XMLList collection
   entriesXmlCollection.sort = sortList;
   entriesXmlCollection.refresh();  
 
   
   }
   
 
   mx:Sort id=sortList
   mx:fields
   mx:SortField name=* caseInsensitive=true /
   /mx:fields
   /mx:Sort
 
   mx:List id=listData dataProvider={entriesXmlCollection} 
 labelFunction=entriesLabelFunc/





[flexcoders] fscommand in AIR

2009-01-28 Thread anuj181
Does anyone know that can I use fscommand in AIR application? Does not
seem its working in AIR. Works perfectly in Flex/Flash
Thanks
Anuj



[flexcoders] Guidance Needed about the organization of flex project and MXML Componenets

2009-01-23 Thread anuj181
Hi Flex Coders,
I have been taken over one project started by some other programmer,
The project asks user to login and after user logs in , different custom
MXML Components are loaded. Thats the bigger picture what the project
needs to do.
  The way this project was organized that the developer created the login
component , and other custom MXML Component and put them in different
canvases and then put login in one ViewStack and the other MXML
Componenets in another stack, By default on the load of the application,
ViewStack with login Canvas is set to true and if user enter right
password then the visibility of other stack having different custom
components are set to true and login was set to false.
The ToggleButtonBar was used whose data provider is second view stack
having 3 other custom MXML component, and depending upon the button of
the toggle bar selected the components are being loaded. All the
viewstacks with the canvases are being loaded on the main app on the
load of the application.

  I am  not sure thats the right way. In ideal world I like whenever user
loads the page, only the login page will be loaded and once the correct
credentials are entered, only the default MXML Component will be added
with the ToggleButtonBar's default selection, I have to reorganize the
structure of the project, I was thinking of adding and removing child
depending upon the tab changed, Is there any better way to organize this
project, Ideally I like to refresh the page while loading different MXML
components on the tab selection so that we might get the component
totally in synchronization with the server, Anyone has nice and better
way of organizing Project without setting the visibility true and false
and also fulfilling my requirement.
Any Help and guidance will be appreciated
Thanks
Anuj


[flexcoders] General Guidance requested to detect if any component has been changed or not

2009-01-16 Thread anuj181
Hi Group 
I need general guidance in achieving something. I have a form having
different components like text box, radio button and list boxes
(having drag and drop capability). I have Save and Cancel Button and
when the form loads, the Save button is disabled, Now my requirement
is that as soon as user makes any changes on the form. By Any I mean
either radio button selection changed, or text input entries changed
or list box items changed, I need to detect if user changes any field
and depending on that I have to enable Save Button.There is quick and
dirty way of setting a global Boolean variable which can be set 'true'
on any component's change but is there any better way for achieving
what I am looking for. All i need is to enable the disabled button on
changes made to the form.
Any guidance in achieving or improvement in achieving this task will
be appreciated.
Thanks
Anuj



[flexcoders] Need some Help in implementing Log out functionality

2009-01-15 Thread anuj181
Hi
I have implemented Log Out functionality in my App, All I did is that
as soon as user clicks Log Out button, the code is going to reload the
whole App which will automatically take the user to the login screen
as login is the first screen in my flex App. Now My probelm is that I
need some feedback to give to the user that he has been logged out. I
am successfully in taking user to the login page but somehow could not
figure out how will I show the feedback, The idea i came up is may be
add string to the URL if user logs out and if the URL string matches
the added string should display a label in the main login page showing
You have successfully logged out, but my following code is not
working. Is there any better way to do this or please let me know
where things are being screwed up, For the time being I just put dummy
alerts but they will be replaced with the actual Labels.

All i need is the first time user logs in should just display the
login screen but if user logs out he should be directed to the same
login screen but with added label You have succesfully logged out
Thanks
Anuj

//Logging Out of the App
mx:Image id=_imgLogOut height={ImgHt} width={ImgWidth} x=941
y=96 click=_logOut(event);
private function _logOut(event:MouseEvent):void
{   
var selfLoad:URLRequest=new
URLRequest(Application.application.url+?logout=true);
navigateToURL(selfLoad,_self);
}
private function initApp():void
{
//Checkign if the User logged out and Displaying  the message and
relaoding the App
var _DefaulturlString:String=Application.application.url;
var
_loggedOutURLString:String=_DefaulturlString+?logout=true; 

  
if(Application.application.navigateToURL(_loggedOutURLString))
{
Alert.show(Logged Out);
}
else
{
Alert.show(First Time);
}





[flexcoders] Graying out the Tab Selection of the parent App

2009-01-14 Thread anuj181
Hi All
I am trying to disable the canvas in ToggleButtonBar in my parent app,
Actually I am setting the disable property from differnt module of my
app. My disabling is working fine but I like to give it a grayed out
look, so I like to set the blurX or blurY property or give it a color,
The problem here is even if I set the blurX or blurY, it is not
showing the effect and on the other hand it is not accepting color
property, I am not sure how would I give tab in my parent app the
disabled look. Please help if anyone knows how to fix it.

Thanks

Following is my code


/*Parent App MXML Code*/
mx:Canvas id=_parentCanvas 

!-- Content Area--
mx:ViewStack top=53 id=ContentStack resizeToContent=true

mx:Canvas label=Settings id=tab_Config enabled=true
ackgroundAlpha=3/mx:Canvas 
/mx:Canvas
/mx:ViewStack 

!-- Main navigation tab bar. Goes after ContentStack since it uses it
as a dataProvider. --
mx:ToggleButtonBar paddingTop=0 paddingBottom=0 
id=TabBarMain
direction=vertical 
 dataProvider=ContentStack width=95 height=297 
x=274 y=248/
/*Function Call from Module

//Working Fine
private function _Display():void
{
if (_group.selectedValue == 'Disabled')
{
parentApplication.tab_Config.enabled = false;
parentApplication.tab_DashBoard.label=;
//Does Not show Any effect
parentApplication.tab_Config.blurX = 10;
parentApplication.tab_DashBoard.blurY=10;
//Gives Error
parentApplication.tab_DashBoard.color='#ff';
}
}



[flexcoders] Generating Random key

2009-01-05 Thread anuj181
Hi 
I need to work on a piece of code in which whenever user clicks on the
button , the code should generate random 12 character key having all
caps and no vowels in the format of XXX-XXX-XXX-XXX. Can anybody guide
me in this direction. Is there any built in function for that or do I
have to use my own logic for random generation in this specific case.
Any help will be appreciated.
Thanks
Anuj



[flexcoders] Trying to pass data in different module

2008-12-19 Thread anuj181
Hi 
I am trying to set the visibility of some components which are in
different modules and my code is not working. There is login screen in
which i have provided forgot password link and in which there are 3
components which are by default set invisible. Whenever user changes
his password by going into the system i an using amfPHPH for sending
data to server and as soon as data is sent then I need to enable the
visibility of the hidden components true, The sending of data is in
different module. . My program is grabbing the data from PHP but it is
not setting the visibility of the components true, I guess I am
screwing in module communication in my program.I have two module one
if ForgotPassword.mxml in login folder and my other module where I am
re setting the password is seperate folder named AccountSettings and
the file name is AccountSetting.mxml. I imported the moudle and it is
showing all the properties of my imported module but is not switching
the visibility property and even if the data has been changed still
the components have been invisible. Can anyone please help me in
fixing this issue.
Thanks for your help
Below is my code

/*Forgot Password Module*/
mx:TextInput id=txt_Enter_SecurityAnswer x=190 y=97 width=213
visible=false/

mx:Button id=enterSecurityQuestion x=275 y=138 label=Enter
visible=false/

mx:Label id=lblCS x=411 y=99 text=Case Sensitive width=205
visible=false/
/*Account Setting Module*/
import com.Pelco.login.ForgotPassword;

public var ForgotPasswordComponenetVisibility:ForgotPassword=new
ForgotPassword();
public var boolSaveConfirmed:Boolean;
function onclickSave(evt:MouseEvent):void
{
//Storing data back to server
amf.writePassword.send(_newPassword);
boolSaveConfirmed=true;
}

//This boolean checks if the button has been clicked
if(boolSaveConfirmed)
{
//Setting the state of the forgot password components to visible on
setting new password and security question


ForgotPasswordComponenetVisibility.lblCS.visible=true;

ForgotPasswordComponenetVisibility.enterSecurityQuestion.visible=true;

ForgotPasswordComponenetVisibility.txt_Enter_SecurityAnswer.visible=true; 
}




[flexcoders] When can Browser Compatibility issues happen with the Flex App

2008-12-18 Thread anuj181
Hi All
I have a release build of my project which when I have couple of issues. 
When I put that release folder on the server (which is Linux Box in my
case having apache server), the file would show up fine in IE 7.0 but
displays as plain text (displaying bunch of javscript and HTML code)
in FireFox 3.0.4. What can be the reasons for that.

Secondly there is release issue also going on. I created my main
project file named index.mxml. Technically what I need is as soon as
user hits the IP of the server it should load my app but it does not
show the app. However when user types http://IP.index.html, eveything
is being shown properly. I am not sure how will i fix both the
problems, Does this have to do with the build people problems or is
there any apache server settings needs to be changed. I have not seen
these kind of issues in the past, so please help if anyone has any
idea how can i fix these issues.
Thanks a lot
Anuj




[flexcoders] How would I Overwrite contents of External XML File

2008-12-15 Thread anuj181
Hi All
I am working on change password option for the user, I am reading
password content from external XML Files and then depending upon the
added value I need to overwrite the external XML's files passsword
entry. I am using following code for changing it but it is not
working, My XML file is in the external folder but withtin the same
project and this is one of the component which i am calling on click
of some button. I need to overwrite data in Login.xml which is stored
in Private folder as the separate folder in my project, Reading from
thh xml file is no problem but writing back is an issue,
Does anyone know where I am screwing things up?

Many Many Thanks for your help
Anuj
//My XML
?xml version=1.0 encoding=utf-8?
Users
user
id1/id
userNameasasasd/userName
passwordasasd123/password
securityQuestionTest Security Question/securityQuestion
answerSecurityQuestion/answerSecurityQuestion
/user
/Users


/CODE***/

mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; 
creationComplete=init(); 
 horizontalScrollPolicy=off verticalScrollPolicy=off
public function init():void
{
var getPassword:URLRequest=new 
URLRequest(Private/Login.xml); 
passwordLoader = new URLLoader();  
  
try 
{
passwordLoader.load(getPassword);   
}
catch (error:SecurityError)
{
trace(SecurityError has occurred while loading 
password);
}

passwordLoader.addEventListener(Event.COMPLETE,getAlreadySetPassword);
}

//ChangePassword

 public function changePassword(evt:MouseEvent):void
 {

if((txt_Enter_Password.text==)||(txt_ReEnter_Password.text==)||

(txt_Security_Question.text==)||(txt_Security_Answer.text==))
{
Alert.show(Please Check the values 
entered. They cannot be
null); 
}
else 
if(txt_Enter_Password.text!=txt_ReEnter_Password.text)
{
Alert.show(Passwords do not match);
}
else
{

externalXMLPassword.user.password=txt_Enter_Password.text;

externalXMLPassword.user.securityQuestion=txt_Security_Question.text;

externalXMLPassword.user.answerSecurityQuestion=txt_Security_Answer.text;

}
 }

mx:Button x=630 y=402 label=Save click=changePassword(event);/



[flexcoders] Getting NULL Object Reference while deleting last element of the list

2008-12-11 Thread anuj181
Hi Guys
I am trying to implement the delete entries of the list box. The code
works fine till the last entry, when i am trying to delete the last
item after selection it is throwing error TypeError: Error #1009:
Cannot access a property or method of a null object reference.
I have seen this error so many times but I am not sure how will i fix
this in the following code. Please help me in fixing this error
Thanks
Anuj

/*CODE*/

mx:Button x=322 y=237 label=Add id=_addButton
click=addToAssociatedDevices(event)/

  private function addToAssociatedDevices(evt:MouseEvent):void
{  
var _addDevicesLen:int=devicesInList.length;
var _addToAssociatedDevicesArr:Array;


for(var i:*=0;i_addDevicesLen-1;i++)
{
_addToAssociatedDevicesArr=nvrsInPoolList.selectedItems;

 
}
if((_addToAssociatedDevicesArr is
Array)(_addToAssociatedDevicesArr!=null))
{
var removeIndex:int = 0;
for each (var addItemVal:* in 
_addToAssociatedDevicesArr) 
{
if(addItemVal!=null)
{

IList(camerasInPoolList.dataProvider).addItem(addItemVal as Object);
//Adds a device to the Add To Camera Pool list
arrAddToPool.push(addItemVal);  
//Removes a device from the Remove From 
Pool list
removeIndex = 
arrRemoveFromPool.indexOf(addItemVal);
if(removeIndex  -1) {

arrRemoveFromPool.splice(removeIndex,1);
}   
}
}

}
for(var t:*=0;t_addToAssociatedDevicesArr.length;t++)
{  
if(nvrsInPoolList!=null)
{   


IList(nvrsInPoolList.dataProvider).removeItemAt(nvrsInPoolList.selectedIndex);
}   
}   
}




[flexcoders] Filtering working partially, Looping through just the first node of XML.Pls Help

2008-12-09 Thread anuj181
Hi All
Guys This is regarding the problem I had few days back. I made
filtering of the List partially working for my app after taking some
help from this group, but I realize a bug in my program. I am making
rest calls to load data in form of XML in List. I need to apply filter
on this list. Depending upon the text entered in the text box , the
list should filter. Now my problem is that the filter is working if
user types the id of my XML node, however I want my code to go through
all the XML file and checks if the entered text matches the attribute
named friendly name and will filter depending upon the friendly name.
Please help me out, Below is the code and I would appreciate if
someone gives me right direction to make it completely working, Please
let me know also if the code is not documented correctly to make it
more sense
Thanks
Anuj
//XML File
devices
device id=uuid:ac14231535625133346546
attributes
attribute name=Flex/
attribute name=monitormonitoring/attribute
attribute name=version2.0/attribute
attribute name=locationlocation/attribute
attribute name=friendly-nameCamera1/attribute
attribute name=typeAIR/attribute
/attributes
schedules/
/device
/devices
/**CODE*/
//This is REST CALL
mx:HTTPService id=devicesXML method=GET resultFormat=e4x
result=devicesXMLHandler(event) showBusyCursor=true

/mx:HTTPService   
//THis makes call to server
devicesXML.url=http://+IP+/config/devices;;
//Thid function is called when values are retreived
private function devicesXMLHandler(event:ResultEvent):void
{
devicesList = event.result.device;

//Checks every device
for each (var devicesInPool:* in devicesList) {
var deviceName:String = [EMAIL 
PROTECTED];
//var label:[EMAIL PROTECTED];  

devicesInList.push(deviceName);
filteredDevices=new 
ArrayCollection(devicesInList); 

nvrsInPoolList.dataProvider = filteredDevices;
filteredDevices.filterFunction=processFilter;
}

//This function calls for assigning label for the entries in the List
box named nvsInPoolList 

private function assignFriendlyName(item:Object):String
{   
//Checks every device
for each (var devicesID:* in devicesList) {
var deviceName:String = [EMAIL 
PROTECTED];
//Checks if the current deviceID 
matches the current item, if so
it will search its attributes
if(deviceName == item.toString()) {
var devicesText:XMLList =
devicesID.child(attributes).child(attribute);
//Checks every attribute tag 
for each device
for each (var 
attributesFriendlyName:* in devicesText) {
//Checks if the 
attribute name is friendly-name
if([EMAIL PROTECTED] == 
'friendly-name') {
var 
friendlynameText:String = attributesFriendlyName.toString();
return 
friendlynameText;
}   
}

}
}   
return item.toString();
}   
//Filtering Data in the Device List
private function processFilter(item:Object):Boolean
{
return
String(item).toUpperCase().indexOf(filterText.toUpperCase()) = 0;
}
//Tracking the typed Camera Name 
private function doChange():void
{
if(txtSearch.text!=null)
{
this.filterText=txtSearch.text;
this.filteredDevices.refresh();
}   
}   

mx:List id=nvrsInPoolList allowMultipleSelection=true

[flexcoders] Filtering the List Entries depending upon the text entered in text Input box

2008-12-03 Thread anuj181
Hi All
This is somehow regarding the question I have asked few weeks back.
Unfortunately I have to stop this task at that time and now need to
work on that. My need is that I have some entries in the List as an
arrayCollection and there is text input box and I like to have list to
filter the data as soon as user starts typing text. I have attached
the so far developed code. I need as soon as user types On, the list
below should only show first entry which is 'One-Device'. I attached
the code but it is not working as I want. This is going to be just my
dummy working prototype and once this module has been made working
then i am going to merge this module into my Main Project.

Also if anyone has any better idea about how to figure this thing out
that will be great and instead of arrayColection if we can achieve the
same function laity that would be helpful too.
Thanks a lot
Anuj 

/**CODE/
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 
layout=absolute
initialize=init() 
width=100% height=100%
horizontalScrollPolicy=off
mx:Script
![CDATA[   

import mx.managers.PopUpManager;
import mx.effects.DefaultTileListEffect;  
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
import mx.collections.ArrayCollection;
import mx.effects.easing.Elastic;

[Bindable]
public var ac:ArrayCollection = new
ArrayCollection([One-Device,Two-Device,Three-Device,Four-Device,Five-Device,Six-Device]);
  
[Bindable]
public var filterText:String = '';

private function doChange():void
{
this.filterText = txtSearch.text;
this.ac.refresh();
}

private function init():void
{
ac.filterFunction = processFilter; 
}
private function processFilter(item:Object):Boolean
{
var result:Boolean=false;
if(!DevicesList.labelField.length ||
DevicesList.labelField.toUpperCase().indexOf(this.filterText.toUpperCase())=0)
result=true;

return result;
}
private function seeLabel(evt:Event):void
{
var alrt:Alert=Alert.show(evt.currentTarget.toString());
}

]]
/mx:Script
mx:List x=74 y=228 width=229 height=238 dataProvider={ac}
id=DevicesList/mx:List
mx:TextInput x=74 y=198 id=txtSearch change=doChange()/


/mx:Application




[flexcoders] Fwd: Filtering the List Entries depending upon the text entered in text Input box

2008-12-03 Thread anuj181
--- In flexcoders@yahoogroups.com, anuj181 [EMAIL PROTECTED] wrote:

Hi All
This is somehow regarding the question I have asked few weeks back.
Unfortunately I have to stop this task at that time and now need to
work on that. My need is that I have some entries in the List as an
arrayCollection and there is text input box and I like to have list to
filter the data as soon as user starts typing text. I have attached
the so far developed code. I need as soon as user types On, the list
below should only show first entry which is 'One-Device'. I attached
the code but it is not working as I want. This is going to be just my
dummy working prototype and once this module has been made working
then i am going to merge this module into my Main Project.

Also if anyone has any better idea about how to figure this thing out
that will be great and instead of arrayColection if we can achieve the
same function laity that would be helpful too.
Thanks a lot
Anuj 

/**CODE/
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 
layout=absolute
initialize=init() 
width=100% height=100%
horizontalScrollPolicy=off
mx:Script
![CDATA[   

import mx.managers.PopUpManager;
import mx.effects.DefaultTileListEffect;  
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
import mx.collections.ArrayCollection;
import mx.effects.easing.Elastic;

[Bindable]
public var ac:ArrayCollection = new
ArrayCollection([One-Device,Two-Device,Three-Device,Four-Device,Five-Device,Six-Device]);
  
[Bindable]
public var filterText:String = '';

private function doChange():void
{
this.filterText = txtSearch.text;
this.ac.refresh();
}

private function init():void
{
ac.filterFunction = processFilter; 
}
private function processFilter(item:Object):Boolean
{
var result:Boolean=false;
if(!DevicesList.labelField.length ||
DevicesList.labelField.toUpperCase().indexOf(this.filterText.toUpperCase())=0)
result=true;

return result;
}
private function seeLabel(evt:Event):void
{
var alrt:Alert=Alert.show(evt.currentTarget.toString());
}

]]
/mx:Script
mx:List x=74 y=228 width=229 height=238 dataProvider={ac}
id=DevicesList/mx:List
mx:TextInput x=74 y=198 id=txtSearch change=doChange()/


/mx:Application

--- End forwarded message ---




[flexcoders] Is there any Name -Value Pair concept for Arrays?

2008-12-01 Thread anuj181
Hi All
I am retrieving some data using HTTP from PostGres database. I would
be successfully able to put all the entries in UDN's in the list box
(using REST Calls). Now my requirement is that I need to display an
attribute name Friendly name which is already in the database as the
label (VISUAL entry ) in the list but when user performs different
operations like drag and drop, I need the complete string in form XML
to be send. So to make long story short I need to display friendly
name as list entries but behind the curtain that label have exact
complete value coming from the Database. Now is there any way that I
can tell my data provider (which is an Array in my case) that to
display just the specific attribute for the database and while doing
operation send the whole value.
Any links, examples and help will be appreciated.
Thanks
Anuj



[flexcoders] How to send data as XML (data is loaded through HTTP in List Box)

2008-11-25 Thread anuj181
Hi All
I use HTTP service to load data in List Box. I pasted code below, Now
I need to allow drag and drop operation which I am successfully able
to do that. However once items are dropped in second list , I need to
wrap up the data as XML and send it to server , I guess i will use
'POST' method for that. Now root of my problem is when I am dragging
and dropping items from one list to another, it is dropping just the
label of the entries in form of string(XML List) but not the full XML
node. From visual perspective it looks fine but what I need is to send
data as an XML simply as simply sending the string would not process
the necessary update to the database. Can anybody help me in getting
hold of data in my list as XML but not as simple strings. Any help
will be appreciated.
Thanks
Anuj

/***My Code/
 
mx:HTTPService id=devicesXML method=GET resultFormat=e4x
result=devicesXMLHandler(event) showBusyCursor=true

/mx:HTTPService

private function devicesXMLHandler(event:ResultEvent):void
{
devicesList = event.result.device;
devicesCollection = new 
XMLListCollection(devicesList);

nvrsInPoolList.dataProvider = devicesInList;
}

mx:List id=nvrsInPoolList change=selectionChangehandler(event)
allowMultipleSelection=true dragMoveEnabled=true
dragEnabled=true dropEnabled=true y=105 x=17 height=462
width=294/



[flexcoders] How to Add and Remove items from one list to another on click of button

2008-11-24 Thread anuj181
Hi All
I am trying to move multiple items from one list to another on click
of Add button. Please correct me if I am wrong. I have data provider
for both these lists as an array and I was thinking that for adding I
need to put the selected items in another array and need to add that
array items in first list and delete those items from the second list.
Does anyone know how would i achieve that functionality and is this
the right approach, My data provider is dynamic and I used HTTP
service to constantly update my database. Can anyone help me in moving
selected items from one list to another on click of button. Any links,
examples and help will be appreciated
Many Many Thanks in advance.
Anuj





[flexcoders] Moving of item is not working in List

2008-11-21 Thread anuj181
Hi Guys
I displayed data in 2 lists (A and B) using HTTP service. I need to
move data from one list to another. I already implemented the easier
way (the drag and drop). However I need to implement the same
functionality if user clicks on ADD button and remove button. If user
clicks on 'Add' Button the selected List from A needs to be removed
from A and added to B. And if user clicks on Remove the selected items
from List B needs to be removed from B and added to A. I implemented
the following code but it is not working. Can anyone fix this code for
me or let me know where I am messing it up.
Please let me know.
Thanks in advance for your help

/*Code*/
[Bindable]
private var cameraPoolList:Array=new Array();
[Bindable]  
private var devicesInList:Array=new Array();
/* 
 private function addToAssociatedDevices(evt:MouseEvent):void
{  
var _addDevicesLen:int=devicesInList.length;
var _addToAssociatedDevicesArr:Array=new
Array(_addDevicesLen);

for(var i:*=0;i_addDevicesLen-1;i++)
{

_addToAssociatedDevicesArr[i]=nvrsInPoolList.selectedItem;
 
}
cameraPoolList.push(_addToAssociatedDevicesArr);

mx:List id=nvrsInPoolList allowMultipleSelection=true
dragMoveEnabled=true dragEnabled=true dropEnabled=true y=105
x=17 height=462 width=294/
mx:List id=camerasInPoolList allowMultipleSelection=true
horizontalScrollPolicy=on dragMoveEnabled=true dragEnabled=true
dropEnabled=true width=265 height=462 y=105 x=385 /
mx:Button x=322 y=237 label=Add id=_addButton
click=addToAssociatedDevices(event)/
}   



[flexcoders] How to SelectAll entries in List

2008-11-20 Thread anuj181
Hi Guys
In the list allowMultipleSelection allows me to select multiple
entries of the list box. How would i implement the 'Select All'
functionality, I need all the entries of the list to be selected if I
click on the button. Pls let me know
Thanks in advance
Anuj



[flexcoders] Getting IP address of the local machine

2008-11-19 Thread anuj181
Hi 
Is it possible to get the IP Address of the serveron which you Flex
App is running. My requirement is that I need to get the IP address of
the server .
Please let me know if Flex supports getting the IP address of the
server machine, I know we can do that with PHP but i am just wondering
if its possible with Flex exclusively.
Thanks in advance
Anuj



[flexcoders] Filtering data using HTTP

2008-11-18 Thread anuj181
Hi Guys
I am getting data in list box. I am using HTTP Service for getting all
the entries and I filtered my list with the entries having the node
named as 'pool'.
My question is how would i get all the entries in the list except the
entries with the pool in the list. Basically i have all the data and
the list having the data with id as 'pool', All i need is all the
entries from my data without id 'pool'. Below is my code for getting
entries for the pool name. Please let me know if anyone has any idea.
Thanks
Anuj

/*Code*/
mx:HTTPService id=devicesXML method=GET resultFormat=e4x
url=http://10.50.5.47:8182/config/devices;
result=devicesXMLHandler(event) showBusyCursor=true


private function devicesXMLHandler(event:ResultEvent):void
{
devicesList = event.result.device;
devicesCollection = new XMLListCollection(devicesList); 


//Checks every device
for each (var devicesInPool:* in devicesList) 
{
var deviceName:String = [EMAIL PROTECTED];  
devicesInList.push(deviceName); 
var devicesText:XMLList =
devicesInPool.child(attributes).child(attribute);
//Checks every attribute tag for each device
for each (var attributesInPool:* in devicesText) {
//Checks if the attribute name is pool
if([EMAIL PROTECTED] == 'pool') {
//Sets a variable to equal the name of the pool 
var poolnameText:String = attributesInPool.toString();
//Checks if the pool name matches devices in the current pool
if(poolnameText ==
poolsCollection.attributes().toString())
{   


cameraPoolList.push(deviceName);
} 
}   
}
}



[flexcoders] Does Smart Serach like 'You tube' does possible in Flex ?

2008-11-18 Thread anuj181
Hi Guys
If you go to You tube and when you start typing stuff then you get
suggestions for the related text you types. I have requirement
something like this. I pulled the data in my list box and we have to
make it search able like if user starts typing in the text box say
'Adobe..', the list containing the original data starts getting
filtered with the entries starting with name 'Adobe' . if the user
does not enter anything in the text box, he/she will receive the
original list with the complete data. My question to you genius guys
is that is it possible in Flex 3.0/AS 3.0 or should i go through some
other language. I read somewhere that it can be done using AJAX but I
like to achieve this functionality using Flex.
Please let me know if this is doable , any help/links will also be
appreciated.
Thanks
Anuj



[flexcoders] Gettign data from the list and putting into an array

2008-11-12 Thread anuj181
Hi Guys
I am moving data from one list(A) to another(B) using drag-drop
manager. The data is showing fine in both the lists, it is basically
moving the selected entries form one list to another. Now my
requirement is as soon as user clicks on a 'Add Button' , my code
should put all the entries in list B in an array. Basically i want to
retrieve the contents of List B (which were dragged from List A) and
put them in an array.
Also is there any way to empty the filled list too. I like if user
hits 'Cancel' button the List B should be empty.
Please let me know if you have any idea about the solution of above
problems.
Thanks
Anuj




[flexcoders] Setting cursor to particular text box on the application load

2008-11-11 Thread anuj181
Hi 
Is it possible to set the cursor to the text input while your app
loads. I am using setFocus to particular text input but it is just
setting the focus to my text box but not the cursor. Is it possible to
set the cursor to the text box on the app load.
Thanks
Anuj



[flexcoders] Basic auto Update of Flex UI with the Postgres database

2008-11-10 Thread anuj181
Hi Guys
I asked his question earlier too and you guys were helpful in giving
me solution but i ended up implementing solution which consume lot of
resources . 
I have a tree which is getting data from Postgres though HTTP service
and binding data in XMLList. As soon as new entry has been added to
the database I need my Tree to be updated. I set a timer and what that
timer does is it calls that HTTP service (And goes through Postgres)
after some time and load all the entries back to the Tree. Now this
solution works but the solution would be pain if there are 2000
entries in the database and a new entry has been added, then it loops
through all the 2000 entries and put all these entries in the Tree
which takes lots of resources.
In short what i need is that the timer should only go through the
database when new entry has been added in the database and istead of
loading all the entries in the Tree it should only load the added entry. 
Please let me know if it is possible to do and if yes which way should
I go. Should I target changing the Flex code or does it have to be
done through post gres. Your help will be appreciated. Below is code
Thanks
Anuj
/*Code*/
mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml;
creationComplete=initApp();
xmlns:nimer=com.mikenimer.components.datagrid.*
 height=758 y=10 x=260 width=800
backgroundImage=contentPanelTest.swf  backgroundColor=#92959E
 horizontalScrollPolicy=off verticalScrollPolicy=off

mx:HTTPService id=devicesXML method=GET resultFormat=e4x
url=http://10.80.3.56:8182/config/devices;
result=devicesXMLHandler(event) showBusyCursor=true

public function initApp():void
{
pollHttpService();
//Set the Timer

timer.addEventListener(TimerEvent.TIMER,onTimer);
timer.start();
}
private function onTimer(event:TimerEvent):void
{
pollHttpService();  
} 
//Sets up the URL and invokes Send
private function pollHttpService()
{
var sTime:String=new Date().toTimeString();
var sURL:String=_sURLData+?time=+sTime;
trace(url=+sURL);
devicesXML.url=sURL; //to avoid caching
devicesXML.send();  //call for data 
}


mx:Tree
 dataProvider={devicesCollection}
 labelField=@id
 dropEnabled=false
 dragEnabled=true  
 dragMoveEnabled=false
 labelFunction=treeLabel
 y=79 x=17 height=541 width=317/



[flexcoders] Casting Problem Dragging from one list and Dropping into another

2008-11-06 Thread anuj181
Hi Guys
I am trying to drag contents of one list and drop it into the second List.
I am having issues that first list has values from XML List Collection
and only i need is the 'id' attribute of the XML and I am successful
in getting XML List in 1st list. I am using HTTP Service. Now my
problem is that when i am trying to drag and drop the fields from
first list it puts filed in the second list with [object,object]. I am
using array to grab values from 1st list. I have attached the code.
Anyone has any idea where I am messing things. To me it looks like
casting problems. Please let me know how would I fix this issue as I
only need the same field from one list to other.
Thanks a lot for you help guys
Anuj
/*My Code*/
//First List
[Bindable]
public var _selectedCameras:List=new List();
_selectedCameras.dragEnabled=true;
_selectedCameras.dataProvider=devicesCollection;
_selectedCameras.labelField=@id;

//Second List
var _selectCameras:List=new List();
_selectCameras.dragEnabled=true;
_selectCameras.dropEnabled=true;
_selectCameras.dataProvider=new ArrayCollection();  
_selectCameras.labelField=@id;
_selectCameras.dataProvider=new
ArrayCollection();
_selectCameras.labelField=@id;_selectCameras.addEventListener(DragEvent.DRAG_DROP,onListDragDrop);



//Result of the From the data base
private function devicesXMLHandler(event:ResultEvent):void
{
devicesList = event.result.device;
devicesCollection = new XMLListCollection(devicesList); 
}   
!--Calling deviceXML Handler--
mx:HTTPService id=devicesXML method=GET resultFormat=e4x
url=http://10.80.3.56:8182/config/devices;
result=devicesXMLHandler(event) showBusyCursor=true/

//Calling Function for Drop Manager
 private function onListDragDrop(event:DragEvent):void
{   if(event.dragSource.hasFormat(items)) 

{ event.preventDefault();   
 
event.currentTarget.hideDropFeedback(event);
var dropTarget:List=List(event.currentTarget);
var itemArray:Array=event.dragSource.dataForFormat(items) as Array;
var alrt:Alert=Alert.show(itemArray.toString());

//Copy the new Dragged data into a new Object   
  

var tempItem:Object={label:itemArray[0].label,data:itemArray[0].data};
//Get the drop location in the destination
if(dropTarget !=null)
{
var dropLoc:int=dropTarget.calculateDropIndex(event);
} 

if((tempItem!=null)  (dropTarget!=null))
{
//Add the new object to the drop target   
IList(dropTarget.dataProvider).addItemAt(tempItem,dropLoc); 
 
}   
} 
}  



[flexcoders] Basic Tab Question

2008-10-28 Thread anuj181
Hi
I have seen Tab-navigator in Flex 3.0. I have basic question. Is it
possible to to stack tabs vertically rather than horizontally . I have
a requirement in which I have to make something like horizontal tabs
but they have to be stacked vertically and then I need to embed image
in those vertical tabs. 
Please let me know how would i do that
Thanks a lot guys
Anuj



[flexcoders] How to keep Tree control synchronized with the database. Please Help

2008-10-21 Thread anuj181
Hi Guys
I am trying to retrieve values form the database PostGres. I used REST
calls for fetching the data and i am successful in binding that data
with the data Provider of Tree control.
Now my problem is that if I inserted any entry in the database, it
will not update the Tree control directly. Once i refresh the page it
shows the inserted entry. Can some one explain what 's the best way of
dynamically synchronizing my Tree Control (UI) with the database.
Any help and guidance or approach will be highly appreciated.
Thanks
Anuj
/*Here's the small piece of code*/
mx:HTTPService id=devicesXML method=GET resultFormat=e4x
url=http://10.80.3.56:8182/config/devices;
result=devicesXMLHandler(event) showBusyCursor=true
mx:request
urlhttp://10.1.3.36:8182/config/devices/url
/mx:request
/mx:HTTPService

private var devicesList:XMLList;

 [Bindable]
private var devicesCollection:XMLListCollection;

private function 
devicesXMLHandler(event:ResultEvent):void

{
devicesList = event.result.device;
devicesCollection = new 
XMLListCollection(devicesList);


}
mx:Tree width=100% height=100%
dataProvider={devicesCollection}
labelField=@id
dropEnabled=false
dragEnabled=true
dragComplete=onTreeDragComplete(event)
dragMoveEnabled=false
labelFunction=treeLabel 
change=populateForm(event)
/



[flexcoders] Errror while accessing mxml component in external as file

2008-10-13 Thread anuj181
Hi Guys
I am trying to implement the login form . The login form works fine
when i use script and put all the action script in the main mxml file.
But my requirements is to put all the action script in external as
file and make things working. For some reason the builder does not
like my login button, user name text and password text in the as file.
Initially it does not recognize those components but then i user
parent::loginbutton to access which solves the compile time problem,
but gives type coercion error in my project as
TypeError: Error #1034: Type Coercion failed: cannot convert
mx.containers::[EMAIL PROTECTED] to Namespace.
I like to define my login and password text input in the main mxml
file and like to write the business logic in external as file. 
Please let me know what i am missing.If you can provide someone who
has done that, that will be helpful too.
Thanks a lot for your help.
Anuj
/*My MXML Code*/
?xml version=1.0 encoding=utf-8?
mx:Canvas
xmlns:mx=http://www.adobe.com/2006/mxml;
creationComplete=URLLoader_loadExample()
xmlns:text=flash.text.* cornerRadius=2
xmlns:ns1=com.Pelco.login.view.* width=1200 height=768
!-- The Application class states property defines the view
states. --
mx:Metadata
[Event(name=fistTimeSetupEvent, type=flash.events.Event)]
/mx:Metadata

mx:Script source=scripts/login.as /
mx:HTTPService id=ConfigXMLService url=Private/Config.xml
resultFormat=e4x result=loginSettings(event) / 
mx:HTTPService id=UsersXMLService url=assets/Users.xml
resultFormat=e4x result=loginSettings(event) /  
mx:states
mx:State name=Recover
!-- Add a TextInput control to the form. --
!-- Set properties on the Panel container and Button
control. --
mx:SetProperty target={loginPanel} 
name=title value=Recover Password/
mx:SetProperty target={loginButton} 
name=label value=Recover/

!-- Remove the existing LinkButton control. --
mx:RemoveChild target={registerLink}/

!-- Add a new LinkButton control to change 
view state back to the login form. --
mx:AddChild relativeTo={spacer1} position=before
mx:LinkButton label=Return to Login
click=currentState=''/
/mx:AddChild
mx:RemoveChild target={formitem1}/
mx:SetProperty target={password} name=label
value=Email:/
mx:AddChild relativeTo={password} position=before
mx:FormItem label=or textAlign=center
horizontalCenter=true horizontalAlign=center
/mx:FormItem
/mx:AddChild
/mx:State
/mx:states

mx:Panel width=1200 height=736 y=32 horizontalAlign=center
verticalAlign=middle creationComplete=ConfigXMLService.send()

!--mx:Label text=here:{TabBarMain.enabled}  fontSize=40 x=432
y=10/
--  mx:Panel title=Login id=loginPanel 
horizontalScrollPolicy=off verticalScrollPolicy=off
horizontalCenter=1 verticalCenter=1
mx:Form id=loginForm defaultButton={loginButton}
mx:FormItem label=Username: id=username
mx:TextInput id=txt_UserName/
/mx:FormItem
mx:FormItem label=Password: id=password
mx:TextInput id=txt_Password displayAsPassword=true/
/mx:FormItem
mx:FormItem label=Domain: id=formitem1
mx:ComboBox
dataProvider={domainCollection}/mx:ComboBox
/mx:FormItem
/mx:Form
mx:ControlBar
!-- Use the LinkButton control to change to 
the Register view state. --
mx:LinkButton label=Forgot your password? id=registerLink
click=currentState='Recover';/
mx:Spacer width=100% id=spacer1/
mx:Button label=Login id=loginButton/
/mx:ControlBar
/mx:Panel
/mx:Panel

/*MyAction Script code*/
// ActionScript file
import mx.collections.XMLListCollection;
import mx.controls.Alert;
import mx.rpc.events.*;

import mx.controls.Alert;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.xml.*;

private var externalXML:XML;
private var loader:URLLoader;
public var alert:Alert = new Alert;
public var alertPassword:Alert=new Alert;
public var tempUserName:Array=new Array();  
public var tempPassword:Array=new Array();

public function URLLoader_loadExample():void
{
var request:URLRequest = new
URLRequest(Private/LoginAuthenticatedUsers.xml);  
loader = new URLLoader();

try 
{
loader.load(request);
}
catch (error:SecurityError)
{
trace(A SecurityError has occurred.);
}
//
loader.addEventListener(Event.COMPLETE,processXML);

function 

[flexcoders] Access of undefined property of type URLLoader

2008-10-08 Thread anuj181
Hi 
I am simply trying to load external XML file but the builder is not
recognizing one of my variable named urlLoader of type URLLoader. it
is saying Access of undefined property urlLoader, urlRequest and
completeListener. Does anyone has any idea what's going on.

Thanks 

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute
  mx:Panel title=Login id=loginPanel 
horizontalScrollPolicy=off verticalScrollPolicy=off
horizontalCenter=1 verticalCenter=1 
mx:Form id=loginForm
mx:FormItem label=Username: id=username
mx:TextInput/
/mx:FormItem
mx:FormItem label=Password: id=password
mx:TextInput/
/mx:FormItem
mx:FormItem label=Domain: id=formitem1

/mx:FormItem
/mx:Form
mx:ControlBar
!-- Use the LinkButton control to change to 
the Register view state. --
mx:LinkButton label=Forgot your password?
id=registerLink
click=currentState='Recover';/
mx:Spacer width=100% id=spacer1/
mx:Button label=Login id=loginButton/
/mx:ControlBar
/mx:Panel

mx:Script
![CDATA[   
import flash.net.*;
import flash.display.*;
import flash.xml.*;
import flash.events.*;

private var xmlData:XML;
var urlLoader:URLLoader;

//Creating XML Loader
var urlRequest:URLRequest=new
URLRequest(LoginAuthenticatedUsers.xml);
urlLoader=new URLLoader();
urlLoader.addEventListener(Event.COMPLETE,completeListener);
urlLoader.load(urlRequest);

private function completeListener(e:Event):void
{
xmlData=new XML(urlLoader.data);
trace(xmlData.toString());
}

]]
/mx:Script

/mx:Application




[flexcoders] Is it possible to increase the heigth and width of scroll bars in any container?

2008-09-08 Thread anuj181
Hi Guys
I have a general question. In general any scroll bar in
container(either VBOX or HBOX etc)is (by default)16 pixels wide. Is it
possible to change the width and height of any scroll bar for in built
containers. Also for styling those scroll bars and scroll er within
the container do i have to use CSS or there is any other way too.(By
styling i mean if I can give my own look and feel and color to the
scroll bars in containers).
Reply will be appreciated.
Thanks guys
Anuj



[flexcoders] Problem importing FlexLib

2008-09-04 Thread anuj181

Hi Guys
I am trying to embed FlexLib in my Flex Project using following link
http://code.google.com/p/flexlib/
I am trying to import downloaded file in my FLEX devlopment
environment but is not letting me do that. When i imported the
complete project folder. it says  The folder does not contain a valid
Flex Builder Project. And when i am trying to import zipped file it
is giving following message
 Not a valid archived project. If the zip was not created via Export
Flex Project, use Import  General  Existing Projects into Workspace.

I am using Flex 3.0 for my development. I am curious to see the code
of FlexLib and may need its help in my project. Any body has any idea
how would i import Flexlib in Flex.
Thanks in advance for your help
Anuj





[flexcoders] Problem importing FlexLib

2008-09-04 Thread anuj181

Hi Guys
I am trying to embed FlexLib in my Flex Project using following link
http://code.google.com/p/flexlib/
I am trying to import downloaded file in my FLEX devlopment
environment but is not letting me do that. When i imported the
complete project folder. it says  The folder does not contain a valid
Flex Builder Project. And when i am trying to import zipped file it
is giving following message
 Not a valid archived project. If the zip was not created via Export
Flex Project, use Import  General  Existing Projects into Workspace.

I am using Flex 3.0 for my development. I am curious to see the code
of FlexLib and may need its help in my project. Any body has any idea
how would i import Flexlib in Flex.
Thanks in advance for your help
Anuj





[flexcoders] Need Help and Guidance desperately

2008-08-25 Thread anuj181
Hi
I am using HBOX container to load images letting user drag image from
one HBOX and dropping them in another (2nd)HBOX. I need to calculate
the real estate of the HBOX in which the image has been dropped (i-e
2nd HBOX). The reason is that because I need the dropped image to get
placed in an empty space within the 2nd HBOX.
Is there any way I can calculate which space is empty in the HBOX and
let my objects (images) to be placed only in the empty spaces within
the HBOX (not the sapce already occupied by the placed images).Once
the HBOX is full then I need to code in a way that images starts
shrinking(upto some level) to accommodate more images.
Please help me out in figuring out this problem. Any type of
help/documentation/links in this direction will be highly appreciated.
Thanks
Anuj



[flexcoders] Problems implementing tweening in FLEX

2008-08-20 Thread anuj181
Hi All
I implemented transition with effects in Flash using the following
code. My aim is as soon as user rolls over the arrow it brings up the
menu.As long as the mouse remains on the menu, the menu stays else
menu goes away. I am succesful in implmenting that in Flash.I used
Tween and changes the y-coordinate through tweening. Now if I have to
implement the same functionlaity in Flex and I am not sure how would
to do that . I am trying to copy and paste same code but it is giving
me errors as tweening does not working similarly in Flex as it does in
Flash. It is asking me that i have to set the end time too which i am
not sure how to do. Please help me out in implementing the same
functionality in Flex.
Thanks
Anuj

//Code
var startValue:Number;
var finishValue:Number;
var duration:Number;


mc_RightArrow.addEventListener(MouseEvent.ROLL_OVER,showChapterMenu);

function showChapterMenu(event:MouseEvent):void
{
mc_ChapterMenu.visible=true;
duration= 1;
var myTween:Tween = new Tween(mc_ChapterMenu, y, Regular.easeOut,
mc_ChapterMenu.y, mc_ChapterMenu.y-230, duration, true);
}

mc_ChapterMenu.addEventListener(MouseEvent.ROLL_OUT,hideChapterMenuFromChapter);

function hideChapterMenuFromChapter(event:MouseEvent):void
{
var hideChapter:Tween = new Tween(mc_ChapterMenu,
y,Regular.easeIn,mc_ChapterMenu.y,mc_ChapterMenu.y+230,duration, true);
}




[flexcoders] Can we customize already existing components with our own look, feel and size?

2008-08-15 Thread anuj181
Hi 
I am using HBOX component and dynamically loading external SWFs file
in that component. This component is providing me drag drop option on
the main stage using Drag Manager with the scrolling capability within
the container.
My questions is that [b]Can i give my own look, feel and size to that
HBOX[/b]. I like to create my own left  right arrows and scrubber
with my own color and size and like to assign it to HBOX without
breaking the component's functionality. For achieving this is it
possible to overwrite the already existing component with my arrows
and scrubber or do i have to create my own custom control providing my
own look and feel and functionality of the HBOX.
Any information,links or guidance in this direction will be highly
appreciated.
Thanks a lot
Anuj



[flexcoders] Full Screen and Scaling in FLEX. Please help

2008-07-01 Thread anuj181
Hi Flexcoders
I have a question. I made an application and I like to give user the
option of clicking on full screen. I implemented the following code
and full screen is working fine. When user clicks on Full screen the
whole application takes place of the monitor but my problem is that
the application does not scale, so it looks weird. Please help me out,
I need full screen scaling of my whole application. However I
implemented same thing in AS 3.0 uisng Flash IDE just by using
addEventListener(Event.ENTER_FRAME,setStage);
function setStage(event:Event):void
{
stage.displayState = StageDisplayState.FULL_SCREEN;
fscommand(fullscreen, true);
fscommand(allowscale, true);
}.
But this techniques is not working in Flex. I am trying to run
independent SWF file for full screen, With Browser definitely this
thing is not going to work but i need full screen in SWF file.
Please help
Thanks
Anuj
//Code For Flex
mx:Application width=1640 
xmlns:mx=http://www.adobe.com/2006/mxml;
 verticalAlign=top 
 viewSourceURL=srcview/index.html layout=absolute
backgroundColor=#b7babc verticalScrollPolicy=off
 horizontalScrollPolicy=off height=100%
applicationComplete=FS(event)  xmlns:assets=assets.*
enterFrame=GridCheck(event) creationComplete=init() xmlns:ns1=*
xmlns:ns2=Renderers.* xmlns:myComps=*
xmlns:objecthandles=com.roguedevelopment.objecthandles.*
 mx:Style source=resources/css/style.css/ 
mx:Button id=FullScreenButton x=809 y=959 label=Fullscreen
click=toggleFullScreen()/  
//Functions
public function FS(evt:Event):void {
stage.addEventListener(FullScreenEvent.FULL_SCREEN,
fullScreenHandler);
dispState =stage.displayState; 
}

public function fullScreenHandler(evt:FullScreenEvent):void 
{

   dispState = stage.displayState +  (fullScreen= +
evt.fullScreen.toString() + );
if (evt.fullScreen) 
{
   FullScreenButton.label=Normal; 
} 
else
{
   FullScreenButton.label=Full Screen; 
  
} 
}   
public function toggleFullScreen():void
{
try
{

switch(Application.application.stage.displayState) 
{
case StageDisplayState.FULL_SCREEN:
//If already in full screen mode, switch
to normal mode. 
stage.displayState = StageDisplayState.NORMAL;
stage.scaleMode=StageScaleMode.NO_SCALE; 
  
break;
default:
// If not in full screen mode, switch to
full screen mode. 

stage.displayState =
StageDisplayState.FULL_SCREEN; 
//Setting Scale 
stage.scaleMode=StageScaleMode.NO_SCALE;
break;
}
} catch (err:SecurityError) 
{
// ignore
}
}
mx:Button id=FullScreenButton x=809 y=959
label=Fullscreen click=toggleFullScreen()/
/mx:Application





[flexcoders] How to detect the percentage overlap of one object with the another

2008-06-17 Thread anuj181
Hi guys
I have few objects of type rectangle(re-sizable and draggable). I like
to have them change border if 85% percent of one rectangle comes on
top of another.I would be able to change the border of the recatngle
by using hitTestPoint method. As soon as one rectangle crosses the
center of another, there will be change in the border but I need to
implement same thing but rectangle has to change the border if 85% of
area of one crosses the another one. Please help me as I am not sure
how to track the percentage of area overlapped. Any sample code or
examples will be highly appreciated.
Thanks a lot
Anuj

Here's the code for hitTestpoint
var ReplacedVideo:GlowFilter=new GlowFilter(); 
ReplacedVideo.color=0xFF;
var HitPoint:DisplayObject=NonSelectedVideo as DisplayObject;

if(HitPoint!=null)
{   
if(Svideo.hitTestPoint((HitPoint.x+HitPoint.width/2),(HitPoint.y+HitPoint.height/2)))
  {

HitPoint.filters=[ReplacedVideo];
HitPoint.alpha=.4;
}
else
{
HitPoint.filters=[];
HitPoint.alpha=1;   

}
}



[flexcoders] How would i layout different objects in grid form

2008-06-11 Thread anuj181
Hi 
I have few objects containing of type image in my HBOX container. I am
letting user drag and drop those objects within the HBOX. I want to
provide user the option to arrange those objects in grid layout form.
There is radio button on the main application saying 'Grid' and if
user selects that button then depending on the number of objects, the
grid layout will be generated in HBOX (to arrange those objects). For
example if there are 2-4 objects then they will be generated in form
of 2x2 matrix, if 5-9 objects then they will be generated in 3x3
matrix and if 10-16 objects then they will be arranged in 4x4 matrix.
For the time being I am just considering 16 objects in the HBOX. The
size of the objects can be shrunk depending on the layout generated.
Definitely if user selects grid option he cannot drag and drop any more.
Does anyone know which is the best approach to achieve this? And is
there any inbuilt Flex 3 component that will take care of this.
Any help will be highly appreciated.
Thanks a lot.
Anuj




[flexcoders] Importing SWC Files in FLEX

2008-05-22 Thread anuj181
Hi 
Does anyone know how to import SWC file created in CS3 into Flex
Project. I googled it and found lot of samples but in my case whenever
i gave Library path, the swc file is not showing in my project' lib
directory and when i manually move swc file it shows unknown icon on
the file. Does anyone has any idea what's going on.
Please help me out. All i need is to create few symobls/movies in CS3
and want to use them in my Flex Project
Thanks
Anuj 



[flexcoders] Please Help. Is there any resizeable swf/video container in FLEX

2008-05-15 Thread anuj181
Hi
Does anyone know that if there is any inbuilt container if Flex 3.0
which allows user to click and drag to resize it. I need to load swf
files in the container and i need to implement the functionality in
which user can simply click on that container and drag it for resizing it.

Please help me out. I am fairly new to Flex .
Thanks
Anuj



[flexcoders] New To the list and have some questions

2008-05-07 Thread anuj181
Hi All
I am new to this list. I know AS 3.0 and I am the member of
FlashCoders. My aim to join this list is that i started making video
gallery using AS 3.0 and then in the mid of the project, there came
some requirements which make me to think that i am using wrong tool.
Perhaps Flex is better one. I am new to Flex too. 

My aim is i need all the recorded video (external swfs)as the
thumbnails with the scroller and left and right navigation arrows.and
then when user mouse hovers on them, it is should show magnified view
of thumbnail. when you double click on the video is should play in the
main stage. User can open multiple instances  of same video either by
clicking and dragging thumbnail or by double clicking thumbnail .I
have done so far using AS 3.0 and now my problem is that I want to
give user the option to resize the opened video too. 
Can the list please provide me the option how would i allow user to
resize the opened video. Is there any container in the Flex which
allows me to load multiple instances of the same video and allow it to
resize it too. 
Also is there any component in flex which can hold multiple swfs and
provide scoll- bar and still allow drag and drop from that container
to the main stage.( i also need let and right arrow clicking of which
moves thumbnails).
Sorry for the long mail but any help provided in this matter will be
highly appreciated. 
Thanks a lot
Anuj