Solved

Multiple mx:Script blocks in a single mxml file?

Posted on 2011-03-15
1
309 Views
Last Modified: 2012-05-11
I was just curious, I've inherited an application and I often see multiple mx:Script blocks in a single file. Sometimes they are separated:

mx:Script
mxml

mx:Script
mxml

and sometimes it's one after the other

mx:Script
/mx:Script

mx:Script
/mx:Script

Are there any reasons for this? More specifically, for performance/optimization? If there is no performance benefit, I'd like to consolidate all of the .as code together.
0
Comment
Question by:coldchillin
1 Comment
 
LVL 29

Accepted Solution

by:
dgofman earned 500 total points
ID: 35144357
You can open mx:Script tag for each line, it will not effect to your executing performance. Because on the end MXMLC compiler will generate AS files anyway.
But , in some case you must declared multiple mx:Script declarartion.
One of the common reason implementation in the itemRenderer(s) mx:DataGrid. When you want to implement different business logic for each column. Oterwice you must create new class files, what is more common way.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question