Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 10:57 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Opus Pro-using external JS libraries
PostPosted: February 10th, 2014, 9:55 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
I am working on Opus Pro (v 9) pubs, with animation exercises, and wondered if it is possible to use external JS libraries. There are some interesting JS game engines, external packages, libraries that could be helpful, if there were a way to add them as a resource and call them from a Pro pub (similar to calling an external DLL).

Is this possible?

If yes, any leads, examples on how to set up in a Pro pub would be appreciated.

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Opus Pro-using external JS libraries
PostPosted: February 12th, 2014, 6:34 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
http://files.interaktiv.co.uk/support/tips.htm

Yes, Rule #11 - there is no box. If it's a JS library, and you have a HTML5 application then ultimately, they can be used. That's the easy question.

Because we a) don't yet have any practical way to link an external script (library) and b) using such scripts (libraries) could easy be a can of worms - I'm holding fire on posting answers on this topic.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Opus Pro-using external JS libraries
PostPosted: February 12th, 2014, 6:59 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Mack,

Apologies for not being clearer: asking about ability to use external JS packages for Opus Professional pubs (that publish as EXE's for Windows desktop/laptop/tablet deployment). Not for HTML5 pubs made in Opus Pro.

Wish there were a way to do that.

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Opus Pro-using external JS libraries
PostPosted: February 12th, 2014, 11:09 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Technically, you already can - but probably not at the level you require. OpusScript is basically just JavaScript 1.1 but we have the objects in the IDE instead of the DOM. Same principles - different names.

Many users of this forum, including myself have been using JS code with OpusPro for years.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Opus Pro-using external JS libraries
PostPosted: February 13th, 2014, 12:45 am 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Mack,

Thank you for this information. I think what I am trying to figure out is whether you can add an external JavaScript package in an Opus Professional (not HTML5) pub. Not a line or two or a few of JS, but an entire package with sub-folders each containing several scripted functions. And then being able to call these functions from within the runtime pub and have them run, delivering actions that regular Opus Script doesn't currently support.

So, for example, my old pedigree drawing software still needs on the fly (during runtime) line drawing that the user can employ to connect symbols, save these (positions, angles, other characteristics), then be able display them next time. I think there are external JS packages with these drawing/saving/opening functions/capabilities. But they would need to be called from within the pub.

For example, I've used an external package (http://blog.ryantan.net/2012/07/free-transform-manager-as3-v1-5-1/) in Flash AS3, for example, to add rotation handles to jigsaw puzzle pieces. The handles and rotation depend on calling specific functions/classes located in the external package (external package is compiled into the final published SWF). Having this capability in an Opus Professional publication would greatly extend capabilities to actions beyond current Opus Script. Somewhat similar to adding external DLL's and calling their functions from within Opus.

Just an interesting possibility...

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Opus Pro-using external JS libraries
PostPosted: February 13th, 2014, 9:56 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
It is an interesting possibility, but your example is simply importing ActionScript in Flash not JavaScript into Flash. Again the languages are ECMA based, like OpusScript, but importing either raw JavaScript or OpusScript into Flash could just as easily fail because of differences in the language and functionality in the environment.

OpusScript has the publication; JavaScript the window and Flash the stage - different names - same concept. The same as Americans have their trash cans and the British their rubbish bins. Both cultures have the 'function' of putting out the trash / rubbish - so the object and method are basically the same:

Code:
trash.putout()

rubbish.putout()


I can even to do clever programming stuff, so that a script could use either. But even if you do this, both environments have to have the same functionality - even if named differently.

For example, if the Americans have the function of recycling but the British have no concept of this function, the instruction:

Code:
rubbish.recycle()

will fail for the British.

Exactly the same problem with the applications, if Flash or the Browser have the ability to draw a line from A to B, but Opus has no such ability, simply importing an external library of JavaScript or ActionScript will not resolve this problem. Opus.exe itself would have to be changed to add the ability before an action / script method could implement it.

And I'm not just referring to single lines of code. Libraries, simply take what already exists and repackage it into a more use friendly set of properties and methods. They don't add anything that cannot already be completed using the raw code.

If the motivation was great enough, I could write a library for Opus, that could be linked or imported that added easier methods for any numbers of situations including drawing connecting lines between objects or adding rotation handles to an object (only because Opus already has functions available that can be used to this end!).

Code:
Vector1.addHandles(parameters)

function addHandles(a,b,c){
//with .this do
}


That's rather rubbish code, but it's possible and Opus users have done it plenty of times. I think it was Paul (NZ), who wrote a library that expanded the Array object to provide methods found in newer versions of ECMA (JavaScript).


The only reason we don't have lots of OpusScript libraries to make things easily, is because nobody has bothered to write; adapt them from other ECMA languages or share them. It's one of the reasons why Opus HTML5 is a far superior publication type. You get most the functionality of Opus running in an environment (the browser), that has more and improving functionality and uses standardised and up-to-date JavaScript.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Opus Pro-using external JS libraries
PostPosted: February 13th, 2014, 1:51 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Thank you, Mack, for that comprehensive understanding of the issues faced. Rather challenging, for me!

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group