Integration with Flex apps

Integration with Flex apps

Postby inlineblue » Wed Jan 07, 2009 5:18 pm

First off, I would like to say that OFC is a great piece of work. So much so that we're thinking of integrating it with one of our Flex applications. The difficulty we have is that OFC was not designed to be used inside another application. The two main issues are (1) it sizes itself to the full size of the stage and (2) event handlers attempt to call Javascript methods via ExternalInterface.

The approach I'm taking right now is to have our app load the OFC swf at runtime. This won't work out-of-the-box so I've already begun making some changes to allow for this. Basically, OFC needs to be aware of when it's been loaded by another swf. Once it knows this, it can then:
(1) Accept width/height values from the parent and size itself accordingly
(2) Dispatch events to the parent instead of calling out via ExternalInterface

Alternatively, another approach I had thought of was to turn OFC into an AS3 component of sorts. This way it can be linked into an application instead of being loaded at runtime. This will require quite a bit more work, so I've decided against it for now. However, I believe this component approach is the cleanest in the long run.

Like I said, I've already begun work in this area (in an R&D fashion) and have a working prototype. My question is whether there is any interest in adding this as a general feature to OFC?

Thanks,
Jason
inlineblue
 
Posts: 2
Joined: Mon Jan 05, 2009 11:55 pm

Re: Integration with Flex apps

Postby Kryten » Tue Feb 17, 2009 10:01 pm

Hi,

I am interested in this project.

Have you managed to contact the OFC team to add the feature?

Thanks,

Alexandre
Kryten
 
Posts: 3
Joined: Tue Feb 17, 2009 7:21 am

Re: Integration with Flex apps

Postby BartVB » Wed Feb 18, 2009 7:18 am

I'm not using Flex apps myself but here is a recent topic about integrating OFC with SWF/Flex. It looks like someone managed to accomplish this:
viewtopic.php?f=4&t=508
BartVB
 
Posts: 27
Joined: Sat Feb 14, 2009 11:04 am

Re: Integration with Flex apps

Postby monk.e.boy » Fri Feb 20, 2009 8:54 pm

i have heard oh mxml stuff.

can we split ofc into a container and an mxml chart? then a flex app coul load the chart object...

i will apply patches that enable this :)

monk.e.boy
monk.e.boy
Founder & Project Lead
 
Posts: 653
Joined: Thu Sep 04, 2008 10:06 pm

Re: Integration with Flex apps

Postby vtstarin » Sat Mar 07, 2009 6:46 am

Hi there,
did you succeed with the integration?

Regards
-vtstarin
vtstarin
 
Posts: 73
Joined: Thu Feb 26, 2009 10:15 am
Location: Adelaide, Australia

Re: Integration with Flex apps

Postby trandriana » Wed Mar 11, 2009 3:30 pm

Hi there ..

I m trying to integrate the OFC 2 within a flex APP.

Typically that s how I am doing it.

1 - I renamed the constructor of the main class to "init" + make the "data-file" as a parameter of this method,
2 - I created a default blank constructor for this class main
3 - In my mxml file, I try to instantiate the class main and then call the init method with the data-file url as argument.
4 - When the load is complete (EventListener), i would add this instance of the class main to one of my container (cf the addChild method).

But ... err nothing happened ...

Any idea ?
trandriana
 
Posts: 12
Joined: Fri Nov 14, 2008 10:27 am

Re: Integration with Flex apps

Postby trandriana » Tue Mar 17, 2009 12:58 pm

trandriana wrote:Hi there ..

I m trying to integrate the OFC 2 within a flex APP.

Typically that s how I am doing it.

1 - I renamed the constructor of the main class to "init" + make the "data-file" as a parameter of this method,
2 - I created a default blank constructor for this class main
3 - In my mxml file, I try to instantiate the class main and then call the init method with the data-file url as argument.
4 - When the load is complete (EventListener), i would add this instance of the class main to one of my container (cf the addChild method).

But ... err nothing happened ...

Any idea ?


Resolved :)

Actually ...a Sprite can t be included in a mxml container ...I need to use UIComponent ...and it works great :) :)
trandriana
 
Posts: 12
Joined: Fri Nov 14, 2008 10:27 am

Re: Integration with Flex apps

Postby trandriana » Wed Mar 18, 2009 11:21 am

I succeeded the flex integration

For the moment, a few things to change in several class (generally all things dealing with stage)
but, I have to work with the adaptation of External Interface call to Component Call ...
trandriana
 
Posts: 12
Joined: Fri Nov 14, 2008 10:27 am


Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest