Skip navigation
Currently Being Moderated

Have Alerts been moved from mx.controls?

May 7, 2011 4:49 PM

I copy and pasted this import mx.controls.Alert; from: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf 69084-7da0.html

Why? because everytime I typed inimport mx.controls.Alert give me the error: The import Alert could not be found.

 

And in fact even copying and pasting that peice of code from the web site I still get the same error....

 

So I ask, its it not apart of the mx.controls package?

 
Replies
  • Currently Being Moderated
    May 7, 2011 11:16 PM   in reply to Adrien.

    Why?  Because it is Saturday and fewer people work on Saturday.

    What version of Flex?  If it is a recent version, is the mx.swc in the

    library path?

     
    |
    Mark as:
  • Currently Being Moderated
    May 8, 2011 10:48 PM   in reply to Adrien.

    Do you have a 20-line test case that fails for you?

     
    |
    Mark as:
  • Currently Being Moderated
    May 23, 2011 2:57 AM   in reply to Flex harUI

    as said in this post i externally add mx.swc in my project .my project .swc is deleted and i can't able to run the project.

    so how to achive this ?

    i want to dispaly alert in my project and i am using Spark

     

     

     

     

     

    Thanks & Regrads

    Megha

     
    |
    Mark as:
  • Currently Being Moderated
    May 23, 2011 3:00 PM   in reply to Megha31

    Post  a 20-line test case that fails.

     
    |
    Mark as:
  • Currently Being Moderated
    May 23, 2011 10:26 PM   in reply to Flex harUI

    i am new to flex so sorry for asking this  where i find 20-line test case ?

     
    |
    Mark as:
  • Currently Being Moderated
    May 24, 2011 7:46 AM   in reply to Megha31

    You create one yourself.

     
    |
    Mark as:
  • Currently Being Moderated
    May 25, 2011 9:44 PM   in reply to Flex harUI

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

        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                import mx.controls.Alert;

                protected function btn2_clickHandler(event:MouseEvent):void
                {
                    var ale:Alert = Alert.show("This is a ALert");   
                }         
            ]]>
        </fx:Script>
        <s:Button label="Show alert (with moduleFactory)" id="btn2" click="btn2_clickHandler(event)" />

    </s:View>

     

    this is my code but it not working.i add explicitly mx.swc but my project.swc file is deleted so now i have to do to  display alert in my project.

     
    |
    Mark as:
  • Currently Being Moderated
    May 26, 2011 11:49 AM   in reply to Megha31

    You are using s:View which implies you are building a Mobile app and Alert

    is not recommended for mobile apps.  Try using SkinnablePopUpContainer.

     
    |
    Mark as:
  • Currently Being Moderated
    May 26, 2011 9:27 PM   in reply to Flex harUI

    hi

    ya i am devloping mobile application.

    i want to dispaly alert and pop-up on my application.

    in my application i have to display alert and pop-up so give me any solution for that.

     

     

    can you give example of SkinnablePopUpContainer?

     

     

    Thanks & Regards

    Megha

     
    |
    Mark as:
  • Currently Being Moderated
    May 26, 2011 10:46 PM   in reply to Megha31

    A google search of SkinnablePopUpContainer promises some examples.

     
    |
    Mark as:
  • Currently Being Moderated
    May 27, 2011 3:58 AM   in reply to Adrien.

    I am using flash builder 4.5 and i am unable to call alert from an action script file?

    I am not building mobile application but compiler is still unable to find it in mx.controls package.

     
    |
    Mark as:
  • Currently Being Moderated
    May 27, 2011 9:59 AM   in reply to harissarwar

    Make sure mx.swc is one of the libraries in the project, and make sure you

    import the class.

     
    |
    Mark as:
  • Currently Being Moderated
    May 30, 2011 9:49 AM   in reply to Flex harUI

    My project settings were to use only spark components. when i switch the settings to mx+spark then alert was found.

     
    |
    Mark as:
  • Currently Being Moderated
    May 30, 2011 9:46 PM   in reply to harissarwar

    i import the import mx.alerts then also it give error on page

     
    |
    Mark as:
  • Currently Being Moderated
    May 30, 2011 11:24 PM   in reply to Megha31

    If you are having trouble getting Flash Builder to configure propertly, try

    asking on the Flash Builder forum.  If you have a 20-line project with

    mx.swc in it and you can't get it to recognize Alert after importing

    mx.control.Alert, then post the project.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 17, 2011 12:07 PM   in reply to Adrien.

    I have the same problem :(

     

     

    I don't know why it doesn't work...

     

    Error 1172: Definition mx.controls:Alert could not be found.

    I have Flash Builder 4.5

     

     

    I solved the problem. I just checked the settings I changed the MX Spark + Spark

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 10, 2011 5:25 PM   in reply to Flex harUI

    Wow, really? It's "recommended" that, if we're working on a mobile app, we replace two lines of code (an important statement and an event handler) with what's written here  SkinnablePopUpLayer? I just want basic error output without having to attach a debugger; do you have a more elegant alternative?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points