Digital Workshop

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Converting Pro pub to Flex pub
PostPosted: January 28th, 2011, 2:00 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,

A while ago, with some help, I developed an animation for a lesson on breathing. The image expands and contracts slowly to model breathing. Having developed this in an Opus Professional publication type, I now am trying to "translate" it into a Flex pub version. I've checked the actions in the Opus help guide that cannot be used in Flex, and so far have not been able to identify any from the Pro pub that could not be used in Flex. But the original Pro script does not work in Flex.

I would much appreciate if others could take a look (script below) and let me know (1) which actions cannot make the transition to Flex, and (2) any suggestions for substitute actions that could be used to create the same result.

Here's the earlier link to the development of the breath training tool, with sample IMP's: viewtopic.php?f=4&t=3795&hilit=breath

Code:
var time1

function minuteTimer()
{
breakLoop = false
stopLoop = false
fork (calcBreathing)

for (var i=0;i<time1;i++)
   {
   
   wait(60)
   breakLoop = true
   Submit.Show()
   Text122.Show()
   Text12.Show()
   TextInput22.Show()
   TextInput2.Show()
   Submit2.Hide()
   TextInput2.SetTransparency(0,false)
   TextInput22.SetTransparency(0,false)
   Text12.SetTransparency(0,false)
   Text122.SetTransparency(0,false)
   Text5.SetTransparency(0,false)
   Frame12.SetTransparency(0,false)
   Submit.SetTransparency(0,false)
   TextInput2.Enable(true)
   TextInput22.Enable(true)

   Debug.trace("\n minutes elapsed "+(i+1)+"\n")

   }
stopLoop = true   
}

function calcBreathing()
{

   
   var bar2 = 60/bar1

   for (loop = 0;loop<bar1;loop++)
      {
      mySound.Play(1,volume)
      Vector8.Scale(.5,.5, bar2*.3)
      mySound.Stop()
      wait (bar2*.05)
      mySound2.Play(1,volume)
      Vector8.Scale(-.5,-.5,bar2*.6)
      mySound2.Stop()
      wait (bar2*.05)
      if (breakLoop) break
      }
   
   
   breakLoop = false
   if (bar1 > 6) bar1--
   if (!stopLoop) calcBreathing()


      
}


Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Converting Pro pub to Flex pub
PostPosted: January 28th, 2011, 2:56 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Clicking the "show Details of Publishing Details" when compiling will show which functions do not work. Why DW hasn't flagged these as errors, i don't know because they will fail your publication :-?

You key problem is there is no wait in Flex (this is not an Opus issue). You'll need to build this using Opus Actions and I'd suggest start from new with a Flex publication, not changing type.

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: Converting Pro pub to Flex pub
PostPosted: January 28th, 2011, 4:09 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
Thanks, Mack.

Ran the publish details as you suggested. "Fork" is not supported. Also, as you pointed out, "wait" is not supported.

Warning: Warning: OpusScript function 'fork' not supported in Flex
Warning: Warning: OpusScript function 'wait' not supported in Flex

While I can try to substitute an Opus "delay" action for "wait," I am not sure what to do about "fork."

Can you suggest a way to adapt the script (see above) to fix this for "fork"? (Hopefully "wait" can use a "delay" standard action as a substitute?) Then I can try this in a new pub, starting over as Flex.

I had read in the help guide that "fork" may be related to "simultaneous" action, but how do you set up a "simultaneous" action with

Code:
for (var i=0;i<time1;i++)


Thanks for you help.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Converting Pro pub to Flex pub
PostPosted: January 28th, 2011, 4:15 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Try the Simultaneous Action Group on the programming tab.

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: Converting Pro pub to Flex pub
PostPosted: January 28th, 2011, 4:49 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,

I have tried the simultaneous action group, using 2 script objects, one with the minuteTimer function and one with the calBreathing function. The problem is that each of these functions still has a "wait" in it. Can't figure out how to write the "for" loops and include a "wait" or "delay" action using only the standard Opus actions.

Attachment:
screenshot1.jpg


You do not have the required permissions to view the files attached to this post.

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Converting Pro pub to Flex pub
PostPosted: January 28th, 2011, 5:10 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
As I said above, you'll need to build this using actions.

Add two consecutive groups to the simultaneous group. Then in each add the necessary actions.

This, in theory, and it is Friday and been a long week will:

Run both consecutive group together but each of the each in the groups will run one after another. Briefly looking at the other bits of code, these are just shows and transparencies - so I'd guess it would work.

Mack

BTW, don't put functions in script actions regardless of Flex / Opus

_________________
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: Converting Pro pub to Flex pub
PostPosted: January 28th, 2011, 5:39 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,

Again, much thanks for these suggestions.

Tried every conceivable combination and keep getting "fatal runtime errors."

I'm beginning to think that a few components of this script cannot be translated into standard Opus actions for a Flex pub. :(

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Converting Pro pub to Flex pub
PostPosted: January 29th, 2011, 7:00 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Stephen,

