Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 7:39 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: A few random issues (mainly Flex)
PostPosted: November 18th, 2009, 7:35 am 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
Thought i'd note these just in case anyone is looking :)

1. The Math.floor function was preventing publication using Flex/Flash. Same happened with Math.round etc. I removed this from a 'Set Variable to Expression' object and typed into a script instead, which solved the problem.

2. Bug. On trying to isolate the above error, I was deleting all the chapters I wasn't working on, then using Undo to bring them back. Every time I did this, I got a duplicate set of objects in every single page that had been deleted (and a third set if I did the same again etc). Only happens when deleting whole chapters rather than pages. Happens in non-flash pubs also.

3. Bug. On converting to flex (and at some other point when changing the properties) drawing objects made up of a number of polygons were corrupted. Basically, each polygon reverted to the centre of the group. A bit annoying considering I have about a thousand musical notes in my pub all made from multiple polygons. Such is life :)

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


For this message dan1 has been thanked by : mackavi


Last edited by dan1 on November 26th, 2009, 2:30 am, edited 1 time in total.

Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 23rd, 2009, 8:51 am 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
I'm having a real headache with this flex conversion. The post above noted that I couldn't complete publication with Math functions in a 'Set Variable to Expression' object but I could by tranferring them to a script.

Today I found that setting a (pre-defined) variable to a random number didn't work within a script (RandomNumber = String.random(5) + 1) but did using the 'Random' object (Set <RandomNumber> to Random(max 5)). The problem with this is that the script is accessed from a hundred different places, so each will have to be edited separately.

Is their any logic governing this behaviour or am I doing something wrong? Anyone with experiences to share welcome.

Thanks
Dan

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


For this message dan1 has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 23rd, 2009, 12:45 pm 
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
Dan,

What you write above just says you are on a learning curve (in this case, to know what applies to Flex and how to get more productive and do less stumbling). I think such learning curves are found in and around all good tools (ie, those that are powerful and flexible ... pun intended).

I don't use Flex much but played with it some to learn what was possible (and specifically to see how OpusPro behaved when it came to publishing for different end-use types). What I did learn in a short time, is that I couldn't retain in my brain all the nuances of what worked and what didn't when it came to web-based player, Flex, etc. (the List of 'not supported in Flex' helps, but is only a reference).

Quote:
Is their any logic governing this behaviour
What I concluded for myself is that if I was not anticipating needing a Flex work-product, I'd not worry about it AND not use it. And IF I thought I would want to output a Flex version at some point, I would select that Flex option upfront when creating a New Publication (Pub properties settings). I typically will not use Opus in less than its full-power capability.

As for rewriting scripts or modifying objects (for triggers/actions).... I might suggest this. Make your 'Random generating' script in the form of a function in a ScriptObject -- if you have not already done so. Secondly, Opus has some pretty fine ways of doing global replacing (have not tested whether that 'reaches' into object action script areas). If you must manually edit 100 different objects' actions... Copy&Paste of Actions (under the trigger tree) can speed up the tedious process.

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


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 23rd, 2009, 10:54 pm 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
Thanks mate - I was having a bad day indeed. All good stuff. I wasn't planning to release this in flex, but the problems schools have downloading and running exe files forced the issue. They need a sample resource they can try easily online - hence my adaptation.

The problems I am having with my publication concern things that are supported in Flex (I read all the blurb first). It is just that some things appear to work either in Scripts or in Objects, but not both. Finding out how and where each particular function works is pretty painful.

For example, I have attached a test pub with 2 buttons. They both generate a random number between 1 and 5, the first in a script object, the second in a Random object. Both work in preview, but on publication to Flex only the second works. My scripts (which are functions in ScriptObjects) use this facility repeatedly. But things get difficult if every time I need a new number I have to exit the script. I can build a workaround, where I generate random numbers first then access them, but it will be a compromise solution. I have found similar issues with other functions. Is there something wrong with the way I am trying to use this, or is it just a bug?

Thanks again for your time.
Dan


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

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


For this message dan1 has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 24th, 2009, 7:23 am 
Offline

Joined: November 5th, 2004, 6:54 am
Posts: 130
Location: Hengelo, The Netherlands
Opus: 8.5/9.0
OS: Windows 7 64-bits, Android 2.1, Android 4.1.2, iOS 7
System: Pentium 7i, 6GB RAM, 750GB HD, DVD-RW (+/-), DV, 3TB EHD, 3D monitor without glasses
Hi Dan,

I also spent a lot of time to resolve this in script.
But I found a solution.

Replace your script
Code:
Random1 = String.random(5) + 1;


with
Code:
var RandomNum = Math.ceil(Math.random()*5);
Random1 = String(RandomNum);

Explanation:
Math.random() gives randoms between 0 and 1.
Multiply it with 5 to get randoms between 0 and 5.
Math.ceil() rounded the value of a number up to the nearest integer.
The result is 1, 2, 3, 4 or 5
Use Math.floor() to get random numbers with 0 (multiplying with 5 returns 0, 1, 2, 3 or 4).

I hope this helps.

_________________
Oscar Nijst
ON Education & Consultancy
Hengelo, The Netherlands
OPUS Pro 9.5
Pentium 7i, 16GB RAM, 1 TB HD, DVD-RW (+/-), DV, 3TB EHD, 3D monitor without glasses


