Hi,

Below I have attached some simple code... The purpose with the code is to
(at runtime) be able to attach a behavior to a puppeted sprite containing a
flash member. The code works as long as I do not use the 'pSpriteRef'
variable and say instead type '2' or '3' (in the exitFrame handler in the
BEHAVIOR CODE below)... Unfortunately this will not work for me because this
behavior will be attached to more than one sprite (and the purpose of using
a behavior would be lost if I need to hardcode object references)... The
error message complains about the #hitTest which to me sounds like it does
not recognize the sprite as a flash sprite.

Anyone? Suggestions?

//Kristian


-- PART OF MOVIE SCRIPT CODE
puppetSprite 2, TRUE
sprite(2).member = puppetName
sprite(2).width = 220
sprite(2).height = 491
sprite(2).locH = 5
sprite(2).locV = 76
if member(puppetName).loaded = TRUE then
        flaSetActiveSubItem(gAMemList.aSubMain,gAMemList.aSubSub,
AMemList.aCastPage)
end if
xCursor = (script "flaCursorScript").new(2)
sprite(2).scriptInstanceList.Add(xCursor)


-- BEHAVIOR CODE
property spriteNum, pSpriteRef

on beginSprite me
        pSpriteRef = me.spriteNum
end

on exitframe me
        if sprite(pSpriteRef).hitTest(the mouseLoc) = #button then
                if sprite(pSpriteRef).cursor <> 280 then
                        sprite(pSpriteRef).cursor = 280
                end if
        else
                if sprite(pSpriteRef).cursor <> -1 then
                        sprite(pSpriteRef).cursor = -1
                end if
        end if
end


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

Reply via email to