Uncategorized

by popular demand: The SkinnablePopUpContainer

A frequent question is how to open PopUp windows in a target platform neutral way and in compliance with strict Flex4 coding practices…

Here is a quick sample of how to do that…

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
			   xmlns:s="library://ns.adobe.com/flex/spark"
			   xmlns:mx="library://ns.adobe.com/flex/mx">

	<fx:Declarations>
		<fx:Component className="MyAlert">
			<s:SkinnablePopUpContainer>
				<s:TitleWindow title="Launching World Domination..." close="close()">
					<s:VGroup horizontalAlign="center" width="100%">
						<s:Label text="World Domination failed. Sorry!"/>
						<s:Button label="OK, nevermind" click="close()"/>
					</s:VGroup>
				</s:TitleWindow>
			</s:SkinnablePopUpContainer>
		</fx:Component>
	</fx:Declarations>

	<s:Button label="Launch World Domination" click="(new MyAlert()).open(this, false)"/>

</s:Application>
Advertisements

2 thoughts on “by popular demand: The SkinnablePopUpContainer

  1. Hi Peter,
    thanks for the example but I would appreciate it if you could help me understand the steps to get a basic YES/NO popup going so that when YES is pressed my SAVE event gets called, if NO …popup closes.

    I am new to AS3 and programming in general thus my general confusion. In your example above, I have created a separate MXML component in my project however if I add another button and set it’s label to YES I cannot figure out how to access/call my functions in the view !?!***! (it’s driving me nuts :-))
    Any help greatly appreciated.
    Manuel

    1. Hi Manuel,

      There are tons of ways to achieve that goal… Im sure you have found a way by now, its taken me some time to get around responding on my blog… I hope this will change soon so I can start publishing more again.

      However, I suggest that you head over to devnet.adobe.com and see all the references there are there on how to get started… its literally stacked with great references which will get you started in no time…

      Good luck and happy coding !
      Peter

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s