Dynamic hotspots in loop and array
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2016-03-24 01:18 PM
2016-03-24
01:18 PM
I need small help in coding. I'm not very good in it so sorry if the question is rather simple.
I need to make lines witch are drawn by a loop "FOR 1 TO 5" where each line lenght can be controled
I managed to make it work so all hotspots show but each of the hostposts control line length of ALL the lines.... but thats not the goal.
hsid=101 FOR p=1 TO 5 HOTSPOT2 0, 0, hsid, lenght, 1+128 : hsid=hsid+1 HOTSPOT2 0, lenght, hsid, lenght, 2 : hsid=hsid+1 HOTSPOT2 0, -1, hsid, lenght, 3 : hsid=hsid+1 line2 0,0,0,lenght add2 3, 0 NEXT pI suppose I need to make some sort of an array where each "lenght" is different but its seems to be in conflict with the "FOR TO" Loop.
This does not work:
DIM lenght[] hsid=101 FOR p=1 TO 5 HOTSPOT2 0, 0, hsid, lenghtAny ideas how to get hotspots work seperately in a loop ?, 1+128 : hsid=hsid+1 HOTSPOT2 0, lenght
, hsid, lenght
, 2 : hsid=hsid+1 HOTSPOT2 0, -1, hsid, lenght
, 3 : hsid=hsid+1 line2 0,0,0,lenght
add2 3, 0 NEXT p
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2016-03-24 02:20 PM
2016-03-24
02:20 PM
Take a look at the 2D script for my framing object. It does exactly this. There is a loop statement in the body of the script with the hotspot controls set in a subroutine.
Erich
AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2016-03-24 03:19 PM
2016-03-24
03:19 PM
Erich, thank so much !
It works !
BTW Nice object, thumbs up.
It works !

BTW Nice object, thumbs up.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2016-03-24 03:24 PM
2016-03-24
03:24 PM
This is how its done:
hsid=hsid+1 i=1 FOR p=1 TO 5 GOSUB 100 !!!Hotspots line2 0,0,0,lenght add2 3, 0 i=i+1 NEXT p END 100: !!!Hotspots HOTSPOT2 0, 0, hsid, lenght, 1+128 : hsid=hsid+1 HOTSPOT2 0, lenght, hsid, lenght, 2 : hsid=hsid+1 HOTSPOT2 0, -1, hsid, lenght, 3 : hsid=hsid+1 RETURNThe key is that the "lenght" parameter requires in the "parameters" a "array values" in a column:

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2016-03-25 04:29 AM
2016-03-25
04:29 AM
philips wrote:Thanks. It has it's uses.
Erich, thank so much !
It works !
BTW Nice object, thumbs up.
Erich
AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K