0

I load my fxg and it's fine. But I want to change my fxg file in runtime, then i want to refresh my browser page and see my changes. Is it possible to do in flex?

Boris Mitioglov
  • 1,092
  • 4
  • 16
  • 32

1 Answers1

1

An FXG is compiled; so you can't change it at runtime.

Since you mention refreshing your browser page; there may be a way. You may be able to modify the FXG in some manner; call a service that will use command line tools to recompile the project; and then when the browser is refreshed your updates should be shown.

You may be able to make this transparent to the user, without a formal page refresh, by using a "wrapper" application that just loads other SWFs via SWFLoader.

JeffryHouser
  • 39,401
  • 4
  • 38
  • 59
  • Please can you explain about "wrapper" application. How I can load other SWF ? How I can get swf from fxg? – Boris Mitioglov May 22 '13 at 15:10
  • You can load a SWF using SWFLoader. I edited the question to add a link to the class. The "Wrapper" application would be an app that does nothing but load other SWFs. You can get get a SWF from an FXG using the Flex compiler. I assumed, based on your original question, that this is what you were already doing. – JeffryHouser May 22 '13 at 15:45
  • +1 ... since FXG's are compiled, you can't change their properties dynamically at runtime. If you want this functionality, you can use Spark graphics primitives like `Rect` (``). These allow you to change their properties, and have a very similar syntax to FXG. The tradeoff is they are a little heavier than their FXG counterparts. But you could get the dynamic behavior w/out having to refresh the page. – Sunil D. May 22 '13 at 22:36