Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: AIR 2.0, Aptana based Javascript app... Use PureMVC swf directly?  (Read 4191 times)
zermattchris
Full Member
***
Posts: 35


View Profile Email
« on: September 26, 2010, 01:28:00 »

Hi gurus,

I'm slowly coming to grips with AIR 2.0 Javascript based apps (using jQuery).

I'd *really* like to have a go at using PureMVC for this work, but am not sure if it's possible to use the PureMVC actionscript classes, defined in "PureMVC_AS3_2_0_4.swf", directly via Javascript or not.

The issue seems to be needing to sub-class the PureMVC classes to use them correctly. I don't think there's a way to do this via Javascript???

I can import the PureMVC lib into the project with:
:
<script type="application/x-shockwave-flash" src="/lib/puremvc/PureMVC_AS3_2_0_4.swf"></script>

and create an instance of Facade...

:
var puremvc;
$(document).ready(function(){
     if (!puremvc) puremvc = {};
     puremvc.facade = new window.runtime.org.puremvc.as3.patterns.facade.Facade();
});

...but haven't figured out a way to handle the required sub-classing or adding Interfaces to the js object.

Anyone ever tried this?
If this approach isn't workable (guessing it's not), does anyone have some pointers as to how an AIR js based app could make use of the PureMVC swf directly, or would I have to look at using the JS port??

Sorry if this is a lot of questions!

Cheers,
-Chris



Logged
zermattchris
Full Member
***
Posts: 35


View Profile Email
« Reply #1 on: September 26, 2010, 03:15:52 »

Okay - after having done some more digging, it looks like the PureMVC MooTools js port is the way to go for JS based AIR apps.

I haven't done anything with MooTools to date, but must say that it looks like the perfect match for PureMVC! Not having a good way to organise my js code properly in a larg-ish AIR app has been the one thing holding me back from giving the tech a proper try.

Sorry for the noise with the above questions! If I get it all working and manage to grok PureMVC, would be happy to share any insights I might garner...  :)

Cheers,
-Chris

Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 on: September 26, 2010, 08:39:37 »

Yeah, that's pretty much the direction you'll need to take. I don't know how compatible MooTools and JQuery are, but it'll be good to hear what you're able to do with it. Have a look at the EmployeeAdmin demo for JavaScript and see if it makes sense to you.

The real trick will be integrating AIR from that perspective (I only use it from ActionScript, personally). I'll really like to hear your experiences if you give that a whirl.

Cheers,
-=Cliff>
Logged
Pages: [1]
Print