I'm no code guru, so take this with a grain of salt.
I notice you do not use curly brackets in your if statements and possibly other areas. I did a bit of searching then. Did not find a definitive answer, but did come across one long discussion that 'debated' coding style ( 'cuddling' vs. 'next line'). One guy maintained that 'next line' approach was better handled by Flex Builder. While I did not take time to read the whole thing, I kind of expected someone to speak up and say that curly brackets were not needed... but never saw anything that pointed to that as an option.

If you care to read: http://gskinner.com/blog/archives/2008/ ... es_to.html

GSkinner at end of main article:
Quote:
Adobe has chosen to adopt next line formatting for curly braces for whatever reason. This means that if you use next line formatting, your code will adhere to Adobe’s internal standards. FlexBuilder also seems to only support next line formatting for its auto generated code, which really pisses me off (anyone who knows how to fix this, please comment!).


Maybe you can get away with single line if statements in opusscript, but I wonder if there is some gotcha going over to Flex.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Converting Pro pub to Flex pub
PostPosted: January 29th, 2011, 10:46 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
It's an interesting point but I doubt it, though you'd need somebody with Flex Builder, rather than the newer Flash Builder (Adobe and their damn naming) as the first product is AS2 which I believe is what Opus Flex is based on. In AS3, you can both do without curly braces in a single line if and quite rightly so in a single line if else - which given as it's basically a ternary operate - makes sense.

As for developing in Opus Flex, it really is a very powerful program, but you cannot think of it in the same terms as Opus. Opus' makes it really easy to throw together a working application without much thought or planning allowing most people to muddle through (not that I'd advise this). Opus Flex, works well but take time to storyboard and play with each of the aspects of your design - prototyping - and learning what works and what doesn't.

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: Converting Pro pub to Flex pub
PostPosted: January 29th, 2011, 2:23 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,

Thanks Larry and Mack for your thoughts.

Regarding this animation, I am finding that the biggest challenge is finding a substitute for the "wait" actions in 3 places: the first can use a 60 second "delay," but the 2nd and 3rd, in the middle of the calcBreathing function, require setting to an expression, rather than a specific number. When I set a variable to the expression, it fails. So, not being able to create a work around for these "wait" actions has prevented any progress.

Theoretically, the "fork" should be able to use as substitutes a "simultaneous" in the programming tab, adding a run of 2 consecutive standard actions, one for each group of actions previously in the 2 functions.

However, substituting "delays," "simultaneous" and "consecutive," I still get a "fatal runtime error in the Opus preview (haven't gotten far enough to preview in Flash player 10)." This little animation should be relatively basic and straightforward, so I must still be doing something wrong.

Agreed, Opus Flex is a powerful tool. It would be great to be able to leverage all of the effort that went into this Opus Pro pub by successfully "translating" it into Opus Flex for wider deployment. Or, an Android plug-in similar to the Plexus plug-in. :)

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Converting Pro pub to Flex pub
PostPosted: January 30th, 2011, 6:02 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Stephen,

Quote:
not being able to create a work around for these "wait" actions has prevented any progress.

Of course in scripting it is wait(0), or some time span, and in standard actions it is delay <set a time>.
If you cannot set a delay, a workaround might be to place a simple graphical object off-page, and then use std animations and set 'exclusive' or wait until completed (in script... animation time is set, and wait is 'true'). Alternatively, you could set up a std actions Ticker/loop.... when placed in an action series, should create the needed delay.

I think Mackavi's suggestion to start fresh with a Flex type -- and just prove that these needed actions work. If that works, you need to troubleshoot what assumptions you are making about what can be converted in pub type, or in scripted actions carried to Flex.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Converting Pro pub to Flex pub
PostPosted: January 30th, 2011, 2:20 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,

Thanks Larry for these suggestions. I did begin over starting with a Flex pub. I've also tried using delay in the new Flex pub, setting it in a loop to replicate

Code:
for (var i=0;i<time1;i++)


For the script

Code:
wait (bar2*.05)


I have used delay and set it to a variable which is set to the expression bar2*.05.

Still getting a "fatal runtime error."

A redesign, as suggested, using a totally different animation would be next, but I don't think I can replicate the timing precision and changing process which incrementally "slows" the breathing another way.

Again, thanks for your suggestions.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Converting Pro pub to Flex pub
PostPosted: January 30th, 2011, 6:13 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
I'm confused. This looks like script? Stick with actions!

http://sandbox.interaktiv.co.uk/Breathing.swf

Trigger
Loop
set variable (b/in)
delay (variable)
set variable (b/out)
delay variable
decrement variable

I added the blue bar latter to see what was possible.

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: Converting Pro pub to Flex pub
PostPosted: January 30th, 2011, 6:42 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,

Very impressive Flash example!

Applying these actions to my pub, I've tried and tried, but cannot get it to work. Just took another run at it. No joy.

I'm not sure, for example, what variable to set for breathe out and what variable to set for breathe in. How to vary their timing using decrements.

Could you post the Flex IMP? Maybe I can see how your example works, build on these actions?

This would be a big help.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Converting Pro pub to Flex pub
PostPosted: January 31st, 2011, 6:28 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Simple example using delay in Flex.

Mack


You do not have the required permissions to view the files attached to this post.

_________________
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


For this message mackavi has been thanked by : Stephen


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 21 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