Re: [flexcoders] Question about action script components
Just import the classes into one another and use them as appropriate... E.g., // class com.acme.Foo import com.acme.Bar; public class Foo { public function doSomething() { var bar:Bar = new Bar(); bar.performFunction(); } } // class com.acme.Bar import com.acme.Foo; public class Bar { public function performFunction() { // do work } public function someOtherFunction() { var foo:Foo = new Foo(); foo.doSomething(); } } Depending upon your needs you can instantiate the class instances in the constructors, or even implement a Singleton for access. E.g., // this would go into the Foo class private static var sInstance : Foo; public static function getInstance() : Foo { if (sInstance == undefined) { sInstance = new Foo(); } return sInstance; } Does that help? -ashley [EMAIL PROTECTED] wrote: I am working on a program that has taken too much memory, I get the 32k exceeding error. What I want to know is how do you make an mxml file with two as files and have them access the same files, I know how to get an mxml file to communicate with an as file but how do you get two .as files to access one another? *Yahoo! Groups Links* * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/. Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] Events and Components
You can bind to the result from the GetResults function directly, flex takes care of generating the binding code for you. (no need to dispatch events) E.g., mx:ComboBox dataProvider={this.parent.Webservice1.GetResults.result}/ Or, if you need to invoke a method with the results mx:ComboBox dataProvider={myFunction(this.parent.Webservice1.GetResults.result)}/ define your operation like: mx:operation name=GetResults/ -ashley gevgelija50 wrote: I have a component that contains a combobox. The component is called by the parent application. I want to populate the component's combobox with the result received from the webservice in my parent application. How can I listen to the result event of the main webservice? Currently I have the following setup in my main webservice: mx:operation name=GetResults result={dispatchEvent ('GetResults');} / In my component, I am trying to add a listener as follows: this.parent.Webservice1.GetResults.addEventListener(GetResults, doSomething) This DOES NOT work! Please help. Thanks, Alex *Yahoo! Groups Links* * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/. Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] remoteObject error handling
There are a variety of ways of handling results (success or failure) from the server. One way to do it is to assign a function that should be called on either success of failure. Here is the definition of a RemoteObject, and the processing of a failure is assigned to a function that is assigned to the remote object call. mx:RemoteObject id=services source=com.testcompany.Services mx:method name=insertString result=event.call.resultHandler(event.result) fault=event.call.faulthandler(event.fault) showBusyCursor=true/ /mx:RemoteObject Then, in your ActionScript code to invoke the remote call you would have: function handleFailure(event:Object) { mx.controls.Alert.show(error adding string); } function handleSuccess(event:Object) { mx.controls.Alert.show(success adding string); } function addString(stringValue:String) { var pendingCall = mServices.insertString(stringValue); // make sure to use the delegate utility for correct scoping failureCallback:Function = Delegate.create(this, handleFailure); successCallback:Function = Delegate.create(this, handleSuccess); pendingCall.resultHandler = successCallback; pendingCall.faultHandler = failureCallback; } -ashley digital_eyezed wrote: Hi, I'm calling a remoteObject with an Argument (a String), which inserts it (the string) into a database. However, I have setup the database to not allow duplicate entries. So when testing this in Eclipse and if I try to enter the same data twice I get this error: SQLException: Duplicate entry 'myTest' for key 1 SQLState: 23000 VendorError: 1062 Now, how do I handle this in flex? Regards, Iain *Yahoo! Groups Links* * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/. Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Job Opening
Flex/Flash engineer job opening Brightcove, Inc., a young startup lead by former Macromedia CTO Jeremy Allaire is looking for experienced Flash developers seasoned at building Flex applications to join its engineering team. As a member of this team, you will contribute to the development, release and maintenance of a service that aims to touch millions of people around the world and revolutionize the consumer television experience. The ideal candidate has 3-8 years of experience building dynamic, interactive websites with a solid background in good development practices. All positions are based in Cambridge, MA. Please send your resumes to: [EMAIL PROTECTED] Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] Reloading of Flex WAR
Answering my own question from a while back in case it helps anyone else... (Note: this on version 5.5.7 of tomcat, which I know is officially unsupported) Tomcat 5.x has a setting for anitJARLocking and antiResourceLocking attributes on the Context element in the conf/context.xml. Setting those to true made it possible for us to reload our web-apps. -ashley Ashley Streb wrote: Howdy, I am unable to undeploy a running Flex web-app from Tomcat. When I undeploy it (using the tomcat ant tasks), tomcat leaves behind the following directory structure: WEB-INF/flex/jars/ flex.jar xercesImpl.jar So, instead of just re-waring my files and deploying, I need to stop tomcat, start tomcat and then attempt a redeploy. Has anyone else run into this problem? Any ideas? Thanks! -ashley *Yahoo! Groups Sponsor* ADVERTISEMENT click here http://us.ard.yahoo.com/SIG=1293sr1ta/M=298184.6018725.7038619.3001176/D=groups/S=1705007207:HM/EXP=1109960334/A=2593423/R=0/SIG=11el9gslf/*http://www.netflix.com/Default?mqso=60190075 *Yahoo! Groups Links* * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/. Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Filtering Results from a DataProvider
I wrote a custom data provider that will filter results from a wrapped DataProvider. The idea was that you could plug in different filters; filter on partially typed words, location etc. This custom data provider (FilterDataProvider) extends the mx.control.listclasses.DataProvider class. I'm running into two problems and the solutions to those problems allude me. The first is that my DataGrid is not receiving modelChanged events that my FilterDataProvider fires. The second is that my DataGrid is not setting the selectedItem property when I click on a row. It also does not highlight the row that I clicked. Here is the code from my FilterDataProvider (I've removed some of the extraneous function calls for brevity/readability). The important thing to note is that the FilterDataProvider receives events from its configured filters indicating that something about them has changed and they need to refilter the data. These events are received by the filterDataProvider, which in turn fires off a modelChanged event. I've confirmed that the FilterDataProvider is indeed receiving events from its configured filters (alerting out messages), and I've also confirmed that the DataGrid that this filterDataProvider is configured on never receives the modelChanged event. (I extended the DataGrid class and overrode the modelChanged method, alerted out a message before calling super.modelChanged) Any help is appreciated. Thanks! class FilterDataProvider extends DataProvider { public var source : DataProvider; public var filters : Array; public function get length():Number { var sourceLength:Number = mSource.length; var filteredLength : Number = 0; for (var i:Number = 0; i sourceLength; i++) { var item = mSource.getItemAt(i); if (accept(item)) { filteredLength++; } } return filteredLength; } public function getItemAt(pIndex:Number) { var sourceLength:Number = mSource.length; for (var i:Number = pIndex + mOffset; i sourceLength; i++) { var item = mSource.getItemAt(i); if (accept(item)) { return item; } } return null; } private function accept(pItem) : Boolean { var filterLength:Number = mFilters.length; for (var i:Number = 0; i filterLength; i++) { var filter:Filter = mFilters[i]; if (!filter.accept(pItem)) { return false; } } return true; } public function processFilterChangedEvent(pEvent:Object) { var eventObject : Object; eventObject.type = modelChanged; eventObject.eventName = updateAll; dispatchEvent(eventObject); } } mxml registration... components:FilterDataProvider source={remoteObject.result} id=filterProvider/ components:FancyDataGrid id=videoGrid width=100% height=100% dataProvider=filterProvider -ashley Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/