Flex Examples

Hi all i am using flex , its really too good as compare to
other technologies, but there are some lack of help resources,
I am finding some help Resource:
1.
Flex Examples
2.
Flex Samples Source Code
3.
Learn Flex Tutorial
Thanks for visiting these help resources.

You can get the final Flex 4 doc here: http://help.adobe.com/en_US/Flex/4.0/UsingSDK/index.html, including doc and examples.
Stephen

Similar Messages

  • Simple flex example

    I searh a basic flex example like the lesson 1 of this article http://www.adobe.com/devnet/flash/articles/video_osmf.html
    this code in a creationComplete handler of my application:
    player = new MediaPlayer();
    player.source = new VideoElement( new NetLoader(), new URLResource( new URL ( "jkennedy.flv" ) ) );
    addChild(player.view);
    generate an error:
    Error: MediaPlayer - attempt to use a trait not on the media
    Thank you

    I have now tested this code
    Nothing appears, no error, and handler are not triggerred... I do not really understand
    Thank you
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="_init();">
        <mx:Script>
            <![CDATA[
                import org.openvideoplayer.media.MediaPlayer;
                import org.openvideoplayer.media.URLResource;
                import org.openvideoplayer.net.NetLoader;
                import org.openvideoplayer.net.NetStreamCodes;
                import org.openvideoplayer.video.VideoElement;
                import org.openvideoplayer.utils.URL;
                import org.openvideoplayer.events.MediaPlayerCapabilityChangeEvent;
                private var player:MediaPlayer;
                private function _init():void
                    player = new MediaPlayer();
                    player.addEventListener( MediaPlayerCapabilityChangeEvent.VIEWABLE_CHANGE, _onViewable );
                    player.autoRewind = false;
                    player.autoPlay = true;
                    player.source = new VideoElement( new NetLoader(), new URLResource( new URL ( "kennedy.flv" ) ) );
                private function _onViewable(pEvent:MediaPlayerCapabilityChangeEvent):void
                    if(pEvent.enabled)
                        addChild(player.view);
            ]]>
        </mx:Script>
    </mx:Application>

  • Problem with "Building interactive maps with Flex" example

    I have been looking at the tutorial by Matt Sheehan Building interactive maps with Flex found at
    http://www.adobe.com/devnet/flex/articles/interactive_maps.edu.html
    I have downloaded  Flash Builder 4.6 trial version and followed the example. I have also copied the source code from the example and pasted that into the file mymodestmap.mxml.
    In both cases the application opens a new page in Google Chrome but does not display any map data.
    No errors or warnings are displayed when I run the code from Flash Builder.
    Although I have got plenty of experience of writing software, I am a total beginner when it comes to developing web applications!
    Any ideas as to what I am doing wrong, I have attached the source below.
    Cheers
    Steve
    <?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:mx1="library://ns.adobe.com/flex/halo"
                                     minWidth="1024" minHeight="768" creationComplete="init()" viewSourceURL="srcview/index.html" xmlns:mx="library://ns.adobe.com/flex/mx">
              <fx:Script>
                        <![CDATA[
                                  import mx.core.UIComponent;
                                  import com.modestmaps.TweenMap;   
                                  import com.modestmaps.mapproviders.OpenStreetMapProvider;
                                  import com.modestmaps.geo.Location;
                                  import com.modestmaps.extras.ZoomSlider;
                                  import com.modestmaps.extras.HandCursor; 
                                  [Bindable]private var _map:TweenMap;       
                                  private var _mapUI:UIComponent;
                                  [Bindable]private var _initialLat:Number = 40.668903;
                                  [Bindable]private var _initialLong:Number = -111.680145;
                                  [Bindable]private var _initialZoom:Number = 6;
                                  private var _mouseWheelZoomCenter:Location;
                                  private var _mouseWheelZoom:int;     
                                  private function init():void
                                            _map = new TweenMap(mappanel.width, mappanel.height, true, new OpenStreetMapProvider());   
                                            _map.setCenterZoom(new Location(_initialLat, _initialLong), _initialZoom);
                                            mapCore();
                                  private function mapCore():void
                                            _map.addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler);   
                                            _mapUI = new UIComponent();
                                            _mapUI.addChild(_map);    
                                            var zoomslider:ZoomSlider = new ZoomSlider(_map);
                                            zoomslider.x = mappanel.width - zoomslider.width*2;
                                            zoomslider.y = 30;
                                            _mapUI.addChild(zoomslider);   
                                            var handcursor:HandCursor = new HandCursor(_map);
                                            _mapUI.addChild(handcursor);
                                            mappanel.addElement(_mapUI);   
                                  private function mouseWheelHandler(e:MouseEvent):void {
                                            if (e.delta < 0) {
                                                      _map.zoomOut();
                                            else if (e.delta > 0) {
                                                      _map.zoomIn();
                                            _mouseWheelZoomCenter = _map.getCenter();
                                            _mouseWheelZoom = _map.getZoom();
                        ]]>
              </fx:Script>
              <s:BorderContainer id="mappanel" width="100%" height="97%"/>
    </s:Application>

    Technically, it's Javascript, not Java :) TOTALLY different beasts. I wish they'd never named it Javascript, it's ambiguous. So anyway, on to the point of the whole thing...
    If you want quotes in your values, you'll need to write a function to replace " with \", and pass the values through it. So instead of javascript:passBack('#ENAME#','#JOB#','#SAL#'); you would have javascript:passBack(addslashes('#ENAME#'),addslashes('#JOB#'),addslashes('#SAL#'));. That would mean that ABC"DEF"GH would be passed to the function as ABC\"DEF\"GH and your quotes would stay intact. Search around on the internet for more specifics as to how to pass double quotes in javascript by using backslashes.
    ~Jer

  • OSMF with Flex examples

    Hi there,
    I'm looking for a Flex flash video player that can be skinned using CSS and was hoping OSMF might be the answer. Somehow, I can't seem to find any examples of it? They all seem to be Flash related.
    Thanks

    Hello,
    I am looking for a Flex Player example which can play .f4m files and listen for Cue points.
    My first try, but I get :
    Error: The specified capability is not currently supported
    <fx:Script>
              <![CDATA[
                   import mx.events.FlexEvent;
                   import org.osmf.containers.HTMLMediaContainer;
                   import org.osmf.elements.HTMLElement;
                   import org.osmf.elements.VideoElement;
                   import org.osmf.media.MediaElement;
                   import org.osmf.media.MediaPlayer;
                   import org.osmf.media.URLResource;
                   import org.osmf.metadata.TimelineMetadata;
                   [Bindable] private var player:MediaPlayer = new MediaPlayer();
                   [Bindable] private var stream:String = "http://188.194.84.42/vod/September_Drive_by_Lightrocker_1/September_Drive_by_Lightrocker_1.f4m";
                   //private var embeddedTimelineMetadata:TimelineMetadata;
                   private var media:MediaElement = new VideoElement(new URLResource(stream));
                   protected function application1_creationCompleteHandler(event:FlexEvent):void
                        media = new  VideoElement( new URLResource(stream));
                        player.media =  media
                        player.play();
              ]]>
         </fx:Script>
    Cheers
    Marc

  • Slideshow Viewer with music - Flex example code??

    Hello.
    I am not a Flex programmer at this time. I have only started looking at it because a client of mine wants a slideshow viewer that fades between images and plays music on her website. The site is done with simple PHP. Can someone point me in the right direction?  I have no problem learning Flex but I need this asap.
    Thanks in advance,
    Noble

    Noble -
    There's no point in reinventing the wheel for that solution...
    This is a free flash-based slideshow app that will solve your problem quick, and if you dont like that one, try google'ing Flash-based slidewhow...
    http://www.flshow.net/carousel_download.php - by the way, it is FREE
    Flex would probably do what you want, but you would be a ways off from deployment, and learning it to solve this problem seems like overkill.
    If this post answers your question or helps, please indicate above 
    Rich

  • CJ Flex example

    Hello..
    I downloaded and tried the Commission Junction sample code
    for Flex 2 for their web services.
    It works fine on the local computer but when I uploaded it on
    a test site.. there is an error.
    "Security error accessing url"
    I believe this is caused by calling a webservice from https
    instead of http.
    I tried to add protocol="https" on the webservice but there
    is a warning
    "property protocol is deprecated"
    Any fix for this??
    Thank you.

    I have now tested this code
    Nothing appears, no error, and handler are not triggerred... I do not really understand
    Thank you
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="_init();">
        <mx:Script>
            <![CDATA[
                import org.openvideoplayer.media.MediaPlayer;
                import org.openvideoplayer.media.URLResource;
                import org.openvideoplayer.net.NetLoader;
                import org.openvideoplayer.net.NetStreamCodes;
                import org.openvideoplayer.video.VideoElement;
                import org.openvideoplayer.utils.URL;
                import org.openvideoplayer.events.MediaPlayerCapabilityChangeEvent;
                private var player:MediaPlayer;
                private function _init():void
                    player = new MediaPlayer();
                    player.addEventListener( MediaPlayerCapabilityChangeEvent.VIEWABLE_CHANGE, _onViewable );
                    player.autoRewind = false;
                    player.autoPlay = true;
                    player.source = new VideoElement( new NetLoader(), new URLResource( new URL ( "kennedy.flv" ) ) );
                private function _onViewable(pEvent:MediaPlayerCapabilityChangeEvent):void
                    if(pEvent.enabled)
                        addChild(player.view);
            ]]>
        </mx:Script>
    </mx:Application>

  • Flex mobile - close popUp with back hardware key - bug?

    Hi everyone,
    i am having a problem with a popUp in my firstView aka HomeView. I used a similar logic as provided by the DashBoardMobile reference example: (http://www.adobe.com/products/flex/examples/)
    when i open the PopUP i add a EventListener with the HandlerFunction to close the popUp if the device back-key is pressed:
    systemManager.stage.addEventListener(KeyboardEvent.KEY_UP, deviceKeyUpHandler, false, 1000, true);
    protected function deviceKeyUpHandler(event:KeyboardEvent):void
                    var key:uint = event.keyCode;
                    if (key == Keyboard.BACK)
                        event.stopImmediatePropagation();
                        event.stopPropagation();
                        closePopUp();
    So far this had worked fine (if a popUp is open its get closed, if no popUp is open the previous View is poped)
    Now i made a popUp for the firstView of my app, and there this doesnt works, if i press the back-kay the application is closed wether the popUp is open or not...

    You might want to try listening for the backKeyPressed event on the View instead: http://polygeek.com/4225_air-mobile_go-your-own-way-overriding-the-back-key-press-in-air-m obile-apps
    In that handler if your popup is open you'll want to preventDefault() on the event and call your close logic.

  • How can I make a movable transparent main window (HTML, not FLEX)?

    Hi all-
    I'm new to AIR and coming up to speed quickly. I got a sample application up and running right away and was able to give it a transparent main window so that the corners are rounded and there is no window title bar.
    However, I can't figure out how to make it so the user can drag the application around their desktop when they click on it.
    I've seen a few FLEX examples of this but I have to work in HTML.
    Does anyone know how to set this up in HTML?
    Thanks,
    Nicholas

    "Works pretty much as I'd expect, except clicking and dragging one of the child controls in my window (e.g. a button) moves the whole window as well."
    Most user interface events (mouse up, down, etc.) "bubble" up from child elements to their parents. Since you are listening on the body element, your handler is called for every mouse down in the page since the body is the highest parent in the document.
    You can either:
    Attach the event listener directly to the element used to drag the window.
    Check the event target property to check whether the target of the event (the element moused) is a drag control.

  • Help with Remoting in Flex 2 PLEASE!!!!

    I can't figure out how to send data to a cfc from flex, using
    my remoteObject.
    I can send simple data, 1 or 2 params, but I need to send
    data that is in a Model Object.
    So here is my function that calls the remote edit function,
    and tried to send the data that is sent in an event to the
    function.
    private function regUpdate(event:RegEdit):void{
    var edit:Object = event.itemReturn;
    //Alert.show(edit.level);
    regService.editReg(edit);
    When I call the editReg with the edit Object as a param, I
    get this Error
    faultCode:Server.Processing
    faultSrting:'java.lang.StackOverflowError
    faultDetail:'null'
    In Flash remoting, I could just send an Object and then
    access it in the cfc using Arguments.param
    But I guess this is not the case for Flex.
    But it doesn't seem to matter what is in my cfc, if I try and
    pass that Object, it errors.
    What am I missing? I have been searching for an answer to
    this all morning, with no results.
    Where are all the good Flex examples....
    Please help
    My project is due Monday!!!

    hmm, I guess I know less then I thought.
    When you say ActionScript class that corresponds to the CFC,
    what are you referencing?
    I am calling the service from an mxml file. The data is
    created in a sub componet of that mxml file, and passed to the
    parent in an event.
    Should I be storing my data in an .as file?
    here is the code for the mxml file
    <mx:Panel xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns:is="components.reg.*" layout="horizontal"
    title="Registrations" titleStyleName="ttl" initialize="init()">
    <mx:Metadata>
    [RemoteClass(alias="zrPortal.services.reg")]
    </mx:Metadata>
    <mx:Script>
    <![CDATA[
    import events.RegEdit;
    import mx.collections.ArrayCollection;
    import events.GridItemSelected;
    import mx.controls.Alert;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var regData:ArrayCollection;
    [Bindable]
    private var trekData:ArrayCollection;
    [Bindable]
    public var lInfo:Object;
    [Bindable]
    private var regItemData:Object;
    public function init():void{
    regService.getReg(lInfo.level,lInfo.rId);
    public function handleRegResult(event:ResultEvent):void{
    regData = event.result as ArrayCollection;
    public function handleTrekResult(event:ResultEvent):void{
    trekData = event.result as ArrayCollection;
    private function regHandler(event:GridItemSelected):void{
    regItemData = event.itemSelected;
    trekService.getTreks(event.itemSelected.regId);
    //edit function
    private function regUpdate(event:RegEdit):void{
    var edit:Object = event.itemReturn;
    //Alert.show(edit.level);
    regService.editReg(edit);
    private function regAdd():void{
    private function regDel():void{
    ]]>
    </mx:Script>
    <mx:RemoteObject
    id="regService"
    destination="ColdFusion"
    source="zrPortal.services.reg"
    showBusyCursor="true">
    <mx:method name="getReg" result="handleRegResult(event)"
    fault="Alert.show(event.fault.message)"/>
    <mx:method name="editReg" result="handleRegResult(event)"
    fault="Alert.show(event.fault.message)"/>
    </mx:RemoteObject>
    <mx:RemoteObject
    id="trekService"
    destination="ColdFusion"
    source="zrPortal.services.RegTrek"
    showBusyCursor="false">
    <mx:method name="getTreks"
    result="handleTrekResult(event)"
    fault="Alert.show(event.fault.message)"/>
    </mx:RemoteObject>
    <is:RegList width="375" regData="{regData}"
    itemSelected="regHandler(event)"/>
    <mx:VBox>
    <mx:LinkBar dataProvider="{regContent}"/>
    <mx:ViewStack id="regContent"
    x="0" y="5"
    paddingBottom="0"
    paddingLeft="0"
    paddingRight="0"
    paddingTop="0"
    resizeToContent="true" width="100%">
    <is:RegData id="regdata" label="Reg Data"
    iData="{regItemData}" lInfo="{lInfo}" updateReg="regUpdate(event)"
    addReg="regAdd()" deleteReg="regDel()"/>
    <is:TrekData id="trekdata" label="Tec-Treks"
    iData="{trekData}"/>
    </mx:ViewStack>
    <is:RegFooter id="footer" iData="{regItemData}"/>
    </mx:VBox>
    </mx:Panel>

  • Flex Components Download Free

    Flex Components and Flex Examples with source code.
    Find Examples here:
    1.
    Flex Web Services
    Examples
    2.
    Flex Samples Web Services
    Source Code
    3.
    Learn FLEX Web Services
    Thanks & Regards

    After zip download unzip the zip file and you will found psd file
    that psd file you can open in Photoshop Elements and use it
    still any query please ask
    thanks
    dhiraj

  • FLEX+CAIRNGORM+BLAZEDS+JAVA+DATABASE

    A very simple example for FLEX+CAIRNGORM+BLAZEDS+JAVA+DATABASE.
    http://vijaaay.limewebs.com/forum/viewthread.php?tid=26&extra=page%3D1
    or
    visit  www . flexindia . tk >> Flex Examples
    The attachment zip contains the source  files[ FLEX and JAVA ] and Readme.txt which helps you to setup this  example.
    Regards,
    Vijay

    Yeah i registered, but i couldn't find zip file. Could you please tell me where is that example
    Thanks,
    ApacheFlex.

  • Native Android and iOS Look & Feel with Flex

    Hi. I have recently beena asked to research the use of Flex for development for mobile applications in Android and iOS. What I want to accomplish is the feeling of a native application, both look and feel. Android and iOS are very different in terms of styling components.
    Can this be even be done in Flex?
    Are my goals too high too achieve with Flex?
    Screen shots from Flex, Android, and iOS are below.
    Differences:
    Item
    Android
    iOS
    Tabs Location
    Top
    Bottom
    Top Left Button
    'Up'
    'Back'
    Top Left Button Icon
    Application Icon
    None
    Top Right Button
    Multiple
    Single
    List Item Right Carrot
    No
    Yes
    Adobe Flex Example:
    Native Android Example (Pure Android):
    Native iOS Example:

    This is definitely possible, even easy if you jsut have the time to put into it.
    All you need is an Android Theme - create custom styles for the buttons ect.
    There is a discussion about it here:
    https://issues.apache.org/jira/browse/FLEX-33732
    And it is an open issue so at some point this will probably get incorporated into the SDK.

  • How to make a Loadvars sendAndLoad request from embedded swf in flex

    I've developed a simple flex app with embedded swf. Basically swf use Loadvars to get data from particular database table. Ok, when I tested the flex app on localhost it is works fine and embedded swf make its sendAndLoad calls correctly.
    But! When it is located on the web server swf not work correctly. I meant there is not returned values by sendAndLoad method.
    Well, to make some points: questionContentLoadVars.img1 holds(return) the string from php call. This "img1" is an empty returned string only in Flex app placed in the web server otherwise it returns correct value from php call?
    When gameplay22.swf is standallone works!
    When gameplay22.swf is in HTML page works!
    When gameplay22.swf is embedded in FLex and executed in LOCALHOST works!
    But in the web server this embedded gameplay22.swf doesn`t works!
    What is the problem with it?
    //* here is flash(swf) part of gameplay22.swf file which is embedded in the Flex by SWFLOader(gameplay22.swf)
        questionContentLoadVars = new LoadVars();
        questionContentLoadVars.onLoad = function(success){
        if (success){
        slidingSvityk_mc.descripTA_mc.description_ta.text = questionContentLoadVars.theContent;
        else 
        slidingSvityk_mc.description_ta.text = "err!";
        function loadQuestionData(sectionID){
        var tablename ='questionsgeo';  // database tablename
        //sending variables to the PHP script
        questionContentLoadVars.row = sectionID;
        questionContentLoadVars.tablename = tablename;
        questionContentLoadVars.id_ = "";
        questionContentLoadVars.img1 = "";
        questionContentLoadVars.sendAndLoad("getQuestionRec.php",questionContentLoadVars,"_POST") ;
        function showLoadedGalleryImages():Void{
        infphp.text = questionContentLoadVars.img1;
        var img1Bulk:MovieClip = new MovieClip();
        img1Bulk = imgGalleryContainer_mc.img1Bulck_mc.createEmptyMovieClip(img1Bulk, _root.getNextHighestDepth());
        img1Bulk._x = 0;
        img1Bulk._y = 0;
        image_mcl.loadClip(questionContentLoadVars.img1, img1Bulk);
        //* And here is Flex part of embedded SWFLOader(gameplay22.swf) component
        <s:SWFLoader includeIn="user" width="1024" height="768" horizontalCenter="0" source="gameplay22.swf" verticalCenter="0"/>

    Thanks kglag, for trying to help,
    As i posted in another forum the problem was in the free flex example which i used to add another state and by using SWFLoader to  embed my swf file.
    Now i was created my own flex app and add SWFLoader to embed my swf and voila - it works!
    There is no cross-domain loads  the loaded content is in the same domain.
    So, again thanks!

  • Flex builder 4.0 ( mx:Script )

    Hello Gurus,
    We downloaded Flex builder 4.0 trial version for 60 days to learn Flash Island on webdynpro.
    Now, we are facing a small problem that <mx:Script> tag is not working. Could be a missing library file...
    Please help to resolve my problem.
    Regards,
    Abhishek.

    Hi Abhishek,
    It's may not be the case of any missing file.
    Flex 3 Application codes may not be getting compiled as there are some differences in tag declarations and classes.
    You can test any sample application which you can easily get from Tour de Flex examples to test Flash island in WD.
    Note that you also need WDIslandLibrary 'SWC' file for same version compatibility.
    If you want to use your own application then refer following links which will help you to understand the transition of Flex 3 applications into Flex 4.
    http://www.adobe.com/devnet/flex/articles/flex3and4_differences.html/
    http://www.sapphiresteel.com/Blog/Flex-3-Compatibility-in-Flex-4
    http://ria.dzone.com/articles/transition-flex3-to-flex4
    I hope these will help you to solve your issue.
    Regards,
    Vivek

  • OSX and Tour De Flex Issues

    I am having all kinds of issues with Tour De Flex examples on OSX and Safari. Is any one else having issues?  Issues are speed, lockups and functionality of the examples. I am not sure if it is just the  Apple and Adobe war.

    Yeah - the issue started with Safari 5.  We're looking into it...but it appears to be a bug in the way iframes are handled in Safari 5.
    In the meantime, you can use Firefox or better yet, download and install the desktop version of Tour de Flex (AIR app).  The desktop version has additional samples, most of which are in the AIR category.
    Thanks!
    Greg Wilson
    Adobe Systems, Inc.
    http://gregsramblings.com
    http://flex.org/tour

Maybe you are looking for