Re: Behavior Nightmare

2010-02-14 Thread Scott Rossi
Recently, Josh Mellicker wrote:

> On Feb 13, 2010, at 1:21 PM, Scott Rossi wrote:
> 
>> The reason for all the jumping through hoops here is password protection: I
>> need to be able to dynamically add and remove groups from the main stack,
>> and this can't happen if the stack is password protected.
> 
> Doesn't setting the passkey of the stack allow you to add, delete, copy
> groups, etc.?

One of the main benefits of behaviors, from the docs:

"The button containing the behavior script can be located anywhere. In
particular this allows for it be located in a password protected stack,
allowing you to protect the script without need to protect the controls
using it."

It would seem using behaviors is more secure than temporarily removing
security from a stack.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Behavior Nightmare

2010-02-14 Thread Scott Rossi
Recently, Sivakatirswami wrote:

> Now, I'm not sure what you mean by "card-level behaviors falling thru to
> stack-level behaviors" but  from one point of view it makes sense that
> the behavior cannot be found, because the button that contains the
> behavior is not really in the message path as we normally understand the
> message path.  In fact, I could have sworn that the nature of behaviors
> not being in the message path was part of their "charm" so to speak...
> i.e. you would deliberaty keep certain handlers segregated from the msg
> path by having them be behaviors.

The following works on my end and appears to operate counter to what you
say.

- Create new stack "maintest".

- Create substack of maintest named "subtest".

- Create a button in stack subtest named "b1".  Script:
 on mouseUp
   answer theMsg()
 end mouseUp

- Create another button in stack subtest named "b2".  Script:
 function theMsg
   return "abc 123"
 end theMsg

- Go back to stack maintest.  Set the behavior of the current card to long
id of btn b1; set the behavior of stack maintest itself to long id of btn
b2.

Click the card in the main stack.  You should see the "abc 123" message
above.  Note the script will fail if you remove the behavior assigned to the
main stack or the card in the main stack.

If behaviors are indeed essentially object-level backscripts, then I think
it makes sense that object-level behaviors "fall through" to
card/stack-level behaviors -- this is consistent with card/stack scripts
handling any messages that go unhandled by objects.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Connecting Stack to Remote On-Rev MySQL Database

2010-02-14 Thread Sarah Reichelt
> I've been all through the archives, and found
> some hints that it is possible to connect to
> a remote MySQL database on On-Rev.
>
> Doe anyone have a clear step by step
> example of how this is done?


One way of doing it is to have an irev file actually do the connecting
and querying of the database, and POST the query data to the page.

Cheers,
Sarah
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Connecting Stack to Remote On-Rev MySQL Database

2010-02-14 Thread runrev260805
Rick,

first of all you have to enable Remote Access for your database. You can do 
that in cPanel ->Databases->RemoteDatabase Access Hosts. If the computer, which 
runs the stack, does not have a static internet ip, then you have to  enter 
%.%.%.% as ip-adress in Access Hosts. 

At http://samples.on-rev.com/database.irev you find a code example how to 
access an MySQL database. It is an irev example, but the sections  

#Open the database connection
#Construct the SQL Statement
#Close the database connection
can also be used in an stack.

Hth,

Matthias

 Original Message 
Subject: Connecting Stack to Remote On-Rev MySQL Database (14-Feb-2010 22:29)
From:Rick Harrison 
To:  runrev260...@m-r-d.de

> Hi there,
> 
> I've been all through the archives, and found
> some hints that it is possible to connect to
> a remote MySQL database on On-Rev.
> 
> Doe anyone have a clear step by step
> example of how this is done?
> 
> I don't have time to keep struggling with this
> problem.  I need a solution A.S.A.P.
> 
> Any help is greatly appreciated!
> 
> Thanks,
> 
> Rick 
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 
> 
> 
> To: use-revolution@lists.runrev.com


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Connecting Stack to Remote On-Rev MySQL Database

2010-02-14 Thread Rick Harrison
Hi there,

I've been all through the archives, and found
some hints that it is possible to connect to
a remote MySQL database on On-Rev.

Doe anyone have a clear step by step
example of how this is done?

I don't have time to keep struggling with this
problem.  I need a solution A.S.A.P.

Any help is greatly appreciated!

Thanks,

Rick 
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: making a thumbnail from a snapshot

2010-02-14 Thread Mark Schonewille

Hi Peter.

I use this function to create thumbnails:

function rescale theImgWidth,theImgHeight,theCdWidth,theCdHeight
  -- determine longest side and rescale
  if theCdWidth/theImgWidth < theCdHeight/theImgHeight then
put theCdWidth / theImgWidth into myRatio
  else
