bright, fresh software
Downloads  |  Buy

LimeLM for HTML/Javascript Programmers w/ no Flex Experience

LimeLM for HTML/Javascript Programmers w/ no Flex Experience

Postby snatcher » August 27th, 2011, 11:50 am

Hello,

I am an HTML/AJAX programmer using the Aptana framework to build out my AIR app. I have no idea how to reference these .mxml files or anything else for that matter.

Can you please point me in the right direction?

Thanks
snatcher
 

Re: LimeLM for HTML/Javascript Programmers w/ no Flex Experi

Postby Wyatt » August 27th, 2011, 1:12 pm

The "Using TurboActivate with Adobe AIR" article is a good place to start. You'll need to include TurboActivate.as and TurboActivateEvent.as within your Adobe AIR project. The "mxml" files are just windows showing how to use TurboActivate. You can open these files in a text editor. I also believe Aptana supports opening these files.


Tell me if this helps.
User avatar
Wyatt
Site Admin
 
Posts: 3092
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: LimeLM for HTML/Javascript Programmers w/ no Flex Experi

Postby snatcher » August 27th, 2011, 1:31 pm

Wyatt,

Thanks for the quick response. Unfortunately I've read that article dozens of times. I can't figure out how to get those files referenced from my main application.xml file?

It seems like it requires me to mix javascript/html AIR Code with Flex/AS which I am entirely unfamiliar with.

Does this mean I only need to include those 2 files, and not have the bin-debug directory with a subdirectory called Windows containined systa.exe, Turboactivate.exe?
snatcher
 

Re: LimeLM for HTML/Javascript Programmers w/ no Flex Experi

Postby snatcher » August 27th, 2011, 1:33 pm

I'm also assuming I need to put this code somewhere to activate the registration stuff:

public function init():void
{
ta.VersionGUID = "Paste GUID Here";

// these are TurboActivate event handlers that will be used at
// both the start of your program and throughout the use of your program
ta.addEventListener(TurboActivateEvent.IS_ACTIVATED, onIsActivated);
ta.addEventListener(TurboActivateEvent.USE_TRIAL, onUseTrial);
ta.addEventListener(TurboActivateEvent.TRIAL_DAYS_REMAINING, onTrialDaysRemaining);
}

private function onIsActivated(evt:TurboActivateEvent):void
{

}

private function onUseTrial(evt:TurboActivateEvent):void
{

}

private function onTrialDaysRemaining(evt:TurboActivateEvent):void
{

}



Now would that go in my main HTML file? If so do I need to convert that AS code to JS?
snatcher
 

Re: LimeLM for HTML/Javascript Programmers w/ no Flex Experi

Postby Wyatt » August 27th, 2011, 1:50 pm

The first step is to add the TurboActivate.as and TurboActivateEvent.as files to your project. They are plain old vanilla ActionScript files that will work with any Flash Based program in the world. Then you need to add the init function to your app and use some TurboActivate functions like show in the step-by-step walkthrough.

Here's how you add an init function: NativeProcess in AIR using JavaScript


Then run your app. You'll get an exception about it not being able to find the "systa.exe" file. Add the systa.exe, TurboActivate.dll, and TurboActivate.dat files in a "Windows" folder you created. And put that "Windows" folder in whatever "debug" folder Aptana creates for you.


This should get you started. Tell me if it helps.
User avatar
Wyatt
Site Admin
 
Posts: 3092
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: LimeLM for HTML/Javascript Programmers w/ no Flex Experi

Postby snatcher » August 27th, 2011, 2:48 pm

[app:/SNATCHER.html][15:43:13] ReferenceError: Can't find variable: TurboActivate
[app:/SNATCHER.html][15:43:13] TypeError: Result of expression 'ta' [undefined] is not an object.




