Solved

Multiple mx:Script blocks in a single mxml file?

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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Copy &  paste option in flex air application 20 910
Advanced Datagrid with checkbox 4 315
how to edit swc file 3 594
Flex SDK setup 1 361
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…
How many times a day do you open, acknowledge, or close an IT incident? What’s your process? Do you have a process depending on the incident, systems involved, and other factors? New Relic Alerts gives you options for how you interact with notifica…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

738 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