Arguments for BlendActions

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

Post Reply
User avatar
mkelley
Posts: 1646
Joined: Fri Nov 02, 2007 5:29 pm
Location: Sunny Florida
Contact:

Arguments for BlendActions

Post by mkelley » Wed Aug 26, 2015 1:15 am

While I was able to use BlendActions just fine in AS 9 obviously a lot has changed and this now does NOT work (in 11 but I'm guessing it also won't work in 10):

local percentMorph = ((holder - 50) * 2)/100
local stringHolder = LM.String:new_local()
stringHolder:Set('Expression')
layer:BlendActions(moho.frame,true,1,stringHolder, {percentMorph})

Keeps telling me I am supplying a string for the fifth argument instead of a table. (Note: I tried it without the curly brackets just in case but it USED to work with them and now doesn't work either way). So obviously things have changed and before I bother Mike (again -- sigh) can anyone here give me a clue?
User avatar
mkelley
Posts: 1646
Joined: Fri Nov 02, 2007 5:29 pm
Location: Sunny Florida
Contact:

Re: Arguments for BlendActions

Post by mkelley » Wed Aug 26, 2015 12:46 pm

Ah, nevermind. With the help of Wes and Paul on our own forum, I got it figured out:

local stringHolder = LM.String:new_local()
stringHolder:Set('Expression')
local percentMorph = {}
local names = {}
names[1] = stringHolder
percentMorph[1] = ((holder - 50) * 2)/100
layer:BlendActions(moho.frame,true,1,names, percentMorph)

Most likely due to loose typing no longer being available in this version of Lua (this old man left programming back when that practice was the norm -- things were SO much easier then :>)
Post Reply