02-04-2011 01:35 PM
Hi everyone,
I am new to Flash builder and I have read the tutorial on creating playbook app using Flash builder.
In the tutorial, I see that we are using action script instead of mxml. I tried to add a button using action script but nothing shows in the simulator (I only see a white screen). It is because the mxml file under the views folder is taking control?
If I am using action script file, do I need to delete the Home.mxml that is under the views folder?
02-04-2011 01:47 PM
Welcome:
In posts like this, it is best to post code or sample code to illustrate the issue. The majority of time, your issue can be quickly resolved if others can see the code.
Couple of questions:
In a pure AS project, your root item would be an .as file too and not an MXML file. When creating the project with the wizard, the last panel will show the default/root class name. In your case, that was probably "Home.mxml". Simply rename that to "Home.as" and everything gets created properly. If you already have a project, it is easier to delete it and create a new project. Be certain to give your project a unique (reverse DNS) id (e.g. com.mydomain.home). You can alwasy change it later, but you may as well do it here.
Hope that helps.
02-04-2011 10:41 PM
I put the following code in my .as file and leave the Home.mxml file unchanged. I am using Burrito.
02-04-2011 11:08 PM
Try addChild(endButton); to add your button to the display list.
02-04-2011 11:11 PM
thanks. Now I see my button. Back to my original question, what does the Test2Home.mxml do?
02-04-2011 11:18 PM - edited 02-04-2011 11:26 PM
I believe you want to be working with just ActionScript which means that you shouldn't have any MXML files in your project. What you can use a MXML file for though is to easily design the appearance of your application. Flash Builder provides a WYSIWYG editor for MXML.
EDIT: @jtegen how do you edit the reverse DNS name without creating a new project? (Flash Builder Burrito)
02-05-2011 02:58 AM
@noah: In ur project list look for your -app.xml descriptor file. open that up and look for the ID tag. you can change that to anything you want.