RE: [flexcoders] Getting a Sprite into a Flex Container?
Thanks a lot Amol (and Maciek)! In between I found that I can go a different way and use a TileList instead but I'm sure your ideas will be useful a bit later for what I'm planning to do! Maybe somebody can give me a hint with a different problem . I'm loading several small images into a TileList Component. These images are 32x32 pixels in size. I've created my own ItemListRenderer where I'm using a HBox (but a Canvas would do well too). My problem is that I cannot get rid of the vertical gap between a row of tiles. I've set verticalGap in the ItemListRenderer to 0 but there is always a gap of 4 or so pixels. But I'd like to have no gap between the items. Horizontally there is no gap if I set horizontalGap to 0 but verticalGap seems not to do it and I've alsdo tried various different components for it like Canvas, HBox, VBox etc. Any idea? Thanks Happy new year! Sascha _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Amol Pandhare Sent: Monday, 01 January, 2007 16:20 To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Getting a Sprite into a Flex Container? Hey Sascha, I hope this is what you were looking for. I have a class which extends Sprite as below: package { public class myShape extends Sprite { . . . . . } } Now I have my owns custom component class file which I have added as follows: First in the Application tag of your mxml file, mention a additional attribute as 'xmlns:greet=com.*'. Here refer to the package where your custom component class is. Now use following to add the component to the Flex mxml file: greet:test id=apiref / Here 'greet' is the xmlns which we added in the application tag and 'test' is my custom component class. You have to be careful to extend your custom component class with the UIComponent class like: package com { //import myShape class if not in same package. public class test extends UIComponent { .. public function test() { var shapeObj:myShape = new myShape(); addChild(shapeObj); } . } } Now in the test class you can add the earlier Sprite extended class by creating its object as above. This should solve your purpose. Now the above mentioned test class can extend any of the Classes like Canvas, or any container class. But UIComponent happens to be the base class to all the container classes n so UIComponent could be best opted choice. Regards, Amol. - Original Message From: Sascha [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, December 30, 2006 3:40:33 PM Subject: [flexcoders] Getting a Sprite into a Flex Container? Hi, I got a class that extends Sprite that I want to put into a Flex DisplayObject container (Canvas or any similar custom made component). My question is: Is implementing the IUIComponent interface the only way to get this working or Are there any other ways around it? A SWFLoader is not what can use in this situation. Any hints would be appreciated. Thanks in advance, Sascha __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
[flexcoders] Re: Multiple ComboBox Selection and Tree from XML
I have managed to get this to work, I had to reformat my xml data file. Now that I have that working, how would I capture the users selection to populate the second and and then the third combobox. Thank you for the previous post and direction. Regards, !---end of code-- ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute xmlns:adobe=http://www.adobe.com/2006/fc; initialize=e4xService.send() mx:HTTPService id=e4xService url=data/data.xml result=resultHandler(event) resultFormat=e4x/ mx:Script ![CDATA[ import mx.events.ListEvent; import mx.rpc.events.ResultEvent; [Bindable] private var xmlData:XMLList; [Bindable] private var selectedXML:XML; private function resultHandler(event:ResultEvent):void { var result:XML = event.result as XML; xmlData = result..location as XMLList; } private function listChangeHandler(event:Event):void { } ]] /mx:Script mx:MenuBar x=10 y=10 width=780 height=72 cornerRadius=5/ mx:MenuBar mx:HDividedBox x=10 y=90 width=780 height=352 mx:Panel width=386 height=352 layout=absolute title=myQuest fontFamily=Verdana mx:ComboBox id=mybox1 dataProvider={xmlData} labelField=@label width=157 x=10 y=92 change=listChangeHandler(event)/ !---end of code-- --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: If the data can be in one file then that is the easiest way to do it. Use HTTPService with resultFormat=e4x to get the data into Flex. Then use an e4x expression to return an XMLList of the correct nodes for the first combo box. When you have that working, post back. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of dranoel1967 Sent: Friday, December 29, 2006 1:24 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Multiple ComboBox Selection and Tree from XML I will be using this xml file, I'm very open to changes... I have several other Locations to add 18 in all. My first thought was to create a seperate xml file for each, but as you see I currently have then in one large file. Thanks again, !---start of xml file -- ?xml version=1.0 encoding=UTF-8? Locations Location NamemyLocation 1/Name ID1/ID Organization NameOrganization 1/Name ID2/ID Role NameRoleName 1/Name Assignment NamemyAssign 1/Name Sub NamemyAssign SubName 1/Name ID1/ID Description![CDATA[P ALIGN=LEFTFONT LETTERSPACING=0 KERNING=0You determine the resource impact of pends FONT COLOR=#FFThis is a full description of this Assignment's Sub Category./ FONT/P]]/Description RoleProfilehttp://www.newURL.com http://www.newURL.com /RoleProfile AntLearn![CDATA[P ALIGN=LEFTFONT LETTERSPACING=0 KERNING=0Experience communicating through e-mail and leading meetings with confidence. /FONT/P]]/AntLearn OpenPositionhttp://www.newURL.com http://www.newURL.com / OpenPosition /Sub Sub NamemyAssign SubName 2/Name ID2/ID Description![CDATA[P ALIGN=LEFTFONT LETTERSPACING=0 KERNING=0Our Online Web Information Exchange. This is your one-stop resource for learning the latest news about us and our industry, as well as the place to access information and tools to help you with your professional and personal life./FONT/P]]/Description RoleProfileinsert intranet url/RoleProfile AntLearnInsert your full text here/AntLearn OpenPositionhttp://www.newUrl.com http://www.newUrl.com / OpenPosition /Sub /Assignment /Role /Organization /Location Location NamemyLocation 2/Name ID2/ID Organization NameOrganization 2/Name ID2/ID Role NamemyRoleName 2/Name Assignment NameMyNextAssign/Name Sub NameMyNexAssign Sub1/Name ID2/ID Description![CDATA[P ALIGN=LEFTFONT LETTERSPACING=0 KERNING=0You determine the resource impact of pends FONT COLOR=#FFThis is a full description of this Assignment's Sub Category./ FONT/P]]/Description RoleProfilehttp://www.newIntranetURL.com http://www.newIntranetURL.com / RoleProfile AntLearn![CDATA[P ALIGN=LEFTFONT LETTERSPACING=0 KERNING=0Experience communicating through e-mail and leading meetings with confidence. /FONT/P]]/AntLearn
[flexcoders] Closing An Open Item In Flex Tree Control
Anyone have a working example they can point me to that demonstrates how to close an open item in a Flex Tree control? After studying the Tree control in the Flex 2 Language Reference, it seems to indicate that method expandItem will also close an open item if the second argument is set to false. However, I've not gotten that to work. I can open items using method expandItem just fine. Of course, the Flex 2 Developer's Guide only has very limited information on using the Tree control's methods and I've not found anything when doing an Internet search. Bruce
[flexcoders] ViewStates vs ViewStacks in App Control
I am trying to build out a basic framework for my application and I have about 4 different screens that users can view depending on what they are trying to do in the applications: Welcome Graphics Login Screen Overview Screen Detailed View Screen Generate Reports Screen These screens don't share similar menus or components so I am thinking it is best to create a view stack for navigating between the different screens - Application ViewStack Welcome Graphics Login Screen Overview Screen Detailed View Screen Generate Reports Screen Here are my questions: 1) If I do this, can I add a loader to each child of the ViewStack so that the user does not have to wait for the entire app to load in order to start the application? 2) I could also do this using ViewStates, but it seems to me that ViewStates are more useful when there are significant shared assets components between the different states. However, performance-wise would it be better to use one over the other? 3) In the long run (should my application grow larger) would it be better to use a modular approach and load modules for each view? However because I am using Cairngorm would this add an extra layer of difficulty trying to maintain/share a ModelLocator, FrontController, etc between a number of different modules? Thanks for your advice. It always seems the design decisions are much more confusing than the actual coding!! - Kevin
Re: [flexcoders] ViewStates vs ViewStacks in App Control
- Original Message - From: Kevin Merritt [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Monday, January 01, 2007 7:27 PM Subject: [flexcoders] ViewStates vs ViewStacks in App Control I am trying to build out a basic framework for my application and I have about 4 different screens that users can view depending on what they are trying to do in the applications: Welcome Graphics Login Screen Overview Screen Detailed View Screen Generate Reports Screen These screens don't share similar menus or components so I am thinking it is best to create a view stack for navigating between the different screens - Application ViewStack Welcome Graphics Login Screen Overview Screen Detailed View Screen Generate Reports Screen Perhaps: Application default state Welcome Graphics Login Screen Application logged on state ViewStack Overview Screen Detailed View Screen Generate Reports Screen Apart from the obvious logon situation I think states can work really well within components. Here are my questions: 1) If I do this, can I add a loader to each child of the ViewStack so that the user does not have to wait for the entire app to load in order to start the application? This already happens with components instantiated on demand as you run through the view stack. 2) I could also do this using ViewStates, but it seems to me that ViewStates are more useful when there are significant shared assets components between the different states. However, performance-wise would it be better to use one over the other? I would split the different 'screens' into separate flex components and add them into the viewstack. Having them as separate components makes the app much more modular - my designs are components nested within components like building bricks. Use events to communicate between components (or more properly your MVC architecture). 3) In the long run (should my application grow larger) would it be better to use a modular approach and load modules for each view? See how it goes - build as much as you need - when/if it gets slow, look again at re-architecting the application using components you have built. Don't make things more complicated than it needs to be. However because I am using Cairngorm would this add an extra layer of difficulty trying to maintain/share a ModelLocator, FrontController, etc between a number of different modules? Don't really see how Cairngorm would affect this. If you build in complication it will be complicated with or without Cairngorm. Paul Thanks for your advice. It always seems the design decisions are much more confusing than the actual coding!! - Kevin -- 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] Flex bug? undefined state
Hi List, Sorry for the long winded post, but I'm completely baffled by an exception that my app is throwing involving an allegedly undefined view state. I have bound the current state of an item renderer component to an expression that returns one of several possible state names. mx:currentState{calcCurrentState(Channel(data).syncing, open)}/ mx:currentState protected function calcCurrentState (syncing:Boolean, open:Boolean):String { return syncing ? 'syncing' : (open ? 'open' : 'closed'); } Two of the states work without issues, but a third one causes exceptions. Flex complains that the state is undefined; a claim which seems to conflict with the evidence: a. I have stopped the app in the debugger and observed the contents of the states array (as it should be) b. Although Flex claims the state is undefined, it then switches to it. I have tried changing the name of the state, using a different state, removing the overrides from the state, and several other tests, all to no avail. mx:states !-- These states work fine -- mx:State name=closed mx:SetProperty target={this} name=height value=55/ /mx:State mx:State name=open / !-- Flex claims this state is undefined -- mx:State name=syncing basedOn=closed mx:RemoveChild target={syncBtn}/ mx:AddChild relativeTo={syncTools} position=1 mx:ProgressBar/ /mx:AddChild /mx:State !-- This test state produces same results -- mx:State name=myState/ /mx:states A stack trace follows, delineated for clarity. It appears that two state changes are taking place. I'm not sure why that is or if it is normal. Thanks for any insights you can offer. Cheers, Lach ArgumentError: Undefined state 'syncing'. at mx.core::UIComponent/::getState() at mx.core::UIComponent/::findCommonBaseState() at mx.core::UIComponent/::commitCurrentState() at mx.core::UIComponent/setCurrentState() at mx.core::UIComponent/set currentState() at MethodInfo-5897() at Function/http://adobe.com/AS3/2006/builtin::call() at mx.binding::Binding/::innerExecute() at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.binding::Binding/mx.binding:Binding::wrapFunctionCall() at mx.binding::Binding/execute() at mx.binding::Binding/watcherFired() at mx.binding::Watcher/notifyListeners() at mx.binding::PropertyWatcher/eventHandler() at flash.events::EventDispatcher/ flash.events:EventDispatcher::dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent() at mx.core::UIComponent/::commitCurrentState() at mx.core::UIComponent/setCurrentState() at mx.core::UIComponent/set currentState() at MethodInfo-5887() at Function/http://adobe.com/AS3/2006/builtin::call() at mx.binding::Binding/::innerExecute() at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.binding::Binding/mx.binding:Binding::wrapFunctionCall() at mx.binding::Binding/execute() at mx.binding::Binding/watcherFired() at mx.binding::Watcher/notifyListeners() at mx.binding::PropertyWatcher/eventHandler() at flash.events::EventDispatcher/ flash.events:EventDispatcher::dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at com.couch.emotive.model::Channel/dispatchEvent() at com.couch.emotive.model::Channel/set syncing() at com.couch.emotive.commands::SyncChannelCommand/result() at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/ internal::applyResult() at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/ internal::callTokenResponders() at mx.rpc::AbstractOperation/http://www.adobe.com/2006/flex/mx/ internal::dispatchRpcEvent() at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/ internal::resultHandler() at mx.rpc::Responder/result() at mx.rpc::AsyncRequest/acknowledge() at ::NetConnectionMessageResponder/NetConnectionChannel.as $31:NetConnectionMessageResponder::resultHandler() at mx.messaging::MessageResponder/result()
[flexcoders] local file access thru HTTPService fails
Hi all this seems like such a simple thing, and yet ... my project currently lives in the directory My Documents/Flex Builder 2/xmlshow and works fine. If I take the entire directory and copy it to my desktop, and then open xmlshow_app.html it no longer works. Specifically it doesn't load my file (voucherXML.xml) thru HTTPService. I repeat, this works fine UNTIL I copy the doirectory elsewhere. Is this a crossdomain issue? I've tried, experimentally, adding a crossdomain.xml file in the dame directory as the swf and it doesn't work. Thanks for any help John This email and any files transmitted with it may be confidential and are intended solely for the use of the individual or entity to whom they are addressed. This email may contain personal information of individuals, and be subject to Commonwealth and/or State privacy laws in Australia. This email is also subject to copyright. If you are not the intended recipient, you must not read, print, store, copy, forward or use this email for any reason, in accordance with privacy and copyright laws. If you have received this email in error, please notify the sender by return email, and delete this email from your inbox.
[flexcoders] Re: ViewStates vs ViewStacks in App Control
This is helpful, thanks. I like the idea better to have two states to the application (default logged on state) and then put the rest in a view stack. - kevin --- In flexcoders@yahoogroups.com, Paul Andrews [EMAIL PROTECTED] wrote: - Original Message - From: Kevin Merritt [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Monday, January 01, 2007 7:27 PM Subject: [flexcoders] ViewStates vs ViewStacks in App Control I am trying to build out a basic framework for my application and I have about 4 different screens that users can view depending on what they are trying to do in the applications: Welcome Graphics Login Screen Overview Screen Detailed View Screen Generate Reports Screen These screens don't share similar menus or components so I am thinking it is best to create a view stack for navigating between the different screens - Application ViewStack Welcome Graphics Login Screen Overview Screen Detailed View Screen Generate Reports Screen Perhaps: Application default state Welcome Graphics Login Screen Application logged on state ViewStack Overview Screen Detailed View Screen Generate Reports Screen Apart from the obvious logon situation I think states can work really well within components. Here are my questions: 1) If I do this, can I add a loader to each child of the ViewStack so that the user does not have to wait for the entire app to load in order to start the application? This already happens with components instantiated on demand as you run through the view stack. 2) I could also do this using ViewStates, but it seems to me that ViewStates are more useful when there are significant shared assets components between the different states. However, performance-wise would it be better to use one over the other? I would split the different 'screens' into separate flex components and add them into the viewstack. Having them as separate components makes the app much more modular - my designs are components nested within components like building bricks. Use events to communicate between components (or more properly your MVC architecture). 3) In the long run (should my application grow larger) would it be better to use a modular approach and load modules for each view? See how it goes - build as much as you need - when/if it gets slow, look again at re-architecting the application using components you have built. Don't make things more complicated than it needs to be. However because I am using Cairngorm would this add an extra layer of difficulty trying to maintain/share a ModelLocator, FrontController, etc between a number of different modules? Don't really see how Cairngorm would affect this. If you build in complication it will be complicated with or without Cairngorm. Paul Thanks for your advice. It always seems the design decisions are much more confusing than the actual coding!! - Kevin -- 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] Never mind
Please ignore my last post. I just lost my job, so I don't really care what the answer my last query is anymore. Regards This email and any files transmitted with it may be confidential and are intended solely for the use of the individual or entity to whom they are addressed. This email may contain personal information of individuals, and be subject to Commonwealth and/or State privacy laws in Australia. This email is also subject to copyright. If you are not the intended recipient, you must not read, print, store, copy, forward or use this email for any reason, in accordance with privacy and copyright laws. If you have received this email in error, please notify the sender by return email, and delete this email from your inbox.
[flexcoders] DragManager.isDragging returning null
Can anyone please explain how my app can be causing this error. TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.managers::DragManager$/get isDragging()[C:\dev\flex_201_gmc\sdk \frameworks\mx\managers\DragManager.as:158] at mx.controls.listClasses::ListBase/ mx.controls.listClasses:ListBase::dragScroll()[C:\dev\flex_201_gmc\sdk \frameworks\mx\controls\listClasses\ListBase.as:5612] at Function/http://adobe.com/AS3/2006/builtin::apply() at () at flash.utils::SetIntervalTimer/ flash.utils:SetIntervalTimer::onTimer() at flash.utils::Timer/flash.utils:Timer::_timerDispatch() at flash.utils::Timer/flash.utils:Timer::tick() It occurs when i click on a tree control. I have been unable to reproduce error this in any other test application and i'm about to go postal. Funny thing about the error message is, at mx.managers::DragManager$/get isDragging()[C:\dev\flex_201_gmc\sdk \frameworks\mx\managers\DragManager.as:158] I'm on a mac, i dont have c:\dev\, perhaps a developers note. Regards, Bjorn
[flexcoders] Datagrid header spanning 2 columns
Hi, I want to have a header spanning 2 columns in a datagrid. Header1| Header2 Col| Col2 | col3 | | | | | | How can I do that? Regards, Sanjucta This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
[flexcoders] NYC based FlexCoders?
I am wondering if there are any other New York City based Flex coders on this list? I would love to meet some other coders in the area. (I know tons of designers but not a lot of coders.) Also, I have a couple looming deadlines on some RIA projects (using flex/cairngorm/php/mysql) that I could use some coding help with. Email me off-list if you are interested. Thanks, Kevin Brooklyn, NY