Select to view content in your preferred language

from flex 3 to flex 4 FlexGlobals.topLevelApplication

1905
3
09-14-2010 07:14 AM
abukhan
Occasional Contributor
I moved my application from flex 3 to flex 4..

I had in flex 3:
<MaxRestorePanel xmlns="com.DragPanel.*" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:tool="Components.*"
horizontalCenter="0"
width="100%"
x="{(mx.core.Application.application.width / 2) - (this.width / 2)}" y="{mx.core.Application.application.MainPanel.y}"
title="Loan Search"
creationComplete="loanfilterInit()"
  >

In Flex 4:
I changed it to :
<MaxRestorePanel xmlns="com.DragPanel.*" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:tool="Components.*"
horizontalCenter="0"
width="100%"
x="{(FlexGlobals.topLevelApplication.width / 2) - (this.width / 2)}" y="{FlexGlobals.topLevelApplication.MainPanel.y}"
title="Loan Search"
creationComplete="loanfilterInit()"
  >

I got the following error:
  Access of undefined property FlexGlobals

How should I change from mx.core.Application.application to FlexGlobals.topLevelApplication
as suggested by the Flex 4 compiler?
Tags (2)
0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus
Abu,

   Did you import mx.core.FlexGlobals; or try mx.core.FlexGlobals.topLevelApplication.width
0 Kudos
abukhan
Occasional Contributor
I replaced mx.core.Application.application with mx.core.FlexGlobals.topLevelApplication
and now I get this warning :

-Data binding will not be able to detect assignments to "topLevelApplication".
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Abu,

   Not is not a uncommon warning and is completely harmless just ignore it.
0 Kudos