Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Multiple mx:Script blocks in a single mxml file?

Posted on 2011-03-15
1
Medium Priority
?
323 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
[X]
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
1 Comment
 
LVL 29

Accepted Solution

by:
dgofman earned 2000 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

Take our survey for a chance to win!

As a valued customer of Targus, we’d like to ask you a few questions about us. As thanks, you will be automatically entered for a chance to win a $500 VISA gift card. To enter, just complete the survey by September 15, 2017.

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…
In this article, I’ll show how research, determination, and use of modern technology helped me solve a DNA mystery.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

722 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