i want to create instance of mxml (in my case EventList) and pass parameters. My Event List is a list of panels so I want to pass parameters and generate dynamically n number of panels (n-parameter to pass). I have the main app where I have toggle button bar when I click on the first I want for example to generate 3 panels (n=3) on the second button 20 panels (n=20) etc.
How can I do this? How can I pass n and what is the best way to show the list? I whant to generate the list when I click on the toggle button!
i want to create instance of mxml (in my case EventList) and pass parameters.
Share
Use xmlnamespace(xmlns) to access the mxml file in your source folder.I created an application which includes xmlns=”*” (* means you can access any component in the source folder)to access the myEvenList component. i pass the n value here itself.Check out the example.HTH.
togglePanelCount.mxml
myEvenList.mxml
PS:Having n as a public attribute itself gives you a way of passing the count of panels.Even in the mx:Script tag in the application, you can instantiate the myEventList object and set the value of n instead of using mxml tags.