put theCdHeight / theImgHeight into myRatio
  end if
  put theImgWidth * myRatio into myNewWidth
  put theImgHeight * myRatio into myNewHeight
  return myNewWidth,myNewHeight
end rescale

Usually, I have a background object, e.g. a rectangular graphic, in  
which I want to fit a picture. I'd do this as follows.


lock screen
clone picture "Original"
set the name of it to "Thumb"
put rescale(the width of img "Thumb",the height of img "Thumb",the  
width of grc "Back",the height of grc "Back") into myNewDimensions

set the width of img "Thumb" to item 1 of myNewDimensions
set the height of img "Thumb" to item 2 of myNewDimensions
set the loc of img "Thumb" to the loc of grc "Back"
unlock screen

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer

Economy-x-Talk is always looking for new projects.

Op 14 feb 2010, om 00:03 heeft Peter Brigham MD het volgende geschreven:

I'm trying to make a thumbnail from a snapshot of an image from  
another substack. First I clone a group that contains a thumbnail  
image and a text field, then I reposition the new group, then I try  
to get a new thumbnail into the new group. Here's what I've tried  
(partial script):


  clone group "imgItem 1"
  set the name of it to newGpName
  --  newGpName is already constructed, it is "imgItem k" for some k
  --  now set location of new group
  set the top of group newGpName to 30
  set the left of group newGpName to the left of group "imgItem 1"
  --  store the new rect of the thumbnail, then delete it
  put the rect of img "mThumb" of group newGpName into thumbRect
  delete img "mThumb" of group newGpName
  --  import new image into cloned group (last group)
  start editing group newGpName
  import snapshot from image "mDisplay" of stack "dispStack"
  --  rename image
  set the name of last image to "mThumb"
  stop editing background newGpName
  --  resize image to thumbnail size and location
  set the rect of img "mThumb" of group newGpName to thumbRect

What I get is not a properly sized thumbnail -- I get an image that  
looks the size of the whole new (cloned) group, and it's not a  
miniature of the big image, it's a crop of the big image. I can't  
remember how to miniaturize an imported snapshot down to thumbnail  
size. I know this has been discussed before but can't find it in the  
gmane archives. Any help appreciated.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Behavior Nightmare

2010-02-14 Thread Josh Mellicker

On Feb 13, 2010, at 1:21 PM, Scott Rossi wrote:

> The reason for all the jumping through hoops here is password protection: I
> need to be able to dynamically add and remove groups from the main stack,
> and this can't happen if the stack is password protected.

Doesn't setting the passkey of the stack allow you to add, delete, copy groups, 
etc.?___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: making a thumbnail from a snapshot

2010-02-14 Thread Ken Ray


> What I get is not a properly sized thumbnail -- I get an image that
> looks the size of the whole new (cloned) group, and it's not a
> miniature of the big image, it's a crop of the big image. I can't
> remember how to miniaturize an imported snapshot down to thumbnail
> size. I know this has been discussed before but can't find it in the
> gmane archives. Any help appreciated.

Here's a simple example of taking an existing image and making a 1/4 sized
thumbnail:

  export snapshot from img 1 to tPictData as PNG
  create image
  put it into tImg
  set the text of tImg to tPictData
  set the width of tImg to (the width of tImg/4)
  set the height of tImg to (the height of tImg/4)
  set the lockLoc of tImg to true
  set the imageData of tImg to the imageData of tImg

Hope this puts you on the right track...

Ken Ray
Sons of Thunder Software, Inc.
Email: k...@sonsothunder.com
Web Site: http://www.sonsothunder.com/


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: making a thumbnail from a snapshot

2010-02-14 Thread David Bovill
Just from memory - you need to set the rect of the image to the nuew
thumbnail size and let rev do the scaling for you... then you can get the
imagedata which returns the scaled image data and set the imagedata (ie set
the imagedata of image "thumbnai"l to the imagedata of image "thumbnail")

But looking at your script - I don;t think you need to do any of that - you
just need to:

put image "mDisplay" of stack "dispStack" into img "mThumb" of group
newGpName of stack ".

and make sure the thumbnail image has its location locked. Then you can:

set the imagedata of image "thumbnail" to the imagedata of image "thumbnail"

if you want to scale down the new image size.

On 13 February 2010 23:03, Peter Brigham MD  wrote:

