Creating a custom creation complete effect on a Flex Alert control – creationCompleteEffect – mx:SoundEffect
by Sameera Thilakasiri on 22nd February 2010 at 11:28 pm - Flex 3, Flex 3 Action Script 3 Tutorial
The following example shows how to specify an effect which gets played when an Alert control is displayed by setting the Alert control’s creationCompleteEffect style. You can also see how to embed both the normal and bold font using CSS and @font-face.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<mx:Style>
@font-face {
src: local("Verdana");
fontFamily: VerdanaEmbedded;
}
@font-face {
src: local("Verdana");
fontFamily: VerdanaEmbedded;
<a href="http://marvabrooks.com/images/">where can i buy cialis</a> fontWeight: bold;
}
Alert {
fontFamily: VerdanaEmbedded;
creationCompleteEffect: myEffect;
}
</mx:Style>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private var alert:Alert;
private function button_click():void {
alert = Alert.show("The quick brown fox jumped over the lazy dog", "Lorem Ipsum");
}
]]>
</mx:Script>
<mx:Sequence id="myEffect">
<mx:Parallel>
<mx:Zoom />
<mx:Fade />
</mx:Parallel>
<mx:Rotate />
</mx:Sequence>
<mx:Button label="Launch Alert" click="button_click();" />
</mx:Application>
The following example shows how you can set a creation complete effect on a Flex Button control by setting the creationCompleteEffect style.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<mx:Button id="button"
label="Button"
creationCompleteEffect="Zoom" />
</mx:Application>
The following example shows how you can play an embedded MP3 when a Flex Alert control is displayed by setting the creationCompleteEffect style/effect.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application name="Alert_creationCompleteEffect_test_2"
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
[Embed("assets/iconCritical.png")]
private var IconCritical:Class;
private function showAlert():void {
var message:String = "The quick brown fox jumped over the lazy dog.";
var title:String = "Alert title";
var a:Alert = Alert.show(message,
title,
Alert.OK,
null,
null,
IconCritical);
a.status = Capabilities.version;
a.isPopUp = false;
}
]]>
</mx:Script>
<mx:Style>
Alert {
creationCompleteEffect: ding;
}
</mx:Style>
<mx:SoundEffect <a href="http://dorisbernard.com/images/">viagra buy viagra online | cheapest place to buy cialis <a href="http://blogtorn.com/images/">where do you buy viagra</a> | buy cheap levitra</a> id="ding"
source="@Embed('assets/ding.mp3')"
useDuration="false" />
<mx:Button id="button"
label="Launch Alert"
click="showAlert();" />
</mx:Application>
Incoming search terms:
- creationCompleteEffect (6)
- flex 4 creationcomplete effects (2)
- creationCompleteEffect flex (2)
- flex 4 creationcompleteeffect (2)
- Alert effect flex (2)
- flex4 effects creation complete titlewindow (1)
- flex alert complete (1)
- flex alert creation complete (1)
- Flex Alert show effects (1)
- Flex Canvas effects creationCompleteEffect (1)
- flex control creation complete (1)
- flex createcomplateeffect (1)
- flex creationcomplete effect examples (1)
- flex creationcomplete zoom (1)
- Playing a sound effect when an Alert control is displayed in Flex (1)
Sameera at LinkedIn