12-17-2010 02:48 PM
Hello,
Can you add a object to a BaseDialog with addChild?
I tried it but the child object is not showing.
Tjitte
Solved! Go to Solution.
12-17-2010 03:34 PM
hey Tjitte,
The BaseDialog (and all dialogs since they extend the basedialog) is a service on the AIR runtime. Therefore not an actual object you can add to. You can only set a few variables and settings but other nothing can be added using the addChild() method. That being said, however, you can add objects and such using the messageHTML property of the AlertDialog class. Doing so you can add images and formatted text just like an HTML page. Here is an example from the QNX AsDocs:
var dialog:AlertDialog = new AlertDialog();
dialog.messageHtml = "<img src='http://www.somewebsite.com/somegraphic.jpg' width='500' height='350'/>";
This will add an image from an external source into your alert. hope that helps. good luck!
12-17-2010 04:16 PM
12-18-2010 11:21 AM - edited 12-18-2010 11:22 AM
12-18-2010 12:35 PM
Try changing "file:" to "app:". Don't know if it will help, but I remember seeing this in one of my apps.
12-18-2010 12:41 PM
12-18-2010 01:08 PM
Does it work when the image url is to some external web site?
12-18-2010 01:14 PM
I was thinking about extending one of the dialog classes to have multiple text inputs. So does this mean that i cannot acheive this via extension? If not then any suggestion on another good way of doing this?
Thanks,
Baibhav
12-18-2010 01:20 PM
@jtegen: I cant get any images to load up. dont know if its my network settings or if this is a bug in the message html. it formats the text fine but does not import images. ill keep working on it.
@Tjitte: I havent been successful yet in importing any sort of image. ill keep at it. ill update you if i find anything. but from the ASDocs only external images are (supposed to be) supported.
@baibhav: users have tried to extend the basedialog class but have failed. we assumed because it is not an actual physical object more of a service type class in the playbook. that or becasuet here is something else going on in the class we are not aware of.
12-18-2010 01:32 PM
It was discussed in one of the webinars that the Dialog structure is a service on the playbook. They mentioned that it was to ensure a common look and behavior across all applications. (dont shoot the messenger)