Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Multiple mx:Script blocks in a single mxml file?

Posted on 2011-03-15
1
312 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

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…
The business world is becoming increasingly integrated with tech. It’s not just for a select few anymore — but what about if you have a small business? It may be easier than you think to integrate technology into your small business, and it’s likely…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

809 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