Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
dbigham
Posts: 515
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA
Accepted Solution

Error: Type was not found or was not a compile-time constant: PromptDialog.

My PlayBook app won't compile for the BB10 AIR SDK because of 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 use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Error: Type was not found or was not a compile-time constant: PromptDialog.

Did you include the proper ANE?
Please use plain text.
Developer
dbigham
Posts: 515
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA

Re: Error: Type was not found or was not a compile-time constant: PromptDialog.

Please use plain text.
Developer
dbigham
Posts: 515
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA

Re: Error: Type was not found or was not a compile-time constant: PromptDialog.

Please disregard. Somehow I missed changing the import statement to refer to the new location of this class in BB10:

 

import qnx.fuse.ui.dialog.PromptDialog;

Please use plain text.