> I'm trying to make a thumbnail from a snapshot of an image from another
> substack. First I clone a group that contains a thumbnail image and a text
> field, then I reposition the new group, then I try to get a new thumbnail
> into the new group. Here's what I've tried (partial script):
>
>   clone group "imgItem 1"
>   set the name of it to newGpName
>   --  newGpName is already constructed, it is "imgItem k" for some k
>   --  now set location of new group
>   set the top of group newGpName to 30
>   set the left of group newGpName to the left of group "imgItem 1"
>   --  store the new rect of the thumbnail, then delete it
>   put the rect of img "mThumb" of group newGpName into thumbRect
>   delete img "mThumb" of group newGpName
>   --  import new image into cloned group (last group)
>   start editing group newGpName
>   import snapshot from image "mDisplay" of stack "dispStack"
>   --  rename image
>   set the name of last image to "mThumb"
>   stop editing background newGpName
>   --  resize image to thumbnail size and location
>   set the rect of img "mThumb" of group newGpName to thumbRect
>
> What I get is not a properly sized thumbnail -- I get an image that looks
> the size of the whole new (cloned) group, and it's not a miniature of the
> big image, it's a crop of the big image. I can't remember how to miniaturize
> an imported snapshot down to thumbnail size. I know this has been discussed
> before but can't find it in the gmane archives. Any help appreciated.
>
> -- Peter
>
> Peter M. Brigham
> pmb...@gmail.com
> http://home.comcast.net/~pmbrig 
>
>
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: revXML... issue

2010-02-14 Thread Ken Ray
> For example:
> 
> 
> This is Џ a test
> 
> The above tree - upon being parsed - will convert Џ into 2 bytes instead
> of leaving it encoded. The result is a blob of text that's composed of both
> single-byte characters and double-byte characters. This is no good.
> 
> So, is there a way to get the XML parser in Rev to not touch the data in the
> tags and let me do it? Or better yet, how about making revXML adhere to the
> useUnicode global, so either all the returned data is single-byte or it's all
> double-byte?

Another alternative would be to use my XML Library - it's all Rev code and
it doesn't mess with your data. It's great for small-to-medium sized XML
docs (if it's big it can really slow down though).

If you're interested, take a look:

http://www.sonsothunder.com/products/xmllib/xmllib.htm


Ken Ray
Sons of Thunder Software, Inc.
Email: k...@sonsothunder.com
Web Site: http://www.sonsothunder.com/


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Feb 14th

2010-02-14 Thread René Micout
Boum ! J'ai le cœur qui fait boum !

Le 14 févr. 2010 à 08:54, Scott Rossi a écrit :

> Nice Malte.
> 
> Here's a solution that is nowhere near as elegant as Malte's code, but the
> result is perhaps a bit more "tactile"  :-)
> 
> on mouseUp
>   buildV
>   buildO -1
>   buildO 1
>   runAnim
> end mouseUp
> 
> command buildO M
>   put "style,opaque,linesize,backcolor," & \
>  "width,height,antialiased" into V1
>   put "oval,true,0,red,120,120,true" into V2
>   put 1 into N
>   repeat for each item P in V1
>  set the P of the templateGraphic to item N of V2;add 1 to N
>   end repeat
>   put loc of this cd into tLoc
>   add (M*46) to item 1 of tLoc
>   if M = -1 then add 1 to item 1 of tLoc
>   add -68 to item 2 of tLoc
>   set loc of the templateGraphic to tLoc
>   create grc
>   set fillGradient of last grc to gfx(long id of last grc)
>   reset the templateGraphic
> end buildO
> 
> command buildV
>   put "style,opaque,linesize,backcolor,width,height," & \
>  "antialiased,polysides,angle" into V1
>   put "regular,true,0,red,231,160,true,3,90" into V2
>   put 1 into N
>   repeat for each item P in V1
>  set the P of the templateGraphic to item N of V2;add 1 to N
>   end repeat
>   set loc of the templateGraphic to loc of this cd
>   create grc
>   set dropshadow of last grc to sfx()
>   reset the templateGraphic
> end buildV
> 
> function gfx pObj
>   put "type,from,via,to,quality,repeat,wrap,mirror" into V1
>   put "radial"&cr&"0,0"&cr&"0,0"&cr&"0,0"&cr&"good" & \
>  cr&1&cr&"false"&cr&"false" into V2
>   put 1 into N
>   repeat for each item P in V1
>  put line N of V2 into A[P];add 1 to N
>   end repeat
>   put -37 into M
>   put rect of pObj into R
>   put loc of pObj into L
>   put item 1 of L,item 2 of L + M into A["from"]
>   put item 3 of R,item 2 of L + M into A["via"]
>   put item 1 of L,item 4 of R + M into A["to"]
>   put 0,255,190,190&cr&1,255,0,0 into A["ramp"]
>   return A
> end gfx
> 
> function sfx
>   put "opacity,blendmode,size,distance,filter," & \
>  "knockout,spread,angle" into V1
>   put "255,normal,20,10,gaussian,true,0,90" into V2
>   put 1 into N
>   repeat for each item P in V1
>  put item N of V2 into A[P];add 1 to N
>   end repeat
>   put "0,0,0" into A["color"]
>   return A
> end sfx
> 
> on runAnim
>   put number of grcs into gNum
>   repeat with N = 0 to 1
>  set width of grc (gNum - N) to width of grc (gNum - N) + 10
>  set height of grc (gNum - N) to height of grc (gNum - N) + 10
>   end repeat
>   set bottom of grc (gNum - 2) to bottom of grc (gNum - 2) + 8
>   wait 300 millisecs with messages
>   repeat with N = 0 to 1
>  set width of grc (gNum - N) to width of grc (gNum - N) - 10
>  set height of grc (gNum - N) to height of grc (gNum - N) - 10
>   end repeat
>   set bottom of grc (gNum - 2) to bottom of grc (gNum - 2) - 8
>   send "runAnim" to me in 750 millisecs
> end runAnim
> 
> 
> 
> Happy V-Day,
> 
> Scott Rossi
> Creative Director
> Tactile Media, UX Design
> 
> 
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: revXML... issue

