Error: Type was not found or was not a compilation constant: PromptDialog.

My PlayBook application compiles to the BB10 SDK of AIR due to the error in the subject. See also: https://developer.blackberry.com/air/beta/apis/qnx/dialog/PromptDialog.html#includeExamplesSummary

package
{
    import flash.display.Sprite;
    import qnx.fuse.ui.dialog.AlertDialog;
    import qnx.dialog.PromptDialog;

    [SWF(width="768", height="1280", backgroundColor="#FFFFFF", frameRate="60")]
    public class Example extends Sprite
    {
        public function Example()
        {
            try
            {
                showPromptDialog();
            }
            catch(error:Error)
            {
                dialog("Error on Initialization", error.message);
            }
        }

        private function showPromptDialog():void
        {
            var prompt:PromptDialog = new PromptDialog();
            // ...
        }

        private function debug(msg:String):void
        {
            dialog("Debug", msg);
        }

        private function dialog(title:String, msg:String):void
        {
            var alert:AlertDialog = new AlertDialog();
            alert.title = title;
            alert.message = msg;
            alert.addButton("Ok");
            alert.show();
        }
    }
}

Please do not take into account. Somehow I failed to change the import statement to refer to the new location of this class in BB10:

Import qnx.fuse.ui.dialog.PromptDialog;

Tags: BlackBerry Developers