<html>
<head>
<title>SNATCHER v0.8.11 DESKTOP</title>
<link rel="stylesheet" type="text/css" href="css/reset.css" />
<link rel="stylesheet" type="text/css" href="css/styles.css" />
<script src="lib/air/servicemonitor.swf" type="application/x-shockwave-flash" />
<script type="text/javascript" src="lib/air/AIRAliases.js"></script>
<script type="text/javascript" src="lib/air/AIRIntrospector.js"></script>
<script type="text/javascript" src="lib/air/AIRSourceViewer.js"></script>
<script type="text/javascript" src="lib/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="lib/jquery/init.js"></script>
<script type="text/javascript" src="lib/jquery/domainfunctions.js"></script>
<script type="text/javascript" src="lib/jquery/savepreferences.js"></script>
<script type="text/javascript" src="lib/jquery/timestamp.js"></script>
<script type="text/javascript" src="lib/date.js"></script>
<script type="text/javascript" src="lib/jquery/encoder.js"></script>
<script type="application/x-shockwave-flash" src="lib/air/aircore.swf"></script>
<script type="text/javascript">

var ta = new TurboActivate();

function init() {
ta.VersionGUID = "17843029414e58ae47exxxxxxxxxxx6";
ta.addEventListener(TurboActivateEvent.IS_ACTIVATED, onIsActivated);
ta.addEventListener(TurboActivateEvent.USE_TRIAL, onUseTrial);
ta.addEventListener(TurboActivateEvent.TRIAL_DAYS_REMAINING, onTrialDaysRemaining);
}

function onIsActivated(evt) {
if (evt.ErrorObj == null)
{
if (evt.boolResponse)
{
alert('is activated');
// is activated, reenable any features
}
else
{
alert('is not activated');
}
}
else
{
// the function call failed, disable any features
alert('call failed');
// in a real world app don't throw exceptions. This is for debugging only
//throw evt.ErrorObj;
}
}

</script>
</head>
<body onload="init();">


SO I would expect to get those top errors given im not defining the as files anywhere. I'm just extremely confused with this because Flex/AIR and HTML/JS AIR are so much different. Any insight you could provide would be great
snatcher
 

Re: LimeLM for HTML/Javascript Programmers w/ no Flex Experi

Postby Wyatt » August 27th, 2011, 3:12 pm

You'll need to add the TurboActivate.as and TurboActivateEvent.as files to your Adobe AIR project. They're already pre-built -- they're in the "API\Adobe AIR\src" folder. Copy them to your project's folder and add them to your project.
User avatar
Wyatt
Site Admin
 
Posts: 3092
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: LimeLM for HTML/Javascript Programmers w/ no Flex Experi

Postby snatcher » August 27th, 2011, 5:54 pm

I do understand that part and have figured out how to add them to the project but how do I call them to be launched?
snatcher
 

Re: LimeLM for HTML/Javascript Programmers w/ no Flex Experi

Postby Wyatt » August 27th, 2011, 7:20 pm

The "Using TurboActivate with Adobe AIR" article explains how to use the TurboActivate functions. In the code you've posted you're already using the event handlers (which is a good start). These event handlers will get the response of any functions you call.

If you read on in the article you'll see the example expanded by using the "IsActivated()" function:

Code: Select all
public function init():void
{
...
    ta.addEventListener(TurboActivateEvent.IS_ACTIVATED, onIsActivated);
...
    ta.IsActivated();
}



After adding the "ta.IsActivated()" line to your init() function compile and re-run your application. If you see any exceptions read the error. For instance, if you haven't yet put the systa.exe, TurboActivate.dll, and TurboActivate.dat files in your debug folder then you'll get an exception.


Tell me if this helps.
User avatar
Wyatt
Site Admin
 
Posts: 3092
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: LimeLM for HTML/Javascript Programmers w/ no Flex Experi

Postby snatcher » August 28th, 2011, 9:59 am

Wyatt,

Thank you for your help. However after countless hours of attempting to make this work I have come to the conclusion that HTML/Javascript AIR Apps and FLEX/Actionscript AIR apps are two totally different monsters.

The code provided is not even remotely applicable from my trials and I hope that in the future you come out with a separate tutorial on AIR projects specific to HTML/Javascript. (If you visit Adobe's help site you'll notice they have entirely different help libraries for the two programming environments).

Thanks
snatcher
 

Next

Return to LimeLM, TurboActivate, & TurboFloat Support