For this message osni has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 24th, 2009, 7:51 am 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
Thanks Oscar - I really appreciate you looking at that.

The hole I fell into was that in the list of supported script functions, the link takes you to Random with an example using String.random, which doesn't actually work. You have tried Math.random, which is not listed and does work. I think a more comprehensive and accurate list of Flex limitations would be really helpful (and I'll probably be able to write it by the time I have got through all these issues).

I've spent today on a really weird problem. Somehow variables are being forgotten when they are used in functions (only in flex). When I copy the page to a test pub they work fine. Anyway, I'll post it if I can find out what is going on. My head hurts.

Thanks again
Dan

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


For this message dan1 has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 24th, 2009, 9:30 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Dan,

Math.random is included in the flex help as is String.random. The latter as you point should does not work but as it's not even an ECMA function - I'm not surprised it doesn't work.

It's useful to remember that you can split the functions into two types.

Host functions work on objects built into Opus (text boxes) and are unique to Opus.

Native functions are based on the ECMA language and most up to 1.2 should be standard across that family of languages.

You're last post implies that you are switching between testing in Flex and the Opus preview mode. Don't! The preview mode will not limit the actions to flex but execute all Opus functionality and cannot be trusted to create a working flex file.

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:
PostPosted: November 24th, 2009, 11:08 am 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
Thanks Mack

The beauty of an application like Opus is that you can build fairly complex publications without worrying about anything referred to by an acronym :) And I'm afraid since first fighting with JavaScript 10 years ago I have held a general dislike for any language which demands endless use of multiple squiggly brackets {{ which I presume are the languages you are talking about }}. Anyway, I will endeavour to increase by knowledge beyond the bare minimum before launching into further Flex adaptations. I appreciate I have gone about this backwards, but it was an unforseen need.

re. testing... I have only been using Opus preview after making a lot of changes to a page (rather than publishing the whole thing and navigating to the problem area). I have been cleaning up basic errors using this before checking in Flex for compatibility issues. The variable problem I mentioned appears to be erratic. Something very odd indeed is going on. More fun to be had there :(

Much appreciated.
Dan

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


For this message dan1 has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 24th, 2009, 3:25 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Watched an interesting program the other week - explaining that even the great bard himself loved his acronyms. Never really thought of them having history, but then I suppose every generation thinks they invent these language elements.

IMHO, I'd rather have too many acronyms than have to deal with the synonym lingo. When great things become wicked, I know it's time to revert to the homely logic of the old squiggly.

If you can post an example of this erratic behaviour, I'm sure somebody will take a peek.

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:
PostPosted: November 24th, 2009, 7:28 pm 
Offline

Joined: May 24th, 2007, 11:02 am
Posts: 132
Location: UK - Wales - Ceredigion
Opus: illuminatus > Evolution
OS: Windows 10 Pro
System: i7 8GB RAM
I have also experienced problems like this.

The bug that I often come across is how opus calculates the center point of an object. Flash seems work it out differently, and I often have to make adjustments to the script to make it look right in flash.

It would be good if we could select the center point of an object in opus like you can in flash (e.g. top left, top right, bottom right etc.) This would really help me.


For this message jezjones29 has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 24th, 2009, 7:43 pm 
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
Quote:
It would be good if we could select the center point of an object in opus like you can in flash (e.g. top left, top right, bottom right etc.) This would really help me.

That 'wish' probably will not be detected here by DW.

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


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 25th, 2009, 12:02 am 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
IDK Mack, ISTM SSEWBA, STS. IWBN 2 CUWTA but I’m SOT.
I NMed VB, BTW (or SQL & BBC WWOTS) but I’m NTM enamoured with ECMA.
ISSYGTI
DAN (Dynamic And Nebulous)

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


For this message dan1 has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 25th, 2009, 1:27 am 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
Phew - sorted the variable problem in Flex. This seems like one of those issues that is so peculiar that I'm not sure if this will help anyone, but will describe it just in case (many hours to solve, a couple of minutes to post).

Problem:
A calculation in a function within a ScriptObject produced a value of zero when it should have been more like 100. The Script was accessed by other pages and worked well. The problem was in one page only.

Testing:
- Isolated the variables to no avail.
- Copied the page into a test pub and it worked fine.
- Deleted pages from my main pub and republished repeatedly until it worked again.
- Investigated the offending page.

Solution:
One particular page that was accessing the ScriptObject was stuffing up one, and only one, other page. I've no idea why. I had to make a copy of the Script file and import it into one of the pages for them to both work. This slightly defeats the object of using external scripts, but 2 copies is better than 10. (BTW - deleting and re-importing the same script file reintroduced the problem).

Note, this problem was apparent only when publishing to Flex. Everything worked well in Opus.

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


For this message dan1 has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 25th, 2009, 1:54 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
Quote:
One particular page that was accessing the ScriptObject was stuffing up one, and only one, other page.

????

One possibility (albeit remote) is that some object shares a name with a variable (or, looks closely the same depending on how spaces are converted).

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


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 25th, 2009, 2:08 am 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
I thought about that, but I don't think it would have been solved by making an exact copy of the script file. I didn't change anything; just copied and imported it.

I'm unlikely to investigate this one too much more. Sometimes you have to draw a line and move on :)

Thanks for your thunk.
Cheers
Dan

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


For this message dan1 has been thanked by : mackavi


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

All times are UTC [ DST ]


Who is online

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