Similar Questions

  • Error: Type was not found or was not a compilation constant: AlertDialog.

    I tried to compile one of my PlayBook AIR applications using the SDK of AIR BB10 tonight and got:

    Error: Type was not found or was not a compilation constant: AlertDialog.

    The command I used to compile was:

    Set JAVA_HOME = e: files (x 86) \Java\jre7
    set PATH = % PATH %; E:\Program Research In Motion\blackberry-tablet-sdk-3.0.0\bin

    CD E:\Users\Daniel\Dropbox\Apps\iTunesSync\Version0.3
    mxmlc + configname = air - library-path +=. iTunesSync.as o iTunesSync.swf - swf-version = 10

    This works if I use the SDK 2.0.0, but doesn't if I'm using 3.0.0.

    Strange.

    I confirmed that AlertDialog is always present:

    https://developer.BlackBerry.com/Air/beta/APIs/QNX/dialog/AlertDialog.html#includeExamplesSummary

    In BB10, device skins (and others) require the ANE must be loaded with the installation.

  • Error: Type was not found or was not a compilation constant: PieChart.

    Hi all

    I get an obtuse error message from the compiler again. I get

    Error: Type was not found or was not a compilation constant: PieChart.

    For the following code

    < mx:VBox >
    < mx:PieChart id = dataProvider = "{parentApplication.services.webservice.getDealData.lastResult.SeriesVO"dealsPieChart"}" showDataTips = "true" > "
    < mx:series >
    < mx:PieSeries labelPosition = "legend" field = "count" field name = "name" / >
    < / mx:series >
    < / mx:PieChart >
    < mx:Legend dataProvider = "{dealsPieChart}" / >
    < / mx:VBox >

    I don't know what I am getting this error. According to the examples that I read on the site of flex on the charts all seem fine. Any pointers welcom.

    OK - I think that I n "t have the component graph charting. It looks like a separate download. The is not going to be open comes? If this isn't the case - first bad sign for me of the authenticity of the open source moves.

  • Help! «1046: type was not found or was not a compilation constant: TimerEvent.»

    I get the followiing error in my main document class:

    «1046: type was not found or was not a compilation constant: TimerEvent.»

    It shows online 47 and 54 (in red below). Any help would be appreciated. BTW, this is my first time creating a class of main document since its release to class files! :

    package

    {

    STATEMENTS IMPORT *.

    import flash.display.MovieClip;

    import com.greensock.TweenLite;

    import flash.utils.Timer;

    SerializableAttribute public class Main extends MovieClip

    {

    //***************** Variables ***************************

    / * private var appStoreURL:URLRequest = new URLRequest ("http://itunes.apple.com/us/artist/quackenworth/id518210161");

    private var facebookURL:URLRequest = new URLRequest ("http://www.facebook.com/quackenworth");

    private var twitterURL:URLRequest = new URLRequest ("http://www.twitter.com/quackenworth") ;*/

    private var MainScene:Main = new Main();

    private var PopUp_MoreApps:MoreApps_mc = new MoreApps_mc();

    private var PopUp_About:About_mc = new About_mc();

    SPLASH SCREEN *.

    private var mc_timerSplash:Timer;

    private var splashScreen:mcSplashScreen;

    //*****************CONSTRUCTOR CODE ***********************************************************************************

    public void Main()

    {

    mc_timerSplash = new Timer (3000,1);

    mc_timerSplash.addEventListener (TimerEvent.TIMER, StartTimer);

    When the timer is finished, stop the timer;

    mc_timerSplash.addEventListener (TimerEvent.TIMER_COMPLETE, timerCompleted);

    splashScreen = new mcSplashScreen();

    addChild (splashScreen);

    splashScreen.x = stage.stageWidth / 2;

    splashScreen.y = stage.stageHeight / 2;

    mc_timerSplash.start ();

    }

    //*********** FUNCTIONS *********************************

    private void timerCompleted(e:TimerEvent):void

    {

    mc_timerSplash.stop ();

    mc_timerSplash = null;

    }

    private void StartTimer(e:TimerEvent):void

    {

    TweenLite.to (splashScreen, 1, {alpha: 0, onComplete: SplashScreen});

    }

    private void SplashScreen (): void

    {

    removeChild (splashScreen);

    addMainScene();

    }

    private function addMainScene (): void

    {

    addChild (MainScene);

    MainScene.x = 489;

    MainScene.y = 350;

    TweenLite.from (MainScene.wbbIntro_mc,.5, {alpha: 0});

    TweenLite.from (MainScene, 1, {alpha: 0});

    TweenLite.to (MainScene.girls_mc, 1, {y: 395, delay: 3.});

    TweenLite.to (MainScene.boys_mc,.5, {y: 396, delay:. 6});

    TweenLite.to (MainScene.Joe_mc,.5, {y: 339, delay: 1});

    TweenLite.to (MainScene.Paul_mc,.5, {y: 322, delay: 1.2});

    }

    private function removeMainScene (): void

    {

    removeChild (MainScene);

    TweenLite.to (MainScene.girls_mc,.1, {y:690});})

    TweenLite.to (MainScene.boys_mc,.1, {y:693});})

    TweenLite.to (MainScene.Joe_mc,.1, {y:636});})

    TweenLite.to (MainScene.Paul_mc,.1, {y:619});})

    }

    }

    }

    Add a line to import the TimerEvent class:

    import flash.events.TimerEvent;

  • Type was not found or was not a compilation constant: ArrayCollection collection

    I've never seen this type of error before. I was running the asdoc tool when I arrived at the Office:

    package adventureGame.util
    {
         import mx.collections.ArrayCollection;
    
         public class ACConvertor
         {
              public function toAC(array:Array):ArrayCollection
              {
                   var arrayObject:Array = new Array();
                   var ac:ArrayCollection = new ArrayCollection();
                   
                   return ac = arrayObject as ArrayCollection;
              }
         }
    }
    

    Why I get:

    ACConvertor.as (31): col: 37 error: Type was not found or is not a constant of compilation: ArrayCollection collection.

    public void toAC(array:Array):ArrayCollection

    Collection ArrayCollection and any class that starts with mx... is that the Flex code. You work in an IDE Flex or Flash?

  • Type was not found or was not a compilation constant: ImportExportConfiguration

    Hello

    I use a text layout framework and get an error type was not found or was not a compilation constant: ImportExportConfiguration. I use Flex Builder 3, Flex SDK version flex_sdk_4.0.0.10485 and flash player 10.0.12, surprisingly this not found error in my project workspace.

    In my code I am using

    Import flashx.textLayout.container.DisplayObjectContainerController;

    Help

    Thank you

    Kumar Gaurav Pandey

    You are using an older version of our code. I suggest upgrade you to the latest code, see: http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK.

    You don't need to use the Flex Framework, but it comes with the latest textLayout libraries and source code.

    Hope this helps,

    -robin

  • Type 1046: Type was not found or was not a compilation constant: NetworkInfo

    Hello

    All started to play with the new AIR features NetworkInfo and NetworkInterface, but cannot build...

    This is the example that I started by: tourdeflex

    But these lines cause errors:

    var networkInfo:NetworkInfo = NetworkInfo.networkInfo;
    var networkInterfaces:Vector.<NetworkInterface> = networkInfo.findInterfaces();

    Looks like this isn't the construction with the last AIR2, although my app.xml looks OK:

    <? XML version = "1.0" encoding = "utf-8" standalone = 'no '? >
    " < application xmlns =" http://ns.Adobe.com/air/application/2.0 ">

    And my Build of Flex is:

    c:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0

    Any ideas on how to solve it?

    Thank you very much

    Frank

    AIR 2 is not delivered with Flash Builder 4.0.0. FB currently has 1.5. On AIR dev tools page http://www.adobe.com/products/air/tools/ you can find this link http://kb2.adobe.com/cps/495/cpsid_49532.html which explains how to use the AIR SDK by copying and then superimpose the required files. The 1.5 reference docs, but they apply to 2.0.

    Once you've done that, add the new SDK in FB under preferences > Flash Builder > installed SDKS and point your project to the new SDK.

    Jason San Jose

    Software engineer, Flash Builder

  • src\starling\textures\ConcreteRectangleTexture.as, line 49 1046: Type was not found or is not a compilation constant: RectangleTexture.

    Framework of Starling showing this error in flash professional cs6

    I tried to run the simple code starling. My journey has been authorized.

    package

    {

    import flash.display.Sprite;

    Import starling.core.Starling;

    [SWF (width = "400" height = "300", frameRate = "60", backgroundColor = "#ffffff")]

    Game/public class extends Sprite

    {

    private var _starling:Starling;

    public function Startup()

    {

    _starling = new Starling (game, Stadium);

    _starling. Start();

    }

    }

    }

    Post in the forum of starling.

  • 1046: type was not found or is not a compilation constant: void.

    Stop();

    addEventListener (Event.ENTER_FRAME, abc1);

    function abc1(e:Event):Void {}

    gotoAndStop (10);

    }

    Here's what I copied under the compile error

    function abc1(e:Event):Void {}

    I have no idea why this is happening):

    Sub must be lowercase.

  • Type 1046: Type was not found or was not a compilation constant:

    Hi all

    It's driving me crazy and I can't understand it.

    This is my code

    package ShoppingCart.Model
    {
              // IMPORT STATEMENTS
              import flash.events.EventDispatcher;
              import ShoppingCart.Model.DataModel;
              
              [Bindable]
              public class ShopViewAdapter
              {
                   // VARIABLES
                   public var dispatcher:EventDispatcher;
                   public var dataModel:Datamodel;
                   
                   public function ShopViewAdapter()
                   {
                        
                   }
              }
    }
    

    Any help please?

    Thank you very much

    DataModel is badly spelled - there should be DataModel - capital M (unless the class name is Datamodel, in which case it is misspelled in import)

  • 1046: not a compilation constant: TimerEvent.

    I know it's simple, but I can't see what I'm doing wrong
    This is in reference to "public function moveClip(event:TimerEvent):void {}".
    any help is appreciated.
    my code is attached

    Thank you

    What is import flash. TimerEvent.Event?

    Try:

    import flash.events.TimerEvent. *;

    p.s. This should be in the as3 forum

  • Type was not found: CharacterFormat

    I downloaded the latest version of the SDK Gumbo (version 4.0.0.5032) and using this SDK target (and Flash Player 10.0.0 as necessary flashplayer in FlexBuilder), I get the following errors:

    Type was not found or was not a compilation constant: CharacterFormat
    (similar errors for ICharacterFormat, ParagraphFormat).

    I understood the foregoing through:
    Import flashx.textLayout.formats.CharacterFormat;

    If I download latest libraries of framework for page text on the Adobe site (called textlayout_framework_p1_111808.zip zip file) and replace the files:

    textLayout_conversion.swc
    textLayout_core.swc
    textLayout_edit.swc

    in the < sdk4.0.0.5032 >/frameworks/libs with the newly downloaded files folder, I get a different game or errors:

    Type was not found or was not a compilation constant: ChangeElementIdOperation
    The property id access may not be defined through a reference with static type flashx.textLayout.elements:FlowElement

    I understood the foregoing through:
    import flashx.textLayout.operations.ChangeElementIdOperation

    In my project, I can't use both the CharacterFormat but also ChangeElementIdOperation. Is there a version of Gumbo that will allow me to use these two classes in my code? Is there any set of SWC, that I need to download and place in a specific folder in the installation of Flex to make the code to compile correctly?

    The format classes have been merged into a single TextLayoutFormat in a recent series of changes to the API. You can read about these changes to API on our blog: changes of API TLF in build 370

  • 1046: type was not found or is not a constant of compilation

    I am creating a Flash game and I'm at the point where I am trying to add blocks to my platform but want to do by script so that I can tell him where to place them on the stage rather than my having to do it manually. However, I now get the following errors and the code on mygame.as:

    1046: type was not found or is not a compilation constant: rect2020.
    var newObject:rect2020 = new rect2020();

    1180: call to a method may be undefined rect2020.
    var newObject:rect2020 = new rect2020();

    I mygame.fla in the library a movieclip to rect2020 which is essentially a 20 x 20 image I had created in fireworks and imported into the library. Is there something special I need to do? my code is attached:

    You must assign a class name to the element in the library. Did you do that? If not, then right-click on it in the library and select the binding element in the menu. In the interface that appears, select the export for actionscript option and the name of mc should automatically fill in the class field. Remember, it is that your code calls (rect2020).

  • Why the MouseEvent not a compilation is constant?

    Hi - I'm trying to understand AS3 having never really understood AS2.

    In a class file, I have a button (GameButton) I want to all proceedings there are exactly the same. I found this code in a tutorial, but when I run it I get the error: "Type was not found or was not a compilation constant: MouseEvent.»  And then he appoints 2 of my public duties. I don't see what is wrong, so I hope someone can tell me what is the problem here.  Here's all the code in my class file:

    package {}

    import flash.display.MovieClip;

    SerializableAttribute public class GameButton extends MovieClip {}

    public void GameButton() {}

    trace ("GameButton has been created");
    Stop();


    addEventListener (MouseEvent.MOUSE_OVER, hoverOver);
    addEventListener (MouseEvent.MOUSE_OUT, hoverOff);
    }

    public void hoverOver(event:MouseEvent):void
    {
    this.gotoAndStop (2);
    }
    public void hoverOff(event:MouseEvent):void
    {
    this.gotoAndStop (1);
    }

    public void setLabel(newLabel:String):void
    {
    this.buttonLabel.text = newLabel;
    }
    }
    }

    TIA your expertise.

    JL

    When you see a message like that it means that you need to import that class (just as you have imported the movieclip class).  (or, you have made a typo, and there is no such class.)

    If you don't know how to import this class, see this category in the help files, and at the top, it will show how it should be imported:

    import flash.events.MouseEvent

  • 1046: type was not found or is not a constant of compilation: [flashx.textLayout.elements]: IFormatResolver, error. Help?

    If im working on a project and this error keeps happening and I have no idea why. Does anyone know how can I fix? For now I was just opening an old version of the file and copy and paste my changes in it, but it is extremely time consuming and I was hoping that he could be another faster way around that. If someone could just tell me what could be the cause of what would be a great help.

    Im working in Flash CS6 with AS3

    1046: type was not found or is not a constant of compilation: [flashx.textLayout.elements]: IFormatResolver.

    Well by going to settings publish Flash I realized that everything what happened past the Flash version he published as Flash player 9 Flash player No 11.4. I went on it and the error message no longer appears.

    Thanks for your help Ned.

Maybe you are looking for