[flexcoders] filtering a flex datagrid using a slider with two thumbs
hi guys i am tring to filter a datagrid with a price column using a slider that gets results which are btn two ranges min and max, can someone please help me. thanks
[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs
hi am fairly new to flex. if you dont mind maybe you could post some small example on how to do it. thanks
[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs
hi thanks for the link, maybe you can help me out here, i am filtering the datagrid using three controls (2 combo boxes and a slider), the filter works without the slider but when i add the slider into the equation nothing shows up in the data grid when each control is clicked. here is my filter function please help me public function filterGrid():void{ dataAr.filterFunction=cityFilter; dataAr.refresh(); //dgrid.selectedIndex = null; } public function cityFilter(item:Object):Boolean{ var result:Boolean=false; if ( (city_cb.selectedLabel == All || item.city == city_cb.selectedLabel) (lct_cb.selectedLabel == All || item.location == lct_cb.selectedLabel) (item.value priceSlider.values[0] item.value priceSlider.values[1]) ){ result=true; } return result; } thanks in advance
[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs
hi my price ranges are between 0 and 3,000,000 so should my max value be 3,000,000 or 1? thanks
[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs
hi i tried just that but nothing shows up in my datagrid when i filter it. what could be the problem? here is my update filter function public function filterGrid():void{ dataAr.filterFunction=cityFilter; dataAr.refresh(); //dgrid.selectedIndex = null; } public function cityFilter(item:Object):Boolean{ var result:Boolean=false; if ( (city_cb.selectedLabel == All || item.city == city_cb.selectedLabel) (lct_cb.selectedLabel == All || item.location == lct_cb.selectedLabel) (item.value priceSlider.values[0] item.value priceSlider.values[300]) ){ result=true; } return result; }
[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs
hi my filter function returns true for some of the data and in fact when i remove the slider filter statement, everything works well. another thing is that i set the onChange function of the combo boxes and the slider to filterGrid(). is that ok or am doing it the wrong way?
[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs
hi if you dont mind could you clarify on the trace statement, am not sure i understand what you said or how to go about it. thanks
[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs
hi josh nice example but how about using one slider with two thumbs?
[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs
i managed to build a dual thumb slider that i pass on the filter function. here is the code. mx:HSlider x=0 y=240 id=priceSlider minimum=0 maximum=300 tickInterval=10 snapInterval=10 thumbCount=2 values=[0,300] tickColor=#ff labels=[$0k,$300M] liveDragging=true width=182 change=filterGrid()/
[flexcoders] loading flv videos dynamically
hi guys i recently downloaded a flex flv video player component and tried it out and worked well only i had to feed it with the path to the flv video. so i tried to load video to a database and have that data loaded in a datagrid so that if a row is click then the video clip in that row is played in the flv player but i have not been successful. does anyone know how to do this. thanks
[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs
hi guys i hope am not being a pain, but how can i use a combo box and a slider (two thumbed) to fliter a datagrid? a small code sample will do it. thanks.
[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs
hi guy i appreciate that you are really trying to help. but so far i still have the same problem, when i remove the slider from the filter equation the datagrid is filtered but when i add it something wired happens(the data disappears from the grid) here is a sample of my code and i call the filterGrid() function on the change event of the two combos and the slider, is that the correct way of doing it? hope this will help solve my problem. thanks mx:RemoteObject id=homeSvc destination=ColdFusion source=iestate.cfcs.homes1 showBusyCursor=true fault=CursorManager.removeBusyCursor();Alert.show(event.fault.message) mx:method name=load result=displayResult(event) / !--mx:method name=getCountries result=countryResult(event)/-- mx:method name=getcities result=cityResult(event) / mx:method name=getlocation result=locationResult(event) / /mx:RemoteObject mx:ComboBox x=0 y=52 width=182 id=city_cb labelField=city_name change=filterGrid(); selectedIndex=0/ mx:ComboBox x=0 y=108 width=182 id=lct_cb labelField=lct_name change=filterGrid() selectedIndex=0/ mx:HSlider x=0 y=240 id=priceSlider minimum=0 maximum=300 allowThumbOverlap=false tickInterval=10 snapInterval=10 thumbCount=2 values=[0,300] tickColor=#ff labels=[$0k,$300M] liveDragging=true width=182 change=filterGrid()/ mx:DataGrid width=50% height=100% id=dgrid dataProvider={dataAr} rowCount=20 change=animateMapOut(); mx:columns mx:DataGridColumn headerText=Price dataField=price/ mx:DataGridColumn headerText=BedRooms dataField=bedrooms/ mx:DataGridColumn headerText=BathRooms dataField=bathrooms/ !--mx:DataGridColumn headerText=Stories dataField=col4/-- /mx:columns /mx:DataGrid /data functions/ public function InitCountry():void{ homeSvc.getCountries(); } public function countryResult(event:ResultEvent):void{ ctry_cb.dataProvider = event.result; } private var cityAr:ArrayCollection ; public function cityResult(event:ResultEvent):void{ cityAr = event.result as ArrayCollection; //add an Object at the beginning of the areaAryCol var city:Object = {city_id: -1, city_name: All}; cityAr.addItemAt(city, 0); //reset the areaCB's data provider to so the above //Object is display at the top of the combo box city_cb.dataProvider = cityAr ; cityAr.refresh(); city_cb.selectedIndex = 0 } private var lctAr:ArrayCollection ; public function locationResult(event:ResultEvent):void{ lctAr = event.result as ArrayCollection; //add an Object at the beginning of the areaAryCol var location:Object = {lct_id: -1, lct_name: All}; lctAr.addItemAt(location, 0); //reset the areaCB's data provider to so the above //Object is display at the top of the combo box lct_cb.dataProvider = lctAr ; lct_cb.selectedIndex = 0; } [Bindable] private var dataAr:ArrayCollection = new ArrayCollection; public function displayResult(event:ResultEvent):void{ dataAr = new ArrayCollection( (event.result as ArrayCollection).source); } filters// public function filterGrid():void{ dataAr.filterFunction=cityFilter; dataAr.refresh(); //dgrid.selectedIndex = null; } public function cityFilter(item:Object):Boolean{
[flexcoders] Re: loading flv videos dynamically
any help guys?
[flexcoders] Re: loading flv videos dynamically
thats exactly what i meant and what am doing but nothing is played in the flv player. here is the code i use for sending the video to the player when a row is clicked http://localhost:8500/iestate/images/video/{parentDocument.dgrid.selectedItem.image};;
[flexcoders] Re: loading flv videos dynamically
hi if you dont mind would please post a code snippet of how to go about your solution?
[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs
when i take out values=[0,300] there is no change in the behavior. is the way i call the filter function on the change events of the combos and slider correct? have a feeling that's what is causing the problem.
[flexcoders] Re: loading flv videos dynamically
hi its a little more complicated than i mentioned it. i am using a custom flvplayer component developed by some guys which i load into another component that holds my datagrid. here is my code maybe you can be able to help me when you view like this. FLaVr.mxml ?xml version=1.0 encoding=utf-8? mx:ViewStack backgroundColor=#33 width=50% height=100% creationComplete=init() mouseDown=this.mouseInteracting=true mouseUp=this.mouseInteracting=false xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:local=components.* mx:Script ![CDATA[ import mx.controls.Alert; public function init():void { this.setVidSrc(); } //public var vidSrc:String = ../images/video/{parentDocument.dgrid.selectedItem.image}; public var vidSrc:String = http://localhost:8500/iestate/images/video/{parentDocument.dgrid.selectedItem.image};; public var doAutoPlay:String = yes; public var caption:String = Connect Studios | FLaVr; public function setVidSrc():void { if(this.vidSrc == null){ this.vidSrc = ; } if(this.vidSrc == ){ return; } if(this.caption == ){ this.capCan.visible = false; }else{ this.capCan.visible = true; this.capLbl.text = this.caption; } this.vid.source = this.vidSrc; if(this.doAutoPlay.toLowerCase() == yes){ this.vid.play(); } } public function vidComplete():void { this.vid.pause(); } public function togglePlay():void { this.playBtn.selected = true; if(this.vid.playing){ this.playBtn.selected = true; this.vid.pause(); }else{ this.playBtn.selected = false; this.vid.play(); } } public var mouseInteracting:Boolean = false; public function doUpdate():void { if(!(this.mouseInteracting)){ this.vidSlider.value = this.vid.playheadTime; this.vidSlider.maximum = this.vid.playheadMax; } } public function updatePlayhead():void { this.vid.seek(this.vidSlider.value); } ]] /mx:Script mx:Canvas borderColor=#C2C2C2 borderStyle=solid borderThickness=1 id=can width=100% height=100% horizontalScrollPolicy=off verticalScrollPolicy=off backgroundColor=#33 local:FLaVrPlayer id=vid playheadUpdate=this.doUpdate() width=100% height=100% horizontalCenter=0 verticalCenter=-25 autoPlay=false flvPlayheadEnd=this.vidComplete()/ mx:Image source=@Embed('../images/slideBack.png') bottom=16 left=-20/ mx:Canvas id=controls width=100% height=60 bottom=0 horizontalScrollPolicy=off verticalScrollPolicy=off mx:Canvas id=capCan width=100% horizontalCenter=0 bottom=0 visible=true height=28 styleName=capt borderSkin=@Embed(source='../images/vid_capt_bg.png') horizontalScrollPolicy=off verticalScrollPolicy=off mx:Label x=10 y=4 text=Caption: color=#FF fontFamily=Arial fontSize=12/ mx:Label x=57 y=4 text=... color=#FF fontFamily=Arial fontSize=12 width={this.width-this.capLbl.x-5} id=capLbl/ /mx:Canvas mx:Button x=10 y=0 width=23 height=22 icon=@Embed(source='../images/rewind_icon.png') click=this.vid.playheadTime-=3 styleName=btn/ mx:Button x=60 y=0 width=23 height=22 icon=@Embed(source='../images/stop_icon.png') click=this.vid.stop() styleName=btn/ mx:Button x=85 y=0 width=23 height=22 icon=@Embed(source='../images/ff_icon.png') click=this.vid.playheadTime+=3 styleName=btn/ mx:Button x=35 y=0 width=23 height=22 icon=@Embed(source='../images/play_icon.png') selectedUpIcon=@Embed(source='../images/pause_icon.png') id=playBtn click=this.togglePlay() styleName=btn/ mx:Canvas y=8 height=22
[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs
hi Tim, thanks your solution worked well. for anyone who is interested in filtering a datagrid with multiple criteria here is how i pieced up mine through the enormous help from this group. filters// private var sliderFromValue : Number = 0; private var sliderToValue : Number = 300; private var selectedCity : String = All; private var selectedLocation : String = All; private function onSliderChange(event:SliderEvent):void { var slider:Slider = Slider(event.currentTarget) ; sliderFromValue = priceSlider.values[0]; sliderToValue = priceSlider.values[1]; filterGrid() ; dataAr.refresh(); } private function cityChangeHandler(event:Event):void { if( city_cb.selectedItem != null ) selectedCity = city_cb.selectedLabel; filterGrid(); dataAr.refresh(); } private function locationChangeHandler(event:Event):void { if( lct_cb.selectedItem != null ) selectedLocation = lct_cb.selectedLabel; filterGrid(); dataAr.refresh(); } private function filterGrid() :void { dataAr.filterFunction=myFilterFunction; dataAr.refresh(); } private function myFilterFunction(item:Object): Boolean { return (item.city == selectedCity || selectedCity == All) (item.location == selectedLocation || selectedLocation == All) (item.price = sliderFromValue item.price = sliderToValue) ; } then on each of the controls in my case 2 combo boxes and a slider call their individual filter functions in the change event like this mx:ComboBox x=0 y=108 width=182 id=lct_cb labelField=lct_name change=locationChangeHandler(event) selectedIndex=0/ mx:ComboBox x=0 y=52 width=182 id=city_cb labelField=city_name change=cityChangeHandler(event) selectedIndex=0/ mx:HSlider x=0 y=240 id=priceSlider minimum=0 maximum=300 allowThumbOverlap=false tickInterval=10 snapInterval=10 thumbCount=2 values=[0,300] tickColor=#ff labels=[$0k,$300M] liveDragging=true width=182 change=onSliderChange(event)/ hope someone will find this useful. thanks
[flexcoders] Re: loading flv videos dynamically
hi guys still haven't made progress from my last post. please help me figure out this. thanks alot
[flexcoders] flex store effects
hi guys i have a have thumbnail images on a canvas and i want that when a person clicks on a thumbnail the thumbnails move to the right and a full image of the thumbnail that was clicked appears on the left with the same effects in the flex store example. can someone please help. the code in the flex store example is very complicated. thanks
[flexcoders] skinning hslider
hi guys how can i change the thumb skin of the hslider to look like the one in itunes? please help
[flexcoders] custom flex preloader
Try Me Tonight Why Don't You Try Me Tonight? Real Life Love Stories http://www.loverian.com http://www.earticlez.com/movieskingdom/index.html http://www.earticlez.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups coontrolledsex group. To post to this group, send email to coontrolledsex@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/coontrolledsex?hl=en -~--~~~~--~~--~--~---
[flexcoders] Re: custom flex preloader
Samsung I8510 - Latest 8Mega Pixel Camera Phone From Samsung Anyone looking for a mobile phone today would ensure that ones select widget comprises of the Internet, FM radio, camera, music player, video calling, games etc. http://xrl.us/oq4d3 3G Apple IPhone - Marvellous Device Mobile phones are the most demanding gadgets of the present day world, which are enriched of highly advanced technologies. http://xrl.us/oq2t6 Nokia N95 8GB - New and Improved It was a momentous day in London, England on August 29th, 2007 when Nokia announced it would be releasing the N95 8GB for the European and Asian markets. http://xrl.us/oqyoi
[flexcoders] Re: custom flex preloader
thanks for the reply but i have to say am still confused. anyhow if you dont mind a simple step by step would do it for me. i think. thanks
[flexcoders] google maps (this sounds ridiculous)
hi guys this may sound ridiculous since this is a yahoo forum but i have no other place to turn. i have a flex application with a data grid and a google map. the datagrid is populated by lat lng coordinates from a database and i would like that if someone clicks on a row in the grid the map zooms out of its current position and then moves to the new coordinates first and zooms in on that particular place. basically i would like the it to function like the one in this example http://www.asfusion.com/apps/homelocator/ but using google maps. thanks guys.
[flexcoders] flex/coldfusion job
hello we are a new start up company in East Africa and we are in a process of acquiring funds to start on a very massive portal system. A prototype is already in please and the investors are interested in funding the whole project. the portal will be built in flex and coldfusion so i am looking to a flex/ UI designer and flex/flash programmer, a coldfusion programmer, database designer/programmer, someone that has very good skills with google/yahoo maps and someone with very good networking skills. please guys this is for real and you shall be stationed in Kampala Uganda till the whole project is finished. please contact me on this address so as to get full details [EMAIL PROTECTED] or [EMAIL PROTECTED]. this is an offer of a life time. looking forward to hearing from you guys. thanks
[flexcoders] die hard 4 glass like interfaces
hi guys this is gonna sound very ridiculous but just asking, does anyone know how to design nice glassy interfaces like the one in the die hard 4 movie eg a datagrid with a glassy feel and no grid rows and columns showing.
[flexcoders] flex ui customization
hi guys i am a developer(flex/cf) but my ui skill suck alot. i find my self spending alot of time trying to come up with a good looking ui. any resources on flex ui design (minus adobe.com) that a really good or any free books/tutorials that specifically address flex ui design and customization?
[flexcoders] Re: Flex, Coldfusion, Air
so if the application is ported(if i may say) to AIR it reduces the time it takes for the application to open if it where just a flex app(as in flex apps need good bandwidth to open so if its ported to AIR that issue is solved right?)
[flexcoders] Flex, Coldfusion, Air
hi guys need to be clear about something, if a have developed a large flex application with a coldfusion backend and database, can i turn it into an Air app for guys to download so that when they are on the web they can access data?
[flexcoders] Re: Flex, Coldfusion, Air
yes but on a broadband 64kbps line shared by about 20 pcs, a flex app might fail or take a long time to download.
[flexcoders] resizing uploade image
hi guys i have a flex upload component and i would like the image to be resized when its uploaded but nothing happens. here is my upload.cfm file the flex component calls. upload.cfm !--- Flex Multi-File Upload Server Side File Handler This file is where the upload action from the Flex Multi-File Upload UI points. This is the handler the server side half of the upload process. --- !--- set the full path to the images folder --- cfset mediapath = expandpath('/realestate portal/images/agent_pics') !--- set the desired image height cfset thumbsize = 320 !--- set the desired image width --- cfset imagesize = 192 cftry !--- Because flash uploads all files with a binary mime type (application/ocet-stream) we cannot set cffile to accept specfic mime types. The workaround is to check the file type after it arrives on the server and if it is non desireable delete it. --- cffile action=upload filefield=filedata !--- destination=#ExpandPath('\')#realestate portal\images\agent_pics\ --- destination=#MediaPath# nameconflict=makeunique accept=application/octet-stream/ !--- Begin checking the file extension of uploaded files --- cfset acceptedFileExtensions = jpg,jpeg,gif,png,pdf,flv,txt,doc,rtf/ cfset filecheck = listFindNoCase(acceptedFileExtensions,File.ServerFileExt)/ !--- read the image cfimage name=uploadedImage source=#MediaPath#/#file.serverFile# !--- figure out which way to scale the image --- cfif uploadedImage.width gt uploadedImage.height cfset thmb_percentage = (thumbsize / uploadedImage.width) cfset percentage = (imagesize / uploadedImage.width) cfelse cfset thmb_percentage = (thumbsize / uploadedImage.height) cfset percentage = (imagesize / uploadedImage.height) /cfif !--- calculate the new thumbnail and image height/width --- cfset thumbWidth = round(uploadedImage.width * thmb_percentage) cfset thumbHeight = round(uploadedImage.height * thmb_percentage) cfset newWidth = round(uploadedImage.width * percentage) cfset newHeight = round(uploadedImage.height * percentage) !--- see if we need to resize the image, maybe it is already smaller than our desired size --- cfif uploadedImage.width gt imagesize cfimage action=resize height=#newHeight# width=#newWidth# source=#uploadedImage# destination=#MediaPath#/#file.serverFile# overwrite=true/ /cfif !--- create a thumbnail for the image --- cfimage action=resize height=#thumbHeight# width=#thumbWidth# source=#uploadedImage# destination=#MediaPath#/thumbs/#file.serverFile# overwrite=true/ !--- If the variable filecheck equals false delete the uploaded file immediatley as it does not match the desired file types --- cfif filecheck eq false cffile action=delete file=#MediaPath#/#file.serverFile#/ /cfif !--- Should any error occur output a pdf with all the details. It is difficult to debug an error from this file because no debug information is diplayed on page as its called from within the Flash UI. If your files are not uploading check to see if an errordebug.pdf has been generated. --- cfcatch type=any cfdocument format=PDF overwrite=yes filename=errordebug.pdf cfdump var=#cfcatch#/ /cfdocument /cfcatch /cftry please advise
[flexcoders] example on how to use flex builder 2 with cf8 lcds for data push and management
hi guys could someone please guide me on how to use cf8 lcds in flex builder 2 to update a datagrid with data coming from a databse.
[flexcoders] cfeclipse plugin for flex builder
hi guys am having problems when i install the latest version of cfeclipse in flex builder i get an error . this is the error i get When I try to open a cfm/cfc file Unable to create this part due to an internal error. Reason for the failure: The editor class could not be instantiated. This usually indicates that the editor's class name was mistyped in plugin.xml.
[flexcoders] cfeclipse plugin for flex builder
hi guys am having problems when i install the latest version of cfeclipse in flex builder i get an error . this is the error i get When I try to open a cfm/cfc file Unable to create this part due to an internal error. Reason for the failure: The editor class could not be instantiated. This usually indicates that the editor's class name was mistyped in plugin.xml. any help on how to get it to work?
[flexcoders] Re: resizing uploade image
already tried that and it works, but with flex nothing happens. it just uploads the image
[flexcoders] flex/coldfusion login snippet
hi guys i need help on flex/coldfusion login.
[flexcoders] login system with flex and coldfusion
hey guys i really need help on this, i would like a simple step by step on how to create a login system with flex and coldfusion. thanks
[flexcoders] Re: login system with flex and coldfusion
hello is there something more simple to understand than that? one that uses one cfc
[flexcoders] Re: login system with flex and coldfusion
ok i dont mind using cfcs bt i think all am asking for is a clear explanation on how to go abt it. any way thats possible?
[flexcoders] Re: login system with flex and coldfusion
thanks i get now
[flexcoders] flex login popup help needed pleaseeeeeeeee
hello guyz i am having a problem with the login form. i am using the example of bruce phillps which can be found at this url Login-System-For-A-Flex-Application-With-ColdFusion-Backend-Part-3--Custom-Login-Form-Component.htm. here is where am confused: my custom login form is called as a pop-up window from the main application while bruce's example it is called through another custom component(hope you understand what am saying), anyhow my question is HOW CAN I HANDLE LOGIN SUCCESS THROUGH A POPUP LOGIN FORM here is my code upload_form.as // ActionScript file import mx.managers.PopUpManager; import mx.controls.Alert; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; import flash.events.Event; private var fileRef:FileReference; import mx.utils.ObjectUtil; import mx.events.ValidationResultEvent; // Define private variable to hold the Member //object returned by the CFC method private var __member:Member; // Define a getter method for the private variable. public function get member():Member { return __member; }//end get member /*Called automatically when the result is returned by the CFC method getMemberByUserNameAndPassword */ public function resultGetMemberByUserNameAndPassword(event:ResultEvent):void { //used for debugging - shows details about result //returned by the CFC method //Alert.show( ObjectUtil.toString(event.result) ); /*result returned is a Member object cast the result returned to a Member class and assign it to our Member object*/ __member = event.result as Member ; //remove text in the login input fields memUserName.text=; memPassword.text=; // Define event object, initialize it, then dispatch it. dispatchEvent(new Event(loginSuccess)); } //end function getMemberByUserNameAndPassword /* automatically called if the CFC method call causes an error */ private function faultGetMemberByUserNameAndPassword(event:FaultEvent):void{ //Alert.show( ObjectUtil.toString(event.fault) ); //Alert.show(event.fault.faultString ); currentState = 'loginError'; }//end function faultGetMemberByUserNameAndPassword /*Function is called automatically when the user makes changes to any of the registration input fields if all input fields are valid, the register btn is enabled */ private function validateRegistration():void { var usernameResult:ValidationResultEvent = userNameValidator.validate(); var passwordResult:ValidationResultEvent = passwordValidator.validate(); var firstnameResult:ValidationResultEvent = firstNameValidator.validate(); var lastnameResult:ValidationResultEvent = lastNameValidator.validate(); var emailResult:ValidationResultEvent = emV.validate(); var phoneResult:ValidationResultEvent = phV.validate(); var photoResult:ValidationResultEvent = photoValidator.validate(); var zipResult:ValidationResultEvent = zipValidator.validate(); var confirmResult:ValidationResultEvent = confirmPsV.validate(); if (usernameResult.type == ValidationResultEvent.VALID passwordResult.type == ValidationResultEvent.VALID ) { loginButton.enabled = true; } else if(usernameResult.type == ValidationResultEvent.VALID passwordResult.type == ValidationResultEvent.VALID firstnameResult.type == ValidationResultEvent.VALID lastnameResult.type == ValidationResultEvent.VALID emailResult.type == ValidationResultEvent.VALID phoneResult.type == ValidationResultEvent.VALID
[flexcoders] Re: flex login popup help needed pleaseeeeeeeee
please guys any help am desperate.
[flexcoders] Re: flex login popup help needed pleaseeeeeeeee
hi am confused on what to do because am using bruce phillps example where the username and password are stored in a database(access) and a cfc service object(Memberservice.cfc) is used to interact with the database and flex UI. anyone with a knowledge on hw to do this with flex and coldfusion? by the way thanks for taking time to help me.
[flexcoders] Re: flex login popup help needed pleaseeeeeeeee
thanks but that post does not really shed light on how to develop a simple login system in flex and coldfusion where login details like username and password are stored and pulled from a database. bruce phillps http://www.brucephillips.name/blog/index.cfm/2007/3/16/Developing-A-Login-System-For-A-Flex-Application-With-A-ColdFusion-and-Database-Backend-Part-1; has a good example bt the only thing i need to know is how to handle login success from a popup login window. for example if i have a main application with a view stack that has two views the first one a general view and the second one an admin view where one has to click on a button on the main application to get a popup login window to login to see the admin view. thanks
[flexcoders] interface layout help
hi guys i am seeking opinions on how to layout an interface of an app i am developing. the front is laid out as follows 1) search box on the left with search criteria 2) a datagrid and tabnavigator in the middle 3) a map and a video player on the right now the data grid gets results form a database which are filtered using the search interface and then the details from the data grid show up in the tab navigator and also the map and player are hooked up to the data grid. is it good to have them all showing at once or there is a more professional way to do this? i wish it was possible to send a screen shot of the interface i have now. anyhw need advise on how best to lay it out.thanks
[flexcoders] Re: interface layout help
OK this is the description of the usage pattern. the application is a real estate portal where people can easily find housing. now when someone visits the portal they do a search for property of their choice using different criteria. the search results show up in a datagrid and when he/she have identified what they want then they can click on a row in the datagrid to view details of the property which show up in a tab navigator that has two tabs one for info on the property and the other for pictures of the property plus when the person clicks on a row in the datagrid the map zooms in on the property to show surrounding areas and also a virtual tour is shown in the video player. all that shows up at the same time on the same page. now is there a better way to do it?
[flexcoders] Re: interface layout help
hi please check your email. i have just sent you a snap shot of the interface please respond.
[flexcoders] Re: interface layout help
i think that having a tile list is great but then hw do i bring up the map and the virtual tour when one needs details on property?
[flexcoders] Re: interface layout help
yeah but if combined together like having two views that guys can switch to (for example the datagrid view and a tile window view) would be great. my problem is that i feel there must be another way to bring up the map and the virtual tour. having all the four components showing at the same time. but am not in anyway a good visual designer.
[flexcoders] Re: interface layout help
what am saying is that i would like to deliver info on demand in a way that is easy to understand and fluid. for example have just the tile view with the option of jumping to a datagrid view, then show the map and virtual tour when needed all in a fluid way and easy to understand. for example acrobat.com can give you an idea
[flexcoders] Re: flex login popup help needed pleaseeeeeeeee
guys am sorry for sounding so naive but i have still failed to make this work. i have a popup login that is called by clicking on a signin button on the main application and i would like that someone be a registered user to be able to login so his/her login details must match what is in the database and i am using coldfusion. when login is successful the child in the view stack should change to admin view. can someone please and i say please help me with this proble?
[flexcoders] Re: flex login popup help needed pleaseeeeeeeee
Hi Tracy you asked hw far i was, well i decided to redo it from scratch so that i can get guidance. now i have 4 mxml files. one is the main application(login_example.mxml) and there is the Home.mxml which is the default view, the Admin.mxml which requires one to login in order to view it and a login.mxml which is the popup login form. now from there all a ask 4 is a simple cfc that will do the authentication and also how to use it in my flex app. here is my code. login_example.mxml ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute xmlns:view=components.* mx:states mx:State name=Log Out mx:SetProperty target={label1} name=text value=Log Out/ /mx:State /mx:states mx:Script ![CDATA[ import components.*; import flash.events.MouseEvent; import mx.managers.PopUpManager; import mx.core.IFlexDisplayObject; private var myLoginForm:IFlexDisplayObject; private function showPopUp(e:MouseEvent):void { myLoginForm = PopUpManager.createPopUp(this, Login, true); } ]] /mx:Script mx:Label x=0 y=0 text=Sign In id=label1 buttonMode=true useHandCursor=true mouseChildren=false click=showPopUp(event)/ mx:ViewStack x=0 y=26 id=viewstack1 width=100% height=100% view:Home id=home/ /mx:ViewStack /mx:Application Home.mxml ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; width=100% height=100% backgroundColor=#ff8000 /mx:Canvas Admin.mxml ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; width=100% height=100% backgroundColor=#40 /mx:Canvas login.mxml ?xml version=1.0 encoding=utf-8? mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute title=Login Form creationComplete=PopUpManager.centerPopUp(this) mx:Script ![CDATA[ import mx.managers.PopUpManager; ]] /mx:Script mx:Form x=0 y=0 mx:FormItem label=User Name: mx:TextInput/ /mx:FormItem mx:FormItem label=Password: mx:TextInput/ /mx:FormItem /mx:Form mx:ControlBar mx:Button label=Login/ /mx:ControlBar /mx:TitleWindow please guys this would mean alot to me. thanks for sticking up to this point.
[flexcoders] Re: flex login popup help needed pleaseeeeeeeee
hi tracy i dont know php. i use coldfusion. a coldfusion remedy would be good. thanks
[flexcoders] Re: flex login popup help needed pleaseeeeeeeee
hi guys i think am making progress. this is what i have so far. login_example.mxml ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute xmlns:view=components.* mx:states mx:State name=Log Out mx:SetProperty target={label1} name=text value=Log Out/ /mx:State /mx:states mx:Script ![CDATA[ import components.*; import mx.containers.TitleWindow; import mx.controls.Alert; import mx.events.CloseEvent; import flash.events.Event; import mx.managers.PopUpManager; import mx.core.IFlexDisplayObject; public var loggedin:Boolean = false; public var pop:Login; private function showLogin():void { pop = Login(PopUpManager.createPopUp(this,Login,true)); pop.showCloseButton =true; PopUpManager.centerPopUp(pop); pop.addEventListener(close,removeMe); pop[cancelButton].addEventListener(click, removeMe); pop[okButton].addEventListener(click,processLogin); } private function removeMe(event:Event):void { PopUpManager.removePopUp(pop); } private function processLogin(event:Event):void { if(pop.username.text == || pop.password.text == ) { Alert.show(Login name and password are required fields.,WARNING::Login Alert); } else { // log user in or something... lbl_intro.text = Welcome +pop.username.text; removeMe(event); viewstack1.selectedChild = admin; currentState = 'Log Out'; } } ]] /mx:Script mx:Label x=0 y=0 text=Sign In id=label1 buttonMode=true useHandCursor=true mouseChildren=false click=showLogin()/ mx:ViewStack x=0 y=26 id=viewstack1 width=100% height=100% view:Home id=home/ view:Admin id=admin/ /mx:ViewStack mx:Label x=700 y=0 id=lbl_intro/ /mx:Application login_form.mxml ?xml version=1.0 encoding=utf-8? mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute title=Login Form mx:Form x=0 y=0 mx:FormItem label=User Name: mx:TextInput id=username/ /mx:FormItem mx:FormItem label=Password: mx:TextInput id=password/ /mx:FormItem /mx:Form mx:ControlBar mx:HBox width=100% mx:Button label=Login id=okButton/ mx:Spacer width=100%/ mx:Button label=Cancel id=cancelButton/ /mx:HBox /mx:ControlBar /mx:TitleWindow now i would like to connect that to this coldfusion script to have the cfc match login details from flex and database memberservice.cfc !--- COMPONENT: MemberService AUTHOR: Bruce Phillips, br...@phillips.name DATE: March 2007 PURPOSE: Provides service functions related to a Member CHANGE HISTORY: --- cfcomponent displayname=MemberService output=false hint=Member Service !---document each instance variable--- cfproperty name=dsn displayname=Datasource Name hint=Datasource name used to connect CF to the database type=string !---initilization area - acts like a constructor as its called automatically--- cfscript variables.dsn = 'usr_grp'; /cfscript cffunction name=init access=public output=false returntype=MemberService hint=Constructor for this CFC !--- take in the datasource name as an argument and set it to the variables scope so it's available throughout the CFC --- cfargument name=dsn type=string required=true / cfset variables.dsn = arguments.dsn / !--- return the object itself --- cfreturn this / /cffunction cffunction name=getMemberByUserNameAndPassword access=public output=false returntype=Member hint=Tries to find a record with a matching username and password. If only 1 record is found creates a Member object using the record's column values. cfargument name=aUserName type=string required=true / cfargument name=aPassword type=string required=true /
[flexcoders] Re: flex login popup help needed pleaseeeeeeeee
please guys am stuck. can someone please give an example of a cfc with hard coded username and password and show how to hook it up to my login form and authenticate the user so that if there is login success the viewstack child changes to admin. pleaseee i have read through all the tutorials concerning flex/cf authentication and they are not clear. help me guys.
[flexcoders] Re: geting info of a user who has loged in
hi this is my the login code functionality am using that i got from flex cookbook example and works perfect. login.mxml ?xml version=1.0 encoding=utf-8? mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute title=Login Form mx:Metadata [Event(name=loginSuccessful, type=flash.events.Event)] /mx:Metadata mx:Script ![CDATA[ import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; import mx.utils.ObjectUtil; import mx.controls.Alert; import mx.events.ValidationResultEvent; private function isValid():Boolean { var emailValidResult:ValidationResultEvent = this.emailValidate.validate(this.username_txt.text); var pswdValidResult:ValidationResultEvent = this.pswdValidate.validate(this.password_txt.text); if (emailValidResult.type==ValidationResultEvent.VALID pswdValidResult.type==ValidationResultEvent.VALID) { return true; } else { return false; } } private function authenticateUser():void { if( isValid() ) { authManager.loginUser( this.username_txt.text, this.password_txt.text ); } } private function errorMessage(msg:String):void { //Alert.show( ObjectUtil.toString(event.message) ); this.errorMsg.text = msg; this.errorMsg.height = 15; this.errorMsg.visible = true; } private function serverFault(event:FaultEvent):void { errorMessage(event.message['message']); } private function login_result(event:ResultEvent):void { // login successful, remember the user. if( event.result == true || event.result == TRUE || event.result == 1 || event.result == 1 ) { this.dispatchEvent( new Event('loginSuccessful') ); } else { // login didn't work. show message errorMessage(Login unsuccessful); } } ]] /mx:Script mx:RemoteObject id=authManager destination=ColdFusion source=login_example.cfc.login showBusyCursor=true mx:method name=loginUser result=login_result(event) fault=serverFault(event) / /mx:RemoteObject mx:StringValidator id=emailValidate source={this.username_txt} property=text required=true / mx:StringValidator id=pswdValidate source={this.password_txt} property=text required=true / mx:Form x=0 y=0 mx:FormItem label=User Name: mx:TextInput id=username_txt/ /mx:FormItem mx:FormItem label=Password: mx:TextInput id=password_txt/ /mx:FormItem /mx:Form mx:Text x=0 y=90 id=errorMsg visible=true color=red width=100% height=0 / mx:ControlBar mx:HBox width=100% mx:Button label=Login id=okButton click=authenticateUser();/ mx:Spacer width=100%/ mx:Button label=Cancel id=cancelButton/ /mx:HBox /mx:ControlBar /mx:TitleWindow mainApp.mxml ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute xmlns:view=components.* mx:states mx:State name=Log Out mx:SetProperty target={label1} name=text value=Log Out/ /mx:State /mx:states mx:Script ![CDATA[ import components.*; //Flash Classes import flash.events.Event; import flash.events.MouseEvent; //Flex Classes import mx.containers.TitleWindow; import mx.controls.Alert; import mx.events.CloseEvent; import mx.managers.PopUpManager; import mx.core.IFlexDisplayObject; public var loggedin:Boolean = false; public var pop:Login;
[flexcoders] scaleMode(scaling app)
hi guys i have been reading alex aharui's blog post(http://blogs.adobe.com/aharui/2008/01/flex_and_scalemodes.html) about scaling a flex application and i like it but i have one problem. he says to get better results you have to estimate the size that is width and height of the application other wise if you use percentages the scalemode wont work. now i would like to have my flex app cover the whole screen area and i am currently using percentages (width=100% and height=100%) and when i use the scalemode half of my application is seen the other half is cut away. my question is! is there a way of estimating the width and height of the app if its going to cover the whole screen area without using percentages and is there a way to archive good result even if you are still using percentages. by good result i mean as you shrink the application its contents like text and images also shrink to fit the app so that there are no scroll bars. thanks
[flexcoders] custom image component that uses the url property to load images
hi i downloaded a custom image component that has reflection functionality and i am using to load dynamic images but i keep getting this error Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found. here is the component and my code ReflectionObject.as package { import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.Loader; import flash.events.Event; import flash.geom.Matrix; import flash.net.URLRequest; import mx.core.UIComponent; public class ReflectionObject extends UIComponent { private var _picture:Bitmap; private var _loader :Loader; private var _request:URLRequest; private var _reflection :BitmapData; private var _reflectionHolder :Bitmap; /** * Constructor */ public function ReflectionObject() { _loader = new Loader(); } public function set url(_url:String):void { _request = new URLRequest(_url); loadImage(); } public function loadImage():void { _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadImageComplete); _loader.load(_request); } private function onLoadImageComplete(evt:Event):void { _loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onLoadImageComplete); _picture = _loader.content as Bitmap; addChild(_picture); createReflection(); invalidateDisplayList(); } private function createReflection():void { var iteratorI :Number = 0; var iteratorJ :Number = 0; var flipMatrix :Matrix = new Matrix(); flipMatrix.rotate(Math.PI); flipMatrix.scale( -1, 1 ); flipMatrix.translate(0, _picture.height+1); _reflection = new BitmapData(_picture.width, _picture.height, true, 0xff); _reflection.draw(_picture, flipMatrix); for (iteratorI = 0; iteratorI _picture.height; iteratorI++) { var rowFactor :Number = Math.max(0, 0.6 - (iteratorI / _picture.height)); for (iteratorJ = 0; iteratorJ _picture.width; iteratorJ++) { var pixelValue :uint = _reflection.getPixel32(iteratorJ, iteratorI); var alphaValue :uint = pixelValue 24 0xFF; var rgbValue:uint = pixelValue 0xff; var resultAlpha :uint = alphaValue * rowFactor; _reflection.setPixel32(iteratorJ, iteratorI, resultAlpha 24 | rgbValue); } } _reflectionHolder = new Bitmap(_reflection); _reflectionHolder.y = _picture.y + _picture.height; _reflectionHolder.x = _picture.x; addChild(_reflectionHolder); } override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { super.updateDisplayList(unscaledWidth, unscaledHeight); if(_picture) { height = _picture.height; width = _picture.width; } } override protected function measure():void { super.measure(); measuredWidth = 80; measuredHeight = 80; } } } image.mxml reflection:ReflectionObject url={'images/pics/' + data.img}/ what could be wrong with my code?
[flexcoders] flexstore effect
hi guys how can i achieve the flex store effect when someone clicks on a thumbnail and the thumbnails move beautifully to the right and the details show up on the left. how can i do this with mxml and states. i have the flexstore example but the code is so complicated.
[flexcoders] Centered preloader that displays while image is loading
how can i show a preloader while an image?
[flexcoders] Re: flexstore effect
--- In flexcoders@yahoogroups.com, stinasius stinas...@... wrote: hi guys how can i achieve the flex store effect when someone clicks on a thumbnail and the thumbnails move beautifully to the right and the details show up on the left. how can i do this with mxml and states. i have the flexstore example but the code is so complicated. anyhelp guys? would appreciate it. by the way am using flex builder 2
[flexcoders] Maintaining Login Data in Flex
Hi guys i came across a very nice post on Maintaining Login Data in Flex and since i was working on a project that required authentication using a coldfusion backend and a database, this post caught my eye. how do use the following class to maintain login data and access it from anywhere in my application. here is the like to the tutorial http://www.anujgakhar.com/2007/11/07/maintaining-login-data-in-flex/; and here is the class UserInfo.as package classes.UserInfo { public class UserInfo{ private static var myUserName:String = ; private static var myFullName:String = ; private static var myEmail:String = ; public static function get UserFullName():String{ return UserInfo.myFullName; } public static function set UserFullName(param:String):void{ UserInfo.myFullName = param; } public static function get UserName():String{ return UserInfo.myUserName; } public static function set UserName(param:String):void{ UserInfo.myUserName = param; } public static function get Email():String{ return UserInfo.myEmail; } public static function set Email(param:String):void{ UserInfo.myEmail = param; } public static function getInstanceMemento():Object{ var o:Object = { myUserName: UserInfo.myUserName, myFullName: UserInfo.myFullName, myEmail: UserInfo.myEmail }; return o; } public static function setInstanceMemento(param:Object):void{ UserInfo.myUserName = param.myUserName; UserInfo.myFullName = param.myFullName; UserInfo.myEmail = param.myEmail; } } }
[flexcoders] adding components in alert control
hi how can i add a text/text input, in an alert control in flex?
[flexcoders] tiltle window called through states disabling application
hi guys i have a title window that i call through view states. i would like to know how to disable the whole application when the title window is opened without using the popup class. thanks
[flexcoders] transition effect
hi how can i achieve the transition effect used in this case study when some click's to view details of product and a title window popups and the it moves and resizes so smoothly to show the email form? here is the url to what am talking abt. http://www.relogiosopala.com/;
[flexcoders] sms with flex and coldfusion
how can i send an sms to a mobile phone without the need of a gateway through a flex form using a coldfusion backend?
[flexcoders] Re: sms with flex and coldfusion
isn't there a custom component or can i just write my own code for it? thats what i meant
[flexcoders] array not being refreshed
hi i have a tilelist and i use the selectedItem to populate an array which i then used as a dataprovider for my displayshelf component to show images. when i click an item in the tilelist, the array is populated and my images show up, but when i select another object in the tilelist the images are not changed more like the array is not being refreshed. any advise. here is my code gallery.mxml ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; width=100% height=100% xmlns:local=com.* mx:Binding source=sel.value destination=shelf.selectedIndex / mx:Binding destination=sel.value source=shelf.selectedIndex / mx:Binding source=angle.value destination=shelf.angle / mx:Binding source=pop.value destination=shelf.popout / mx:Array id=img mx:Stringassets/extra_pics/{parentDocument.tiles.selectedItem.img1}/mx:String mx:Stringassets/extra_pics/{parentDocument.tiles.selectedItem.img2}/mx:String mx:Stringassets/extra_pics/{parentDocument.tiles.selectedItem.img3}/mx:String mx:Stringassets/extra_pics/{parentDocument.tiles.selectedItem.img4}/mx:String /mx:Array local:DisplayShelf id=shelf horizontalCenter=0 verticalCenter=0 borderThickness=5 borderColor=#FF dataProvider={img} enableHistory=false width=100%/ mx:VBox horizontalCenter=0 bottom=10 horizontalAlign=center verticalAlign=middle width=100% mx:HBox width=100% mx:Label text=Angle: width=75/ mx:HSlider liveDragging=true id=angle minimum=5 value=20 maximum=90 snapInterval=.1 width=100% / /mx:HBox mx:HBox width=100% mx:Label text=Selection: width=75/ mx:HSlider liveDragging=true id=sel minimum=0 value=0 maximum={shelf.dataProvider.length} snapInterval=1 width=100% / /mx:HBox mx:HBox width=100% mx:Label text=pop: width=75/ mx:HSlider liveDragging=true id=pop minimum=0 value=.8 maximum=1 snapInterval=.01 width=100% / /mx:HBox /mx:VBox /mx:Canvas
[flexcoders] Re: array not being refreshed
even when i use an array collection there is no change. even the displayshelf component has a mechanism of turn an array into arraycollection. i don't know if its possible to have new images loaded in the component dynamically. i have only tried using this component with static images but now my images are a database. any one with an idea?
[flexcoders] tilelist HighlightIndicator effects
hi i would like to define fade or move (or a combination of both) effects for a tilelist's HighlightIndicator so that instead of just appearing or disappearing it moves and fades in when mouse is over an item in tile list and moves and fades out smoothly when mouse roll's out and is over another item. hope am not being extravagant with this. is this possible and if it is, how? thanks
[flexcoders] Re: tilelist HighlightIndicator effects
http://listbase.as/ is broken. any step by step on how to archive this. here is my code for the highlightIndicator, how can i apply a tween effect to it. override protected function drawHighlightIndicator(indicator:Sprite, x:Number, y:Number, width:Number, height:Number, color:uint, itemRenderer:IListItemRenderer):void{ var g:Graphics = indicator.graphics; g.clear(); g.beginFill(0x3f4c6b); g.lineStyle(1,0x6e7c9d); g.drawRoundRect(x,y,itemRenderer.width,height,15,15); g.endFill(); }
[flexcoders] Re: tilelist HighlightIndicator effects
any small example on how to this will be great. am new to actionscript. thanks
[flexcoders] Re: tilelist HighlightIndicator effects
hi where can i find ListBase.as?
[flexcoders] Re: tilelist HighlightIndicator effects
i have seen a nice example on how to change hightlight indicator's alpha to 50% and adds a fade-in effect using Tweener: used it but i get this error 1120: access to undefined property tweener. here is my code import flash.display.Graphics; import flash.display.Sprite; import mx.controls.TileList; import mx.controls.listClasses.IListItemRenderer; import mx.controls.listClasses.ListBase; override protected function drawHighlightIndicator(indicator:Sprite, x:Number, y:Number, width:Number, height:Number, color:uint, itemRenderer:IListItemRenderer):void{ var g:Graphics = indicator.graphics; g.clear(); g.beginFill(0x3f4c6b); g.lineStyle(1,0x6e7c9d); g.drawRoundRect(x,y,itemRenderer.width,height,15,15); g.endFill(); indicator.x = x; indicator.y = y; indicator.alpha = 0; Tweener.addTween(indicator,({alpha:.5, time:1, transition:easeOutCubic})); }
[flexcoders] Re: tilelist HighlightIndicator effects
ok i have gotten it to work, small problem though, the clear function gives me error, as in when i rollout i would like to apply a same effect except this time the alpha is 0. here is my code so far. the error i get is 1020: method marked override must override another method override protected function drawHighlightIndicator(indicator:Sprite, x:Number, y:Number, width:Number, height:Number, color:uint, itemRenderer:IListItemRenderer):void{ var g:Graphics = indicator.graphics; g.clear(); g.beginFill(0x3f4c6b); g.lineStyle(1,0x6e7c9d); g.drawRoundRect(x,y,itemRenderer.width,height,15,15); g.endFill(); indicator.alpha = 0; Tweener.addTween(indicator,({alpha:.8, time:1, transition:easeOutCubic})); } override protected function clearHighlightIndicator(indicator:Sprite,x:Number, y:Number, width:Number, height:Number, color:uint, itemRenderer:IListItemRenderer):void{ if(highlightIndicator) Tweener.addTween(indicator,({alpha:0, time:1, transition:easeOutCubic, onComplete:function():void{Sprite(highlightIndicator).graphics.clear()}})); }
[flexcoders] Re: tilelist HighlightIndicator effects
what is the right parameter to use here?
[flexcoders] how to use a list's change event to refresh an array that is bound to it.
how can i use a list's change event to refresh an array that is bound to the list. for example if the list is populated by an array collection an displays images, how can i use the list's change event to refresh an array that is bound to it and acts as a data provider for another control? an example will be great. thanks
[flexcoders] using sharedobject to maintain login data
i recently built a login system in flex with a coldfusion backend with the help of this forum and i put up the solution on the flex cook book. now i realized that it was kind of incomplete coz though it works perfectly, it still lacks a mechanism to save the login data. so my question is how can i use a sharedObject to save the login info so that it can be used throughout the flex application. here is the flex sample code of the login system i created and posted on cookbook. login_example.mxml ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute xmlns:view=components.* mx:states mx:State name=Log Out mx:SetProperty target={label1} name=text value=Log Out/ /mx:State /mx:states mx:Script ![CDATA[ import components.*; //Flash Classes import flash.events.Event; import flash.events.MouseEvent; //Flex Classes import mx.containers.TitleWindow; import mx.controls.Alert; import mx.events.CloseEvent; import mx.managers.PopUpManager; import mx.core.IFlexDisplayObject; public var loggedin:Boolean = false; public var pop:Login; private function showLogin():void { pop = Login(PopUpManager.createPopUp(Application.application as DisplayObject,Login,true)); pop.showCloseButton =true; PopUpManager.centerPopUp(pop); pop.addEventListener(close,removeMe); pop[cancelButton].addEventListener(click, removeMe); pop.addEventListener( loginSuccessful, handleLoginSucess ); } private function removeMe(event:Event):void { PopUpManager.removePopUp(pop); } private function handleLoginSucess(event:Event):void{ viewstack1.selectedChild = admin; lbl_intro.text = Welcome +pop.username_txt.text; removeMe(event); currentState = 'Log Out'; } ]] /mx:Script mx:Label x=0 y=0 text=Sign In id=label1 buttonMode=true useHandCursor=true mouseChildren=false click=showLogin()/ mx:ViewStack x=0 y=26 id=viewstack1 width=100% height=100% view:Home id=home/ view:Admin id=admin/ /mx:ViewStack mx:Label x=700 y=0 id=lbl_intro/ /mx:Application login.mxml ?xml version=1.0 encoding=utf-8? mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute title=Login Form mx:Metadata [Event(name=loginSuccessful, type=flash.events.Event)] /mx:Metadata mx:Script ![CDATA[ import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; import mx.utils.ObjectUtil; import mx.controls.Alert; import mx.events.ValidationResultEvent; private function isValid():Boolean { var emailValidResult:ValidationResultEvent = this.emailValidate.validate(this.username_txt.text); var pswdValidResult:ValidationResultEvent = this.pswdValidate.validate(this.password_txt.text); if (emailValidResult.type==ValidationResultEvent.VALID pswdValidResult.type==ValidationResultEvent.VALID) { return true; } else { return false; } } private function authenticateUser():void { if( isValid() ) { authManager.loginUser( this.username_txt.text, this.password_txt.text ); } } private function errorMessage(msg:String):void { //Alert.show( ObjectUtil.toString(event.message) ); this.errorMsg.text = msg; this.errorMsg.height = 15; this.errorMsg.visible = true; } private function serverFault(event:FaultEvent):void { errorMessage(event.message['message']); } private function login_result(event:ResultEvent):void { // login successful, remember the user. if( event.result == true ||
[flexcoders] need visual design work done
hi i need a very good visual design to do some visual work for me. what is need is listed below 1- nice dark background that matches the darkroom theme(am using darkroom theme and need a background image) 2- nice effects (resize, move, fade or zoom) for popup ie titlewindow when popuping up and when closing 3- very fluid change effects for viewstack children 4- filter effects for tilelist 5- custom titlewindow with header background image and anchored round close button(dont like the skinned titlewindow of darkroom theme) 6- whatever you feel is good that i have left out. remember that they should be compatible with both flex sdk 2 and sdk 3. am currently using sdk 2. let me know how much it costs. thanks
[flexcoders] Re: tilelist HighlightIndicator effects
hi i have tried everything you have said but i get an error. here is the code i use for clearing the highlightIndicator. the error i get is method marked override must override another method override protected function clearHighlightIndicator(indicator:Sprite, itemRenderer:IListItemRenderer):void{ if(highlightIndicator) Tweener.addTween(indicator,({alpha:0, time:1, transition:easeOutCubic, onComplete:function():void{Sprite(highlightIndicator).graphics.clear()}}));
[flexcoders] Re: how to use a list's change event to refresh an array that is bound to it.
hello any help out there?
[flexcoders] generating codes that users can use to pay for a service
hello guys before i ask this let me say i know that many people will probably suggest using online payment systems like paypal but that is not an option in my case. so this is what i would like to know. i have a website where companies can post ads but before they can post the ad they have to have a code(key) which they purchase. lets say someone wanted to have his ad running for a month and the total monthly charge is 20 dollars, they have to purchase the code for 20 dollars which they input into the system and if valid then they can post their ad. can i create a system in flex/as3/coldfusion to generate the codes and tie a particular code to an amount for example if you want your ad to run for a month and it costs $20 then the system generates different codes that are worth $20 or can i use a database of some kind to store the codes? and how can i validate the code is worth $20? hope my question is clear.
[flexcoders] Re: generating codes that users can use to pay for a service
well am working on an application like ebay where guys can post staff for people to see. before posting staff one has to pay the monthly charge for posting. thought about paypal but in africa people are wary of using their debit cards so i thought may be i could generate keys that they can purchase from lets say convenient stores and supply that key when they are posting staff. so how can this be done?
[flexcoders] titlewindow skinned component
hi how can i skin or where can i get a custom title window component like the one found here http://www.adobe.com/devnet/flex/articles/marketing_platforms_06.html; thanks
[flexcoders] how to close a titlewindow that was not created as a popup
hi how can one how to close a titlewindow that was not created as a popup?
[flexcoders] Re: how to close a titlewindow that was not created as a popup
care to share how?
[flexcoders] dispatching data from remote object cfc query in an event.
hi how can i dispatch data from a remote object call to a cfc query in an event.
[flexcoders] rss feed from various sources in flex
hi how can i create an rss feed reader that gets feed from more than one source. for example if i need to get entertainment news from mtv and other music sources how can i do that in flex and coldfusion?
[flexcoders] Re: how to close a titlewindow that was not created as a popup
i am getting this error when i apply your code. ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.display::DisplayObjectContainer/removeChild() at mx.core::Container/removeChild() at custom_comps::login_register/closeWindow() at custom_comps::login_register/___TitleWindow1_close() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent() at mx.containers::Panel/closeButton_clickHandler()
[flexcoders] Re: how to close a titlewindow that was not created as a popup
am calling it from with the titlewindow i would like to close. i also tried calling it from the parent page that calls the custom titlewindow.
[flexcoders] Re: rss feed from various sources in flex
any tutorial on that?
[flexcoders] move component over text
hi guys how do i move a box component over a text when i rollover the text?
[flexcoders] possibility of opening a web page in a flex application
is it possible to open web page for example(http://www.mtv.com/news/articles/1606473/20090306/rihanna.jhtml) in a flex application let's say inside a flex canvas component?
[flexcoders] Re: how to close a titlewindow that was not created as a popup
this is my code import mx.containers.TitleWindow; private function closeWindow(event:Event):void{ removeChild( event.target as TitleWindow); currentState=''; } then on the titlewindow component this is the way i call the close function mx:State name=login_reg mx:RemoveChild target={intro}/ mx:AddChild relativeTo={intro_container} mx:target comp:login_register id=login_reg close=closeWindow(event) loginSuccessful=handleLoginSucess(event)/ /mx:target /mx:AddChild /mx:State
[flexcoders] storing login data from a cfquery for use throught flex app
hi i got a login form in flex with a coldfusion backend and it work's perfectly but i need it to go one step further. store login data form the cfquery so that it can be reused throughout the flex app. here is a senario. the login form has a username and password textinput fields which are validated using a remote object call to a cfc that queries a db table with username, password and email fields. now when login is successful i would like to store the data returned from the cfc including email for use throughout my application. please help me out here. thanks
[flexcoders] Re: storing login data from a cfquery for use throught flex app
hi i created a storage class that i was using and it works perfectly but i dont know how to use it to get data from a cfc through remote object call. here is my code it works with username and password but when it comes to geting the email address associated with the username and password from the db i dont know how to do that and thats my biggest problem. mainApp.mxml ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute xmlns:view=components.* mx:states mx:State name=Log Out mx:SetProperty target={label1} name=text value=Log Out/ /mx:State /mx:states mx:Script ![CDATA[ import components.*; //Flash Classes import flash.events.Event; import flash.events.MouseEvent; //Flex Classes import mx.containers.TitleWindow; import mx.controls.Alert; import mx.events.CloseEvent; import mx.managers.PopUpManager; import mx.core.IFlexDisplayObject; import mx.utils.ObjectUtil; //static class import classes.UserInfo; public var loggedin:Boolean = false; public var pop:Login; private function showLogin():void { pop = Login(PopUpManager.createPopUp(Application.application as DisplayObject,Login,true)); pop.showCloseButton =true; PopUpManager.centerPopUp(pop); pop.addEventListener(close,removeMe); pop[cancelButton].addEventListener(click, removeMe); pop.addEventListener( loginSuccessful, handleLoginSucess); //UserInfo.Email = pop.authManager.email; } private function removeMe(event:Event):void { PopUpManager.removePopUp(pop); } private function handleLoginSucess(event:Event):void{ viewstack1.selectedChild = admin; lbl_intro.text = Welcome +pop.username_txt.text; removeMe(event); currentState = 'Log Out'; UserInfo.UserName = pop.username_txt.text; UserInfo.Email = pop.authManager.email; //mx.controls.Alert.show(mx.utils.ObjectUtil.toString(pop.authManager)); //trace (UserInfo.Email); } ]] /mx:Script mx:Label x=0 y=0 text=Sign In id=label1 buttonMode=true useHandCursor=true mouseChildren=false click=showLogin()/ mx:ViewStack x=0 y=26 id=viewstack1 width=100% height=100% view:Home id=home/ view:Admin id=admin/ /mx:ViewStack mx:Label x=700 y=0 id=lbl_intro/ /mx:Application login.mxml ?xml version=1.0 encoding=utf-8? mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute title=Login Form mx:Metadata [Event(name=loginSuccessful, type=flash.events.Event)] /mx:Metadata mx:Script ![CDATA[ import mx.collections.ArrayCollection; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; import mx.utils.ObjectUtil; import mx.controls.Alert; import mx.events.ValidationResultEvent; import mx.core.Application; import classes.UserInfo; private function isValid():Boolean { var emailValidResult:ValidationResultEvent = this.emailValidate.validate(this.username_txt.text); var pswdValidResult:ValidationResultEvent = this.pswdValidate.validate(this.password_txt.text); if (emailValidResult.type==ValidationResultEvent.VALID pswdValidResult.type==ValidationResultEvent.VALID) { return true; } else { return false; } } private function authenticateUser():void { if( isValid() ) { authManager.loginUser( this.username_txt.text, this.password_txt.text/* , userCredentials */); UserInfo.isLogged = true; } } private function errorMessage(msg:String):void { //Alert.show(
[flexcoders] Re: storing login data from a cfquery for use throught flex app
hi how do i assign the properties of UserInfo in the result handler?
[flexcoders] Re: storing login data from a cfquery for use throught flex app
in my cfc the return type is boolean and is set to return true if there is a match. when i set the return type to query to return the query result(checkAuthentication), nothing happens. cffunction name=loginUser access=remote returntype=boolean cfargument name=username type=string required=true/ cfargument name=password type=string required=true/ cfquery name=checkAuthentication datasource=authentication SELECT * FROM profile where username = cfqueryparam cfsqltype=cf_sql_varchar value=#arguments.username# and Password = cfqueryparam cfsqltype=cf_sql_varchar value=#arguments.password# /cfquery cfif checkAuthentication.recordCount EQ 1 cfreturn true/ !---cfreturn checkAuthentication--- cfelse cfreturn false/ /cfif /cffunction
[flexcoders] Re: storing login data from a cfquery for use throught flex app
hi, may be i will try to put the question this way, in my cfc i have to return a Boolean value true or false because in my result handler on the login page i test to see if the result returned is true or false then make a decision to accept login or not. this is my result handler on the login page private function login_result(event:ResultEvent):void { // login successful, remember the user. if( event.result == true || event.result == TRUE || event.result == 1 || event.result == 1 ) { this.dispatchEvent( new Event('loginSuccessful') ); } else { // login didn't work. show message errorMessage(Login unsuccessful); } } but if i set the cfc to return a query result in this case checkAuthentication nothing happens. so is there a way of returning a query result and have the result handler check against the returned result in order to make a decision to authenticate or not?