[flexcoders] Re: Cairngorm Phone Selector in F2B2
I experienced the same problem (error message) when trying to cast the selected item of the master array to it's associated VO. After trying the code from the Store, Login and Phone samples, with no resolution, I decided to work around it - for now. I was able to cast the individual elements (ModelLocator.getInstance ().phoneVO.description = phones[0].description). But, if you had to do this in every command, the idea of a centrally defined VO in the model would be lost. I wonder if something changed to break this feature between Beta1 and Beta2. - Tim Hoff --- In flexcoders@yahoogroups.com, Rick Schmitty [EMAIL PROTECTED] wrote: Hello I'm trying to get the phone selector running on cairngorm 2 and am having some problems After chaning references to http://www.adobe.com/2006/mxml and changing ApplicationView.mxml setPropety from mx:SetProperty property=enabled value=false / to mx:SetProperty name=enabled value=false / I also changed PhoneVO.as to implement ValueObject I now get: Implicit coercion of a value with static type 'Object' to a possibly unrelated type 'com.mycompany.phones.model:PhoneVO' Here is the ApplicationView.mxml ?xml version=1.0 encoding=utf-8? mx:Panel xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:view=com.mycompany.phones.view.* currentState={model.applicationState} height=400 layout=horizontal title=Nokia Phone Selector width=700 mx:Script ![CDATA[ import com.mycompany.phones.model.ApplicationModel; import com.mycompany.phones.model.PhoneVO; import com.mycompany.phones.controller.PhoneGetEvent; import flash.events.Event; public static var STATE_DEFAULT:String = ; public static var STATE_LOADING:String = loading; [Bindable] public var model:ApplicationModel = ApplicationModel.getInstance(); ]] /mx:Script mx:List id=phoneList dataProvider={model.phones} height=100% labelField=name width=150 / view:PhoneDetails id=phoneDetails phone={phoneList.selectedItem} width=100% / mx:states mx:State name={STATE_LOADING} mx:SetProperty name=enabled value=false / /mx:State /mx:states /mx:Panel And here is the PhoneVO: package com.mycompany.phones.model { import org.nevis.cairngorm.vo.ValueObject; [Bindable] [RemoteClass(alias=com.mycompany.phones.model.PhoneVO)] public class PhoneVO implements ValueObject { public var name:String; public var description:String; public var price:Number; public var image:String; public var series:String; public var triband:Boolean; public var camera:Boolean; public var video:Boolean; public var highlight1:String; public var highlight2:String; public function PhoneVO() { name = ; description = ; price = 0; image = ; series = ; triband = false; camera = false; video = false; highlight1 = ; highlight2 = ; } } } And here is PhoneVO.cfc cfcomponent cfproperty name=name type=string default= cfproperty name=description type=string default= cfproperty name=price type=numeric default=0 cfproperty name=image type=string default= cfproperty name=series type=string default= cfproperty name=triband type=boolean default=false cfproperty name=camera type=boolean default=false cfproperty name=video type=boolean default=false cfproperty name=highlight1 type=string default= cfproperty name=highlight2 type=string default= cffunction name=init output=false returntype=com.mycompany.phones.model.PhoneVO cfscript this.name = ; this.description = ; this.price = 0; this.image = ; this.series = ; this.triband = false; this.camera = false; this.video = false; this.highlight1 = ; this.highlight2 = ; /cfscript cfreturn this / /cffunction cffunction name=populate output=false returntype=void cfargument name=data type=Struct / cfscript this.name = data.name; this.description = data.description;
[flexcoders] Re: Singleton not usable?
This a modified version of Jeff Tapper's singleton DataManager class for AS3 web service calls. Francis, note the private class constuctor at the bottom. Sorry about the jagged alignment. - Tim Hoff package code.business { import mx.managers.CursorManager; import flash.events.EventDispatcher; import mx.rpc.soap.WebService; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; import mx.rpc.AbstractOperation; import mx.controls.Alert; import flash.util.*; public class DataServices extends EventDispatcher { private var ws:WebService; private static var instanceMap:Object = new Object(); public function DataServices(pri:PrivateClass, wsdl:String) { this.ws = new WebService(); ws.wsdl = wsdl; ws.loadWSDL(); ws.useProxy = false; } public static function getDataService (wsdl:String):DataServices { if(DataServices.instanceMap[wsdl] == null) { DataServices.instanceMap[wsdl] = new DataServices (new PrivateClass(),wsdl); } var ds:DataServices = DataServices.instanceMap[wsdl]; if(ds.ws.canLoadWSDL()) { return ds; } else { throw new Error(BAD WSDL:+wsdl); } } public function makeRemoteCall (methodName:String,showBusyCursor:Boolean,args:Object):void { var op:mx.rpc.AbstractOperation = ws[methodName]; if(showBusyCursor) { CursorManager.setBusyCursor(); } ws.addEventListener(result,onResult); ws.addEventListener(fault,onFault); if(args) { op.arguments = args; } op.send(); } private function onResult(result:ResultEvent):void { CursorManager.removeBusyCursor(); this.dispatchEvent(result); } private function onFault(fault:FaultEvent):void { CursorManager.removeBusyCursor(); this.dispatchEvent(fault); } public override function toString():String { return DataServices; } } } /** PrivateClass is used to make DataServices constructor private */ class PrivateClass { public function PrivateClass() {} } --- In flexcoders@yahoogroups.com, Francis Cheng [EMAIL PROTECTED] wrote: That works in C# because the default access specifier for class members in C# is private. It won't work in ActionScript 3.0 because the constructor is always public, whether or not you declare it as such. Francis -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of crnet_flex Sent: Friday, April 14, 2006 3:19 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Singleton not usable? Hi Have anyone tried using a construction like the following? public class Singleton { public static const Instance:Singleton = new Singleton(); function Singleton() { } public function doSomething():void { } } This is actually the recommandations of creating a singleton in c#, and it seems that it fullfils the job here as well. I know that, if you use flexbuilder 2 beta, then you'll get a warning if you leave out the scope of the constructor, but maybe it's worth it. By the way, be aware that the singleton posted initially as an example is not a recommended way of creating a singleton, i guess it's not a problem in AS3, but lazy loaded singletons must have a syncronized/looked load section when thread safety is an issue. BR Casper -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 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] Fisheye Component v0.1 (beta 2)
Ely,That's hot... great work!BrendanOn 4/14/06, Ely Greenfield [EMAIL PROTECTED] wrote: I just posted a new custom component I've been toying with that might be instructive to anyone learning Flex 2. Check it out if you like. http://www.quietlyscheming.com/blog/2006/04/14/fisheye-component-v01/ Ely. Chart -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com YAHOO! GROUPS LINKS Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service . -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] Cairngorm Phone Selector in F2B2
Indeed, you need to make a few changes to make it work in beta2 : - http://www.macromedia.com/2005/mxml, changed to : http://www.adobe.com/2006/mxml, - phone={phoneList.selectedItem}, changed to : phone={phoneList.selectedItem as PhoneVO}, - mx:SetProperty property=enabled value=false /, changed to : mx:SetProperty name=enabled value=false /, - public class PhoneVO implements ValueObject, changed to : public dynamic class PhoneVO implements ValueObject. (or you can implement IUID interface as explained here http://www.macmartine.com/blog/2006/03/binding_custom_objects_to_tile.html) I've uploaded an updated version of this Cairngorm2/ColdFusion sample app: http://www.benorama.com/flex/samples/PhonesCairngorm2.zip Benoit Hediard -Message d'origine- De : flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] De la part de Rick Schmitty Envoyé : samedi 15 avril 2006 01:52 À : flexcoders@yahoogroups.com Objet : [flexcoders] Cairngorm Phone Selector in F2B2 Hello I'm trying to get the phone selector running on cairngorm 2 and am having some problems After chaning references to http://www.adobe.com/2006/mxml and changing ApplicationView.mxml setPropety from mx:SetProperty property=enabled value=false / to mx:SetProperty name=enabled value=false / I also changed PhoneVO.as to implement ValueObject I now get: Implicit coercion of a value with static type 'Object' to a possibly unrelated type 'com.mycompany.phones.model:PhoneVO' Here is the ApplicationView.mxml ?xml version=1.0 encoding=utf-8? mx:Panel xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:view=com.mycompany.phones.view.* currentState={model.applicationState} height=400 layout=horizontal title=Nokia Phone Selector width=700 mx:Script ![CDATA[ import com.mycompany.phones.model.ApplicationModel; import com.mycompany.phones.model.PhoneVO; import com.mycompany.phones.controller.PhoneGetEvent; import flash.events.Event; public static var STATE_DEFAULT:String = ; public static var STATE_LOADING:String = loading; [Bindable] public var model:ApplicationModel = ApplicationModel.getInstance(); ]] /mx:Script mx:List id=phoneList dataProvider={model.phones} height=100% labelField=name width=150 / view:PhoneDetails id=phoneDetails phone={phoneList.selectedItem} width=100% / mx:states mx:State name={STATE_LOADING} mx:SetProperty name=enabled value=false / /mx:State /mx:states /mx:Panel And here is the PhoneVO: package com.mycompany.phones.model { import org.nevis.cairngorm.vo.ValueObject; [Bindable] [RemoteClass(alias=com.mycompany.phones.model.PhoneVO)] public class PhoneVO implements ValueObject { public var name:String; public var description:String; public var price:Number; public var image:String; public var series:String; public var triband:Boolean; public var camera:Boolean; public var video:Boolean; public var highlight1:String; public var highlight2:String; public function PhoneVO() { name = ; description = ; price = 0; image = ; series = ; triband = false; camera = false; video = false; highlight1 = ; highlight2 = ; } } } And here is PhoneVO.cfc cfcomponent cfproperty name=name type=string default= cfproperty name=description type=string default= cfproperty name=price type=numeric default=0 cfproperty name=image type=string default= cfproperty name=series type=string default= cfproperty name=triband type=boolean default=false cfproperty name=camera type=boolean default=false cfproperty name=video type=boolean default=false cfproperty name=highlight1 type=string default= cfproperty name=highlight2 type=string default= cffunction name=init output=false returntype=com.mycompany.phones.model.PhoneVO cfscript this.name = ; this.description = ; this.price = 0; this.image = ; this.series = ; this.triband = false;
RE: [flexcoders] Cairngorm Phone Selector in F2B2
Hi Rick Do you think the error is happening on view:PhoneDetails id=phoneDetails phone={phoneList.selectedItem} width=100% / ? Try uncommenting this to verify. How is phone typed in PhoneDetails? If typed as PhoneVO, you'd need to cast selectedItem, which is typed as Object to PhoneVO like: view:PhoneDetails id=phoneDetails phone={PhoneVO( phoneList.selectedItem )} width=100% / Best, Alex Alex Uhlmann Consultant (Rich Internet Applications) Adobe Consulting Westpoint, 4 Redheughs Rigg, South Gyle, Edinburgh, EH12 9DQ, UK p: +44 (0) 131 338 6969 m: +44 (0) 7917 428 951 [EMAIL PROTECTED] -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rick Schmitty Sent: 15 April 2006 00:52 To: flexcoders@yahoogroups.com Subject: [flexcoders] Cairngorm Phone Selector in F2B2 Hello I'm trying to get the phone selector running on cairngorm 2 and am having some problems After chaning references to http://www.adobe.com/2006/mxml and changing ApplicationView.mxml setPropety from mx:SetProperty property=enabled value=false / to mx:SetProperty name=enabled value=false / I also changed PhoneVO.as to implement ValueObject I now get: Implicit coercion of a value with static type 'Object' to a possibly unrelated type 'com.mycompany.phones.model:PhoneVO' Here is the ApplicationView.mxml ?xml version=1.0 encoding=utf-8? mx:Panel xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:view=com.mycompany.phones.view.* currentState={model.applicationState} height=400 layout=horizontal title=Nokia Phone Selector width=700 mx:Script ![CDATA[ import com.mycompany.phones.model.ApplicationModel; import com.mycompany.phones.model.PhoneVO; import com.mycompany.phones.controller.PhoneGetEvent; import flash.events.Event; public static var STATE_DEFAULT:String = ; public static var STATE_LOADING:String = loading; [Bindable] public var model:ApplicationModel = ApplicationModel.getInstance(); ]] /mx:Script mx:List id=phoneList dataProvider={model.phones} height=100% labelField=name width=150 / view:PhoneDetails id=phoneDetails phone={phoneList.selectedItem} width=100% / mx:states mx:State name={STATE_LOADING} mx:SetProperty name=enabled value=false / /mx:State /mx:states /mx:Panel And here is the PhoneVO: package com.mycompany.phones.model { import org.nevis.cairngorm.vo.ValueObject; [Bindable] [RemoteClass(alias=com.mycompany.phones.model.PhoneVO)] public class PhoneVO implements ValueObject { public var name:String; public var description:String; public var price:Number; public var image:String; public var series:String; public var triband:Boolean; public var camera:Boolean; public var video:Boolean; public var highlight1:String; public var highlight2:String; public function PhoneVO() { name = ; description = ; price = 0; image = ; series = ; triband = false; camera = false; video = false; highlight1 = ; highlight2 = ; } } } And here is PhoneVO.cfc cfcomponent cfproperty name=name type=string default= cfproperty name=description type=string default= cfproperty name=price type=numeric default=0 cfproperty name=image type=string default= cfproperty name=series type=string default= cfproperty name=triband type=boolean default=false cfproperty name=camera type=boolean default=false cfproperty name=video type=boolean default=false cfproperty name=highlight1 type=string default= cfproperty name=highlight2 type=string default= cffunction name=init output=false returntype=com.mycompany.phones.model.PhoneVO cfscript this.name = ; this.description = ; this.price = 0; this.image = ; this.series = ; this.triband = false; this.camera = false; this.video = false;
[flexcoders] Re: How Users can Move Popup Windows
Thanks Jeremy. I have tried Application.aplication as the parent and it did not work. I cannot drag the window. What is the difference between addPopup and createPopup --- In flexcoders@yahoogroups.com, jeremy lu [EMAIL PROTECTED] wrote: write off my head, try this: w = PopUpManager.createPopUp(Application.application, EventsSettings, false); another way to do this would be extending Panel/TitleWindow then listens to titleBar events to implement drag and drop. jeremy. On 4/15/06, mvbaffa [EMAIL PROTECTED] wrote: I have created, in Flex 2 Beta 2, a non modal Popup, that has a component for data entry inside it. I would like to allow the user to drag the Popup Window around the screen and position it wherever he wants. I tried two approches: 1) The TitleWindow is defined in MXML, inside the component, as the container of the data entry components. 2) The component does not have the TitleWindow and I create it in actionscript. In both cases I have a TitleWindow as the container of all the data entry controls. The problem is that if I create the Popup with createPopUp with the component that has the TitleWindow inside it, like this: w = PopUpManager.createPopUp(this, EventsSettings, false); It is not possible to drag the window. It works OK but it simply cannot be dragged. If I create the TitleWindow in actionscript, add the component, that has only the data entry components, to the Titlewindow, and then use the addPopUp method to show the PopUp with the TitleWindow like this: public var settingsWindow:TitleWindow = new TitleWindow (); settingsWindow.title = My Window Title; settingsWindow.styleName=PopupHeader; settingsWindow.showCloseButton = true; settingsWindow.x = 300; settingsWindow.y = 300; var ctl:EventsSettings = new EventsSettings(); settingsWindow.addChild(ctl); PopUpManager.addPopUp(settingsWindow, this, false); The created Popup can be dragged and everything works. The problem is that is more comfortable to have the TitleWindow in MXML, we can modify more easily the properties. How Can I use createPopup and still be capable of dragging the result Popup Window -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders% 40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 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] Finding the Cursor Position in a RichTextEditor (Beta 2)
Is there a way to find the current position of the cursor on a RichTextEditor control? I see how to get the start and end position of selected text, but not how to get the single index of the cursor (when there isn't any text selected/highlighted). thanks, ~harris -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 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] Re: How Users can Move Popup Windows
hi, I think the problem lies in your mxml component, the default titleBar color is transparent, hence it's pretty hard to drag it, try something like this in your TitleWindow component: mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml xmlns=* layout=absolute borderAlpha=1 width=200 height=100 headerColors=[0xff, 0xffeedd] mx:Button label=test / /mx:TitleWindow note the borderAlpha setting will make sure the tileBar of the panel is opaque, and setting random colors will ensure the window is easily draggable. I can use both method to create the pop up window (zz is the component above): 1. var b:zz = new zz(); PopUpManager.addPopUp(b, Application.application, false); 2. PopUpManager.createPopUp(Application.application, zz, false); hth, jeremy. On 4/15/06, mvbaffa [EMAIL PROTECTED] wrote: Thanks Jeremy.I have tried Application.aplication as the parent and it did notwork. I cannot drag the window.What is the difference between addPopup and createPopup --- In flexcoders@yahoogroups.com, jeremy lu [EMAIL PROTECTED] wrote: write off my head, try this: w = PopUpManager.createPopUp(Application.application,EventsSettings, false); another way to do this would be extending Panel/TitleWindow thenlistens to titleBar events to implement drag and drop. jeremy. On 4/15/06, mvbaffa [EMAIL PROTECTED] wrote: I have created, in Flex 2 Beta 2, a non modal Popup, that has a component for data entry inside it. I would like to allow theuser to drag the Popup Window around the screen and position it wherever he wants. I tried two approches: 1) The TitleWindow is defined in MXML, inside the component, asthe container of the data entry components. 2) The component does not have the TitleWindow and I create it in actionscript. In both cases I have aTitleWindow as the container of all thedata entry controls. The problem is that if I create the Popup with createPopUp withthe component that has the TitleWindow inside it, like this: w = PopUpManager.createPopUp (this, EventsSettings,false); It is not possible to drag the window. It works OK but it simply cannot be dragged. If I create the TitleWindow in actionscript, add the component, that has only the data entry components, to the Titlewindow, and thenuse the addPopUp method to show the PopUp with the TitleWindow likethis: public var settingsWindow:TitleWindow = new TitleWindow (); settingsWindow.title = My Window Title; settingsWindow.styleName=PopupHeader; settingsWindow.showCloseButton = true; settingsWindow.x = 300; settingsWindow.y = 300; var ctl:EventsSettings = new EventsSettings(); settingsWindow.addChild(ctl); PopUpManager.addPopUp(settingsWindow, this, false); The created Popup can be dragged and everything works. The problem is that is more comfortable to have the TitleWindow in MXML, we can modify more easily the properties. How Can I use createPopup and still be capable of dragging the result Popup Window -- Flexcoders Mailing List FAQ:http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links --Flexcoders Mailing ListFAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 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 Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] Flex Flash Remoting Question
Thank You That Clears Up Everything, Thank You So Much :) Simeon Bateman wrote: Hi Faisal, In the code you posted the id is the name you reference the remote object by in AS. so you could call methods on your remote cfc by mycfc.cfFunctionName(). The source attribute is the path from the webroot to your cfc. Remember to use the package notation to specify this. An example could be source=appname.remote.userService Where userService.cfc is in a folder called remote in side a folder called appname. The appname folder would be at the root of your site. Of course you could also just have your cfc in the root of the site and not use any folders :) Hope that helps you get on the path. simeon On 4/14/06, *Faisal Abid* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: What does ID mean ? Does it mean the file name of the cfc eg myCFC.cfc or is it just a name give to the RemoteObject Call? Also what does the source= mean, like what exatly do i have to put there if my cfc is in the folder [webroot]/coldfusion/get_posts.cfc? -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com YAHOO! GROUPS LINKS * Visit your group flexcoders http://groups.yahoo.com/group/flexcoders on the web. * 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/. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 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] beta 2: possible styleSheet bug with Text and TextArea component
When setting a styleSheet of a Text or TextArea component I get the following errors when assigning text to the htmlText property: IllegalOperationError: Error #2009: This method cannot be used on a text field with a style sheet. at mx.core::UITextField/validateNow() at mx.core::UITextField/set text() at mx.controls::Label/mx.controls:Label::commitProperties() at mx.controls::Text/mx.controls:Text::commitProperties() at mx.core::UIComponent/validateProperties() at mx.managers::LayoutManager/validateProperties() at mx.managers::LayoutManager/::doPhasedInstantiation() at mx.core::UIComponent/::callLaterDispatcher2() at mx.core::UIComponent/::callLaterDispatcher() IllegalOperationError: Error #2009: This method cannot be used on a text field with a style sheet. at mx.core::UITextField/validateNow() at mx.core::UIComponent/::callLaterDispatcher2() at mx.core::UIComponent/::callLaterDispatcher() In this case, mx:Text is inside a repeater component and the stylesheet is applied when data is received from a webservice call. import flash.text.StyleSheet; // private var article_ss:StyleSheet; private function initBlogPanel():void { this.article_ss = new StyleSheet(); this.article_ss.setStyle(a, {color:#99FF00}); } private function getBlogItemsResultHandler(evt:ResultEvent):void { var result:ArrayCollection = new ArrayCollection(evt.result as Array); // note: at this time, the repeater has already executed // loop through recordset and assign stylesheet to text var len:uint = result.length; var _txt:Text; for(var i:uint = 0; ilen ;i++) { _txt = articleText_txt[i]; _txt.styleSheet = this.article_ss; } } mx:Repeater id=blog_rep width=100% height=100% dataProvider={blog_ws.getBlogItems.result} repeatEnd=blogRepRepeatEndHandler(event); mx:Text id=articleText_txt width=100% htmlText={blog_rep.currentItem.BLOGSHORTTEXT}/ /mx:Repeater I also noticed that the repeaterEnd event (of the Repeater component) is triggered *before* the result event of the webservice method call. That doesn't seem right to me. I'd expect the result event to be invoked before the repeater executes. regards, Muzak -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 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] Flex2/EJB3 integration: problems mapping Java/AS3 classes
Hi,I've been getting fun this weekend integrating Flex2 with ObjectWeb's EasyBeans (an early EJB3 container implementation).I've been able to comunicate through remoting with stateless, stateful and entity beans without problem, but with the last case (entity) I was trying to map an Employee Java class to its corresponding AS3 version and I was not able to do it. The result method working is the following (as you notice I'm using Object and all works ok): public function onResultGet(emp:Object):void { result_lb.text = Resultado: + emp.name + (id: + emp.id + );} But If I try something like:public function onResultGet(result:Object):void { var emp:Employee = Employee(result); //or var emp:Employee = result as Employee; result_lb.text = Resultado: + emp.name + (id: + emp.id + ); } I get a runtime player exception with messages pointing me to a Coercion problem or something like that.Could anyone tell me what's the correct _expression_ to handle an Employee object without having errors?, I know the Employee is reaching my flash client watching the traces in my server. Thanks in advance.-- ::| Carlos Rovira::| http://www.carlosrovira.com -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[flexcoders] Re: Flex2/EJB3 integration: problems mapping Java/AS3 classes
ok, I though I should post the Employee classes as well:the AS3:--package org.objectweb.easybeans.examples.entitybean { [Bindable] [RemoteClass(alias=org.objectweb.easybeans.examples.entitybean.Employee )] public class Employee { public var id:int; public var name:String; }}--the Java one:/*** EasyBeans* Copyright (C) 2006 Bull S.A.S.* Contact: [EMAIL PROTECTED]** This library is free software; you can redistribute it and/or* modify it under the terms of the GNU Lesser General Public* License as published by the Free Software Foundation; either * version 2.1 of the License, or any later version.** This library is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details.** You should have received a copy of the GNU Lesser General Public* License along with this library; if not, write to the Free Software* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA** --* $Id: Employee.java 9 2006-02-19 18:53:32Z benoitf $* -- */package org.objectweb.easybeans.examples.entitybean;import javax.persistence.Entity;import javax.persistence.Id;import javax.persistence.Table; /*** Define an employee with an id and a name.* @author Florent Benoit*/@Entity@Table(name = EMPLOYEES)public class Employee implements java.io.Serializable { /** * Id for serializable class. */ private static final long serialVersionUID = -236627462547454L; /** * Id of this employee. */ private int id; /** * Name of the employee. */ private String name; /** * Gets the Id of the employee. * @return the id of the employee. */ @Id public int getId() { return id; } /** * Sets id of the employee. * @param id the id's employee */ public void setId(final int id) { this.id = id; } /** * Sets the name. * @param name of employee. */ public void setName(final String name) { this.name = name; } /** * Gets the name of the employee. * @return name of the employee. */ public String getName() { return name; } /** * Computes a string representation of this employee. * @return string representation. */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(Employee[id=).append(id).append(, name=).append(getName()).append(]); return sb.toString(); }}Thanks again :)On 4/16/06, Carlos Rovira [EMAIL PROTECTED] wrote:Hi,I've been getting fun this weekend integrating Flex2 with ObjectWeb's EasyBeans (an early EJB3 container implementation). I've been able to comunicate through remoting with stateless, stateful and entity beans without problem, but with the last case (entity) I was trying to map an Employee Java class to its corresponding AS3 version and I was not able to do it. The result method working is the following (as you notice I'm using Object and all works ok): public function onResultGet(emp:Object):void { result_lb.text = Resultado: + emp.name + (id: + emp.id + );} But If I try something like:public function onResultGet(result:Object):void { var emp:Employee = Employee(result); //or var emp:Employee = result as Employee; result_lb.text = Resultado: + emp.name + (id: + emp.id + ); } I get a runtime player exception with messages pointing me to a Coercion problem or something like that.Could anyone tell me what's the correct _expression_ to handle an Employee object without having errors?, I know the Employee is reaching my flash client watching the traces in my server. Thanks in advance.-- ::| Carlos Rovira::| http://www.carlosrovira.com -- ::| Carlos Rovira::| http://www.carlosrovira.com -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[flexcoders] FlexBuilder 2 and Flex 1.5
Had anybody had any luck with figuring outplugins/workflow that might allowfor working with Flex1.5 projects inFlexBuilder 2, with at least the following support #code coloring mxml(including as in script block) #code coloringas # code hinting mxml(including as in script block) # code hintingas # contextual help (as in F1 on keyword pulls up livedocs etc.) Any pointers would be highly appreciated. TIA - superabe -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] FlexBuilder 2 and Flex 1.5
its not possible. why don't u just use eclipse with asdt plugin for the as and the wtp plugin for the mxml. darron schall posted about this on his blog a while ago.On 4/15/06, superabe superabe [EMAIL PROTECTED] wrote: Had anybody had any luck with figuring outplugins/workflow that might allowfor working with Flex1.5 projects inFlexBuilder 2, with at least the following support #code coloring mxml(including as in script block) #code coloringas # code hinting mxml(including as in script block) # code hintingas # contextual help (as in F1 on keyword pulls up livedocs etc.) Any pointers would be highly appreciated. TIA - superabe -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. -- j:pn http://www.lennel.org -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[flexcoders] Good Code Stops Working For Me Too
I have some MXML TitleWindow components that have form field that are bound totheir respective VO's. These were working fine but when I started implementing validation with the Validators components Binding stopped working in these TitleWindow components. I have spent several days trying to figure out what has gone wrong but I am certain that the code is good. So I decided to duplicate the code, so I created a new blank file and copied and paste the code into it. I'm using cairngorm and it has a ViewHelper so I did the same with this. The code for the new files is identical with the exception of the name changes for the MXML file and the ViewHelper file. Now when I run the app, the duplicated files work correctly and display the bound data. But the original files are still not binding even though the new Component is running correctly in the same app at the same time! I have read a post by Libby that mentioned good code stops working and followed the response by Matt Chotin, but am still unable to fix the problem (if its the same!). To Adobe/MM: If this is a bug in Flex 1.5, do youintend to release an update for it? Simon -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] FlexBuilder 2 and Flex 1.5
Thanks, will try that out. - superabe On 4/15/06, Johannes Nel [EMAIL PROTECTED] wrote: its not possible. why don't u just use eclipse with asdt plugin for the as and the wtp plugin for the mxml. darron schall posted about this on his blog a while ago. On 4/15/06, superabe superabe [EMAIL PROTECTED] wrote: Had anybody had any luck with figuring outplugins/workflow that might allowfor working with Flex1.5 projects inFlexBuilder 2, with at least the following support #code coloring mxml(including as in script block) #code coloringas # code hinting mxml(including as in script block) # code hintingas # contextual help (as in F1 on keyword pulls up livedocs etc.) Any pointers would be highly appreciated. TIA - superabe --Flexcoders Mailing ListFAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. -- j:pn http://www.lennel.org --Flexcoders Mailing ListFAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[flexcoders] Re: Cairngorm Phone Selector in F2B2
Try making the constant bindable: [Bindable] public static var STATE_LOADING:String = ; - Tim Hoff --- In flexcoders@yahoogroups.com, Rick Schmitty [EMAIL PROTECTED] wrote: Thanks for your help with the changes! That did it as well Alex Benoit, I got a 404 when trying to grab http://www.benorama.com/flex/samples/PhonesCairngorm2.zip Also, now it says Data binding will not be able to detect assignments to STATE_LOADING. in reference to this mx:states mx:State name={STATE_LOADING} mx:SetProperty name=enabled value=false / /mx:State /mx:states On 4/15/06, Alex Uhlmann [EMAIL PROTECTED] wrote: Hi Rick Do you think the error is happening on view:PhoneDetails id=phoneDetails phone={phoneList.selectedItem} width=100% / ? Try uncommenting this to verify. How is phone typed in PhoneDetails? If typed as PhoneVO, you'd need to cast selectedItem, which is typed as Object to PhoneVO like: view:PhoneDetails id=phoneDetails phone={PhoneVO( phoneList.selectedItem )} width=100% / Best, Alex Alex Uhlmann Consultant (Rich Internet Applications) Adobe Consulting Westpoint, 4 Redheughs Rigg, South Gyle, Edinburgh, EH12 9DQ, UK p: +44 (0) 131 338 6969 m: +44 (0) 7917 428 951 [EMAIL PROTECTED] -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rick Schmitty Sent: 15 April 2006 00:52 To: flexcoders@yahoogroups.com Subject: [flexcoders] Cairngorm Phone Selector in F2B2 Hello I'm trying to get the phone selector running on cairngorm 2 and am having some problems After chaning references to http://www.adobe.com/2006/mxml and changing ApplicationView.mxml setPropety from mx:SetProperty property=enabled value=false / to mx:SetProperty name=enabled value=false / I also changed PhoneVO.as to implement ValueObject I now get: Implicit coercion of a value with static type 'Object' to a possibly unrelated type 'com.mycompany.phones.model:PhoneVO' Here is the ApplicationView.mxml ?xml version=1.0 encoding=utf-8? mx:Panel xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:view=com.mycompany.phones.view.* currentState={model.applicationState} height=400 layout=horizontal title=Nokia Phone Selector width=700 mx:Script ![CDATA[ import com.mycompany.phones.model.ApplicationModel; import com.mycompany.phones.model.PhoneVO; import com.mycompany.phones.controller.PhoneGetEvent; import flash.events.Event; public static var STATE_DEFAULT:String = ; public static var STATE_LOADING:String = loading; [Bindable] public var model:ApplicationModel = ApplicationModel.getInstance(); ]] /mx:Script mx:List id=phoneList dataProvider={model.phones} height=100% labelField=name width=150 / view:PhoneDetails id=phoneDetails phone={phoneList.selectedItem} width=100% / mx:states mx:State name={STATE_LOADING} mx:SetProperty name=enabled value=false / /mx:State /mx:states /mx:Panel And here is the PhoneVO: package com.mycompany.phones.model { import org.nevis.cairngorm.vo.ValueObject; [Bindable] [RemoteClass(alias=com.mycompany.phones.model.PhoneVO)] public class PhoneVO implements ValueObject { public var name:String; public var description:String; public var price:Number; public var image:String; public var series:String; public var triband:Boolean; public var camera:Boolean; public var video:Boolean; public var highlight1:String; public var highlight2:String; public function PhoneVO() { name = ; description = ; price = 0; image = ; series = ; triband = false; camera = false; video = false; highlight1 = ; highlight2 = ; } } } And here is PhoneVO.cfc
Re: [flexcoders] FlexBuilder 2 and Flex 1.5
i used to use oxygen plugin for mxml and after some gerrymadering it would hint on the tags. nothing for the code though. i am certain it will work with wpt as well, just specify the flex 1.5 schemaOn 4/16/06, superabe superabe [EMAIL PROTECTED] wrote: Just installed all the plugins as specified at http://www.darronschall.com/weblog/archives/000182.cfm and the ASDT plugin. However, I dont see # intellisense for mxml tags ( as in code prompts) # color coding for as in mxml tags Are these supposed to work with these plugins ? TIA - superabe On 4/15/06, superabe superabe [EMAIL PROTECTED] wrote: Thanks, will try that out. - superabe On 4/15/06, Johannes Nel [EMAIL PROTECTED] wrote: its not possible. why don't u just use eclipse with asdt plugin for the as and the wtp plugin for the mxml. darron schall posted about this on his blog a while ago. On 4/15/06, superabe superabe [EMAIL PROTECTED] wrote: Had anybody had any luck with figuring outplugins/workflow that might allowfor working with Flex1.5 projects inFlexBuilder 2, with at least the following support #code coloring mxml(including as in script block) #code coloringas # code hinting mxml(including as in script block) # code hintingas # contextual help (as in F1 on keyword pulls up livedocs etc.) Any pointers would be highly appreciated. TIA - superabe --Flexcoders Mailing ListFAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. -- j:pn http://www.lennel.org --Flexcoders Mailing ListFAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. -- j:pn http://www.lennel.org -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.