Solved

Multiple mx:Script blocks in a single mxml file?

Posted on 2011-03-15
1
304 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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now