Re: [flexcoders] Re: PopUpManager Module Components
Did you really type mc:states? On 2/3/10 5:04 AM, criptopus sd_br...@ntlworld.com wrote: One of my modules that I converted to ModuleTitleWindow is complaining about mx:states it says it could not resolve mc:states to a component implementation. It was working before so what happened and how do I put it right? - Stephen Brown -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] Re: PopUpManager Module Components
You could put them in a SWC that all projects share. On 2/2/10 11:41 AM, criptopus sd_br...@ntlworld.com wrote: Got the program working, but just don't have the knowledge to implement it in my program. It just complains endlessly when I try to change my program. I have one file index.mxml and a directory comps with popup componets in and their are sub directories with more popup components from those popup components. My problems is where to put the ILoginDialog.as ModuleTitleWindow.as or equivelent for my comps enclosed LoginDialog.mxml's or equivelent and how to keep them all talking and happy, oh and neat. Going for a strong cup of coffee and to shake my head a bit. - Stephen -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] Re: PopUpManager Module Components
You are using modules, correct? Then you have multiple SWFs. If you’ve put them all in one project that’s fine, then all you need to do is put those files somewhere where they can all see them in their source-paths. On 2/2/10 12:27 PM, criptopus sd_br...@ntlworld.com wrote: Only one project, multiple components. - Stephen --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aha...@... wrote: You could put them in a SWC that all projects share. On 2/2/10 11:41 AM, criptopus sd_br...@... wrote: Got the program working, but just don't have the knowledge to implement it in my program. It just complains endlessly when I try to change my program. I have one file index.mxml and a directory comps with popup componets in and their are sub directories with more popup components from those popup components. My problems is where to put the ILoginDialog.as ModuleTitleWindow.as or equivelent for my comps enclosed LoginDialog.mxml's or equivelent and how to keep them all talking and happy, oh and neat. Going for a strong cup of coffee and to shake my head a bit. - Stephen -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] Re: PopUpManager Module Components
If “test” is null, then the thing loaded did not implement Itest. Each module’s mxml file must have: mx:Module ... Implements=”Itest” ... You can store Itest.as anywhere and point to it with the project properties source-path. On 2/2/10 3:03 PM, criptopus sd_br...@ntlworld.com wrote: The following works but is rather useless = private var test:IUIComponent; private var module:IModuleInfo; private function openTest():void { module=ModuleManager.getModule(comps/admnCntr/test.swf); module.addEventListener(ModuleEvent.READY, dispTest); module.load(); } private function dispTest(e:Event):void { test=module.factory.create() as IUIComponent; PopUpManager.addPopUp(test, Application.application as DisplayObject, true); PopUpManager.centerPopUp(test); } This seems to load but test fails to open a popup as it is null? private var test:Itest; private var module:IModuleInfo; private function openTest():void { module=ModuleManager.getModule(comps/admnCntr/test.swf); module.addEventListener(ModuleEvent.READY, dispTest); module.load(); } private function dispTest(e:Event):void { test=module.factory.create() as Itest; PopUpManager.addPopUp(test, Application.application as DisplayObject, true); PopUpManager.centerPopUp(test); } My directory structure == . | admnCntr.mxml | grpsCntr.mxml | instCntr.mxml | librCntr.mxml | userCntr.mxml | +---admnCntr | admnArti.mxml | admnAsha.mxml | admnCata.mxml | admnGlry.mxml | admnGrps.mxml | admnMedi.mxml | admnMemb.mxml | admnShar.mxml | admnStry.mxml | admnUser.mxml | test.mxml | +---grpsCntr | grpsRequest.mxml | +---instCntr | | cataList.mxml | | instArti.mxml | | instAsst.mxml | | instFold.mxml | | instGrps.mxml | | instMshpGrp.mxml | | instMshpMbr.mxml | | instUsrs.mxml | | | +---cataList | | cataEdit.mxml | | | +---instArti | | artiEdit.mxml | | | +---instAsst | | asstEdit.mxml | | | +---instFold | | foldEdit.mxml | | | +---instGrps | | grpsEdit.mxml | | | \---instUsrs | usrsEdit.mxml | +---librCntr | | librArti.mxml | | librFold.mxml | | | +---librArti | | | acesEdit.mxml | | | artiEdit.mxml | | | contView.mxml | | | | | +---contView | | | contEdit.mxml | | | contPrev.mxml | | | mapPlay.mxml | | | vidiPlay.mxml | | | | | \---itemRend | | med1Type.mxml | | med2Type.mxml | | | \---librFold | | acesEdit.mxml | | foldEdit.mxml | | mediEdit.mxml | | | \---itemRend | tickBox.mxml | tickRqBox.mxml | \---userCntr userAmend.mxml userRequest.mxml userSignIn.mxml userSignOut.mxml Most of which are popups so unsure of anywhere I could put this so that they would all see it? - Stephen -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] Re: PopUpManager Module Components
Sounds like a config/build issue. If you are using RSLs make sure the main app is using RSLs and the module isn’t. Otherwise, check the link-reports of both SWFs to see who is responsible for TitleWindow On 2/1/10 5:17 PM, criptopus sd_br...@ntlworld.com wrote: When I tried the code I got the following error... I'm getting VerifyError: Error #1014: Class mx.containers::TitleWindow could not be found. - Stephen --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aha...@... wrote: On my blog On 2/1/10 9:11 AM, criptopus sd_br...@... wrote: Can anybody give me a simple example of how I would set up a PopUp to load as a module? -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
RE: [flexcoders] Re: PopUpManager
Background of the popup? You specify that by making a selector of the name of the MXML file that defines the popup. Backgorund of the app behind the popup? You have to specify the modalTransparency and related styles From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of tchredeemed Sent: Monday, July 21, 2008 7:58 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: PopUpManager also, i can use global {}, but id rather use a popupmanager specific style... might not be possible? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , tchredeemed [EMAIL PROTECTED] wrote: are you allowed to say that on a yahoo forum? ps. I was looking at google when I found this, so yes, google is my friend! --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , David Gironella giro@ wrote: Here can find information: http://blog.flexexamples.com/2007/08/14/changing-a-modal-alert-controls- blur http://blog.flexexamples.com/2007/08/14/changing-a-modal-alert-controls -blur -transparency-and-transparency-color/ Google is your friend!!! Giro. -Mensaje original- De: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] En nombre de tchredeemed Enviado el: lunes, 21 de julio de 2008 16:42 Para: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Asunto: [flexcoders] PopUpManager Does anyone know how to change the color/alpha of the background when using a popupmanager to add a popup to the screen? Not being able to do this has caused me to create my own popups, which might not be the best way to do it :) HALP! -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo ! Groups Links
Re: [flexcoders] Re: PopupManager causes RangeError: Error #2006: adding a popup window
The problem in your code friend is because you´re trying to add itens to an datagrid without existing first. you can only add that if you have already created the container for it. so addChild or initiate the popup before you do that. and will works. regards Igor Costa www.igorcosta.org www.igorcosta.com On Dec 12, 2007 1:49 AM, wpbarto [EMAIL PROTECTED] wrote: Additional Info: This problem is apparantly caused by MULTIPLE itemEditEnd events dispatched from the DataGrid, exacerbated by the fact that the PopupManager code is not reentrant or doesn't handle concurrency. Looks like Flash player can interrupt part of a running script (PopupManager's addPopup thread) and begin additional events. So: 1. Why is dataGrid sending 4-5 (!) itemEditEnd events for one edit action? 2. Shouldn't PopupManager be reliable and opaque without developers having to code around it's quirks? (Don't get me wrong--I love Flex; just don't like banging my head over framework issues. I have enough banging for my own issues!) --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, wpbarto [EMAIL PROTECTED] wrote: I saw something else similar in flexcoders, but the information didn't seem to apply to this case. I can create a popup window from a button's click handler, but THE SAME CODE used when editing a DataGrid cell FAILS! Is it a bug or a mis-use of PopupManager?? Thanks for any help! Top part of Error stack: RangeError: Error #2006: The supplied index is out of bounds. at flash.display::DisplayObjectContainer/addChildAt() at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal: :rawChildren_addChildAt() at mx.managers::SystemManager/addChild() at mx.managers::PopUpManagerImpl/addPopUp() at mx.managers::PopUpManager$/addPopUp() at TestPopup/::onCellEdit() at TestPopup/__pointGrid_itemEditEnd() at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEv entFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent() at mx.controls::DataGrid/::endEdit() at mx.controls::DataGrid/::deactivateHandler() at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEv entFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent() at mx.controls::DataGrid/::endEdit() This is the smallest example I can create: [File1: TestPopup.mxml] == ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute applicationComplete=onAppComplete() mx:Script ![CDATA[ import mx.managers.PopUpManager; import mx.collections.ArrayCollection; import mx.events.DataGridEvent; import mx.events.DataGridEventReason; private var popWin:MyPopupWindow = null; private var curData:ArrayCollection; // items for datagrid private var items:ArrayCollection; // items for pop up private function onAppComplete():void { curData = new ArrayCollection(); curData.addItem( { ident:ORD, cityname:Chicago, IL } ); curData.addItem( { ident:ATL, cityname:Atlanta, GA } ); curData.addItem( { ident:DEN, cityname:Denver, CO } ); curData.addItem( { ident:, cityname: } ); // one blank pointGrid.rowCount = 5; pointGrid.dataProvider = curData; items = new ArrayCollection(); items.addItem( {ident:JFK, cityname:New York, NY} ); items.addItem( {ident:LAX, cityname:Los Angeles, CA} ); items.addItem( {ident:SEA, cityname:Seattle, WA} ); } private function onClick():void { if(popWin == null) { popWin = new MyPopupWindow(); popWin.itemChoices = items; } PopUpManager.addPopUp(popWin, this, true); PopUpManager.centerPopUp(popWin); } private function onCellEdit(event:DataGridEvent):void { if(event.reason == DataGridEventReason.CANCELLED) return; if(popWin == null) { popWin = new MyPopupWindow(); popWin.itemChoices = items; } PopUpManager.addPopUp(popWin, this, true); PopUpManager.centerPopUp(popWin); } ]] /mx:Script mx:VBox mx:Label text=Clicking the button creates popup OK: / mx:Button id=theButton label=Click Me click=onClick()/ mx:Label text=However, editing a cell FIRST fails: / mx:DataGrid id=pointGrid itemEditEnd=onCellEdit(event) editable=true mx:columns mx:DataGridColumn id=identCol width=50 dataField=ident headerText=Ident/ mx:DataGridColumn id=citynameCol width=90 dataField=cityname headerText=City/Name paddingLeft=1 paddingRight=1/ /mx:columns /mx:DataGrid /mx:VBox /mx:Application [File2: MyPopupWindow.mxml] == ?xml version=1.0 encoding=utf-8? mx:Panel xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute width=400 height=300 title=The Popup Window mx:DataGrid id=selItemList dataProvider={itemChoices} width=100% height=100% mx:columns
Re: [flexcoders] Re: PopUpManager quick help
its cool, i actually got it figured out for what i need. What i was looking for actually was to center the popup to the stage. so I just created this class that I extend from instead.. It makes sense now that if you want to center inside of the parent object, you use PopUpManager.centerPopUp. or you can jsut specify the x and y, in this classes case, the stage width and height.package{ import mx.core.Application; import mx.containers.TitleWindow; import mx.events.FlexEvent; import mx.events.ResizeEvent; /** * a class that handles centering itself in the entire application window, * does a center when the swf is resized, or when you call codeselfCenter/code * from one of it's subclassed implementations */ public class SelfCenteringTitleWindowPopUp extends TitleWindow {/** * constructor */ public function SelfCenteringTitleWindowPopUp() { super(); addEventListener( FlexEvent.CREATION_COMPLETE, handleCreationComplete ); }/** * when the creation of the TitleWindow is complete, add listener for resize events * @param fe */ protected function handleCreationComplete( fe:FlexEvent ):void { Application.application.addEventListener( ResizeEvent.RESIZE, selfCenterFromResize ); }/** * the resize event handler method, uses codeselfCenter/code * @param re */ protected function selfCenterFromResize( re:ResizeEvent ):void { selfCenter(); }/** * the method that does the centering of this popup */ protected function selfCenter():void { x = ( Application.application.width - width ) / 2; y = ( Application.application.height - height ) / 2; } }}MXML:::?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml layout=horizontal creationComplete=initApp() mx:Script import Startup;private function initApp():void { var st:Startup = new Startup(); } /mx:Script/mx:ApplicationStartup.as::: package{ import mx.managers.PopUpManager; import mx.containers.Canvas; import AddSubscriptionModal; public class Startup { public function Startup() { var cn:Canvas = new Canvas(); Application.application.addChild( cn ); var asm:AddSubscriptionModal = PopUpManager.createPopUp( cn, AddSubscriptionModal, true ) as AddSubscriptionModal; } }}AddSubscriptionModal.as:::package{ import mx.managers.PopUpManager; import mx.events.CloseEvent; import SelfCenteringTitleWindowPopUp; public class AddSubscriptionModal extends SelfCenteringTitleWindowPopUp { public function AddSubscriptionModal() { doInit(); addEventListener( CloseEvent.CLOSE , handleCloseModal ); }private function doInit():void { title = test; showCloseButton = true; width = 400; height = 200; selfCenter(); }private function handleCloseModal( ce:CloseEvent ):void { PopUpManager.removePopUp( this ); } }} I appreciate your help though..smithOn 9/18/06, Tim Hoff [EMAIL PROTECTED] wrote: Perhaps it's because you are using AS to create the canvas. Possibly a race condition (asynchronous) is occurring as the canvas is resized and the popup is centered. You could always just use mx:Canvas in your main application class instead. It all gets turned into AS anyway. Sorry that I couldn't be of more help -TH --- In flexcoders@yahoogroups.com, aaron smith [EMAIL PROTECTED] wrote: doesnt seem to work correctly. It actually puts the popup in the negative window space. (see attachment) I wonder why it would do that. is it something to do with canvas / percentWidth / percentHeight. i've event tried commenting that out and it still only puts it at 0,0. On 9/18/06, Tim Hoff [EMAIL PROTECTED] wrote: Hi Aaron, This code will center the popup relative to the popups's parent. In your case cn. PopUpManager.centerPopUp(asm); -TH --- In flexcoders@yahoogroups.com flexcoders% 40yahoogroups.com, aaron smith beingthexemplarylists@ wrote: I'm trying to understand the popup manager better, i created a quick test just to get it working and test it out.. most works fine but having problems understanding how to center the popup.. here is my code: MXML::: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml layout=horizontal creationComplete=initApp() mx:Script import Startup; private function initApp():void { var st:Startup = new Startup(); } /mx:Script /mx:Application Startup.as::: package { import mx.managers.PopUpManager; import mx.containers.Canvas; import mx.core.Application; import mx.containers.TitleWindow; import AddSubscriptionModal; public class Startup { public function Startup() { var cn:Canvas = new Canvas(); cn.percentWidth = 100; cn.percentHeight = 100; Application.application.addChild( cn ); var asm:AddSubscriptionModal = PopUpManager.createPopUp ( cn, AddSubscriptionModal, true )
Re: [flexcoders] Re: PopUpManager quick help
doesnt seem to work correctly. It actually puts the popup in the negative window space. (see attachment)I wonder why it would do that. is it something to do with canvas / percentWidth / percentHeight. i've event tried commenting that out and it still only puts it at 0,0. On 9/18/06, Tim Hoff [EMAIL PROTECTED] wrote: Hi Aaron, This code will center the popup relative to the popups's parent. In your case cn. PopUpManager.centerPopUp(asm); -TH --- In flexcoders@yahoogroups.com, aaron smith [EMAIL PROTECTED] wrote: I'm trying to understand the popup manager better, i created a quick test just to get it working and test it out.. most works fine but having problems understanding how to center the popup.. here is my code: MXML::: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml layout=horizontal creationComplete=initApp() mx:Script import Startup; private function initApp():void { var st:Startup = new Startup(); } /mx:Script /mx:Application Startup.as::: package { import mx.managers.PopUpManager; import mx.containers.Canvas; import mx.core.Application; import mx.containers.TitleWindow; import AddSubscriptionModal; public class Startup { public function Startup() { var cn:Canvas = new Canvas(); cn.percentWidth = 100; cn.percentHeight = 100; Application.application.addChild( cn ); var asm:AddSubscriptionModal = PopUpManager.createPopUp ( cn, AddSubscriptionModal, true ) as AddSubscriptionModal; } } } AddSubscriptionModal.as::: package { import mx.containers.TitleWindow; import mx.managers.PopUpManager; import mx.events.CloseEvent; public class AddSubscriptionModal extends TitleWindow { public function AddSubscriptionModal() { doInit(); addEventListener( CloseEvent.CLOSE, handleCloseModal ); } private function doInit():void { title = test; showCloseButton = true; width = 400; height = 200; //PopUpManager.centerPopUp( this ); //this causes an run-time error, not sure why?? } private function handleCloseModal( ce:CloseEvent ):void { PopUpManager.removePopUp( this ); } } } I am wondering if giving the createPopUp method the canvas as parent is the problem? can someone glance at this quick and see if you can help? or does someone have an example already? thanks all! smith __._,_.___ -- 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 Software development tool Software development Software development services Home design software Software development company Your email settings: Individual Email|Traditional Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___ attachment: popup_centering.jpg
Re: [flexcoders] Re: PopUpManager
Yes, if you, typically, do a deletePopUp when the event was triggered by the popup itself, there's some kind of reference to the popup kept around. I've found that if I do something like this: function initApp() { popup = PopUpManager.createPopUp(this, TitleWindow, true); popup.addEventListener(click, this); } function click() { doLater(this, removePopUp); } function removePopUp() { popup.deletePopUp(); } It's ok but if I were to immediately remove it, the dropshadow still is there. Anyway, the above works all the time. - Original Message - From: kaibabsowats [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Wednesday, April 20, 2005 1:31 PM Subject: [flexcoders] Re: PopUpManager A solution to my own question: function interval() { this.setStyle( dropShadow, false ); clearInterval( this.intervalNumber ); doLater( this, deletePopUp ); } But this seems like a hack, and the fact that the dropShadow stays around seems like a bug? Anyone seen this before? Yahoo! Groups Links 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/