2010-02-14 Thread Colin Holgate
I haven't used xml in Rev, can you show enough lines of code to show the 
problem? I have an idea of a fix, but would like to try it out. Normally I 
would just figure it out in the help, but the help doesn't have the word 
"parse" in there at all, making it hard for me to see how XML parse works.

Maybe one day Rev could have E4X. You have no idea how easy life becomes then!


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: revXML... issue

2010-02-14 Thread Björnke von Gierke
theoretically that's utf8. did you try to do a conversion on the data returned 
by the xml external?


   return unidecode(uniencode(theText,"utf8"))


On 14 Feb 2010, at 15:56, Jeffrey Massung wrote:

> So, after days of trying to figure what my unicode bugs were, I've finally 
> figured out the problem: revXML (which I'm assuming is using Expat or similar 
> library) is attempting to translate encoded characters during tree parsing as 
> opposed to letting the application handle it later on.
> 
> For example:
> 
> 
> This is Џ a test
> 
> The above tree - upon being parsed - will convert Џ into 2 bytes 
> instead of leaving it encoded. The result is a blob of text that's composed 
> of both single-byte characters and double-byte characters. This is no good. 
> 
> So, is there a way to get the XML parser in Rev to not touch the data in the 
> tags and let me do it? Or better yet, how about making revXML adhere to the 
> useUnicode global, so either all the returned data is single-byte or it's all 
> double-byte?
> 
> Jeff M.


-- 

official ChatRev page:
http://bjoernke.com?target=chatrev

Chat with other RunRev developers:
go stack URL "http://bjoernke.com/chatrev/chatrev1.3b3.rev";

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


revXML... issue

2010-02-14 Thread Jeffrey Massung
So, after days of trying to figure what my unicode bugs were, I've finally 
figured out the problem: revXML (which I'm assuming is using Expat or similar 
library) is attempting to translate encoded characters during tree parsing as 
opposed to letting the application handle it later on.

For example:


This is Џ a test

The above tree - upon being parsed - will convert Џ into 2 bytes instead 
of leaving it encoded. The result is a blob of text that's composed of both 
single-byte characters and double-byte characters. This is no good. 

So, is there a way to get the XML parser in Rev to not touch the data in the 
tags and let me do it? Or better yet, how about making revXML adhere to the 
useUnicode global, so either all the returned data is single-byte or it's all 
double-byte?

Jeff M.___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Feb 14th

2010-02-14 Thread Klaus on-rev
Hi Scott,

Am 14.02.2010 um 08:54 schrieb Scott Rossi:
> Nice Malte.
> 
> Here's a solution that is nowhere near as elegant as Malte's code, but the
> result is perhaps a bit more "tactile"  :-)

Yep, a bit more "tactile" indeed! Oh my god!

I was so happy that I could calculate the "max scroll" of a loc-locked group 
yesterday,
but this is different galaxy to me :-D

Incredible and beautiful, thank you Scott!


Best from germany

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major.on-rev.com

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: Feb 14th

2010-02-14 Thread Jim Bufalini
Yours is math. Scott's is two balls and a triangle. Both of you guys are
equally amazing! I "love" it! Happy Valentine's Day.

Aloha from Hawaii,

Jim Bufalini


Malte wrote:
 
> Awesome Scott!
> 
> Jaque: Please don't think I could explain that math 
> 
> JB: Thank you!
> 
> Cheers,
> 
> Malte


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Feb 14th

2010-02-14 Thread Malte Pfaff-Brill
Awesome Scott!

Jaque: Please don't think I could explain that math 

JB: Thank you!

Cheers,

Malte
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution