|
List Info
Thread: Sprite(-5) stealing the show
|
|
| <lingo-l> Sprite(-5) stealing the
show |

|
2006-02-24 13:37:42 |
Hi Kraig and Irv...
I'm laughing at your responses! I guess I wasn't clear.
Irv...you pretty much answered my question. I have this
utility
behavior (see below) that I use in many of my projects.
This project's
score is only three frames long. On frame two, I swapped my
utility
script to the more efficient:
on enterFrame
_movie.go(_movie.frame)
end
Next, a movie clip in a flash sprite has
this.onRelease = function(){
getURL("lingo:parentScript.lingoMethod()");
}
So, the messaging event ("bubble") gets to the
parent method, starts
doing it, and it never gets through all five lines of that
method before
the debugger flips over to the frame script. I have no idea
why. I
wrote a workaround for it, so I've essentially solved the
issue, or
rather, I've just masked the symptom. It works now, but I
haven't
figured out why not all the lines of code are executed
before the event
bubbles up to sprite(-5). For what it's worth, it seems
more often than
not that the flow of code leaves the parent method at the
following line
(but not necessarily always):
channel(6).makeScriptedSprite(member("video.mpg"
)),point(499, 257))
Thanks for the responses,
- Michael M.
-- do something simple
property pHandler
property pDoWhat
on beginSprite(me)
if pHandler = "beginSprite" then
do(pDoWhat)
end if
end
on mouseUp(me)
if(me.spriteNum = -5) then
pass
end if
if pHandler = "mouseUp" then
do(pDoWhat)
end if
end
on mouseDown(me)
if pHandler = "mouseDown" then
do(pDoWhat)
end if
end
on mouseEnter(me)
if pHandler = "mouseEnter" then
do(pDoWhat)
end if
end
on mouseLeave(me)
if pHandler = "mouseLeave" then
do(pDoWhat)
end if
end
on mouseUpOutside(me)
if pHandler = "mouseUpOutside" then
do(pDoWhat)
end if
end
on mouseWithin(me)
if pHandler = "mouseWithin" then
do(pDoWhat)
end if
end
on rightMouseDown(me)
if pHandler = "rightMouseDown" then
do(pDoWhat)
end if
end
on rightMouseUp(me)
if pHandler = "rightMouseUp" then
do(pDoWhat)
end if
end
on endSprite(me)
if pHandler = "endSprite" then
do(pDoWhat)
end if
end
on exitFrame(me)
if pHandler = "exitFrame" then
do(pDoWhat)
end if
end
on getPropertyDescriptionList
theList = [:]
listy = [:]
listy.addProp(#comment, "On which mouse event does
the line of code
work?")
listy.addProp(#format, #string)
listy.addProp(#default, #void)
listy.addProp(#range,
["mouseUp","mouseDown","mouseE
nter",
"mouseLeave","mouseUpOutside",
"mouseWithin","rightMouseDown",&quo
t;rightMouseUp","beginSprite","endSp
rite",
"exitFrame"])
theList.addProp(#pHandler, listy)
listy = [:]
listy.addProp(#comment, "What is the line of
code?")
listy.addProp(#format, #string)
listy.addProp(#default, #void)
theList.addProp(#pDoWhat, listy)
return theList
end
[To remove yourself from this list, or to change to digest
mode, go to http://www.penwor
ks.com/lingo-l.cgi To post messages to the list, email
lingo-l penworks.com (Problems, email owner-lingo penworks.com). Lingo-L is for learning and helping
with programming Lingo. Thanks!]
|
|
| <lingo-l> Sprite(-5) stealing the
show |

|
2006-02-24 18:41:18 |
I'll bet that the problem is in the single line that you
showed us:
channel(6).makeScriptedSprite(member("video.mpg"
)),point(499, 257))
The syntax for makeScriptedSprite is:
spriteChannelObjRef.makeScriptedSprite(memberObjRef, loc)
So, try replacing your line with:
sprite(6).makeScriptedSprite(member("video.mpg")
),point(499, 257))
The word "channel" refers to a sound channel, so
I'm guessing that
your code is trying to go into sound channel 6 and trying to
make it
a scripted sprite - which fails miserably.
If that does't do it, show us the 5 lines of code in the
handler in
the parent script.
Irv
At 8:37 AM -0500 2/24/06, Mendelsohn, Michael wrote:
>Hi Kraig and Irv...
>
>I'm laughing at your responses! I guess I wasn't
clear.
>
>Irv...you pretty much answered my question. I have this
utility
>behavior (see below) that I use in many of my projects.
This project's
>score is only three frames long. On frame two, I
swapped my utility
>script to the more efficient:
>
>on enterFrame
> _movie.go(_movie.frame)
>end
>
>Next, a movie clip in a flash sprite has
>this.onRelease = function(){
> getURL("lingo:parentScript.lingoMethod()");
>}
>
>So, the messaging event ("bubble") gets to
the parent method, starts
>doing it, and it never gets through all five lines of
that method before
>the debugger flips over to the frame script. I have no
idea why. I
>wrote a workaround for it, so I've essentially solved
the issue, or
>rather, I've just masked the symptom. It works now,
but I haven't
>figured out why not all the lines of code are executed
before the event
>bubbles up to sprite(-5). For what it's worth, it
seems more often than
>not that the flow of code leaves the parent method at
the following line
>(but not necessarily always):
>
>channel(6).makeScriptedSprite(member("video.mpg&q
uot;)),point(499, 257))
>
>
>Thanks for the responses,
>- Michael M.
>
>
>
>
>-- do something simple
>
>property pHandler
>property pDoWhat
>
>on beginSprite(me)
> if pHandler = "beginSprite" then
> do(pDoWhat)
> end if
>end
>
>on mouseUp(me)
> if(me.spriteNum = -5) then
> pass
> end if
> if pHandler = "mouseUp" then
> do(pDoWhat)
> end if
>end
>
>on mouseDown(me)
> if pHandler = "mouseDown" then
> do(pDoWhat)
> end if
>end
>
>on mouseEnter(me)
> if pHandler = "mouseEnter" then
> do(pDoWhat)
> end if
>end
>
>on mouseLeave(me)
> if pHandler = "mouseLeave" then
> do(pDoWhat)
> end if
>end
>
>on mouseUpOutside(me)
> if pHandler = "mouseUpOutside" then
> do(pDoWhat)
> end if
>end
>
>on mouseWithin(me)
> if pHandler = "mouseWithin" then
> do(pDoWhat)
> end if
>end
>
>on rightMouseDown(me)
> if pHandler = "rightMouseDown" then
> do(pDoWhat)
> end if
>end
>
>on rightMouseUp(me)
> if pHandler = "rightMouseUp" then
> do(pDoWhat)
> end if
>end
>
>on endSprite(me)
> if pHandler = "endSprite" then
> do(pDoWhat)
> end if
>end
>
>on exitFrame(me)
> if pHandler = "exitFrame" then
> do(pDoWhat)
> end if
>end
>
>on getPropertyDescriptionList
> theList = [:]
> listy = [:]
> listy.addProp(#comment, "On which mouse event
does the line of code
>work?")
> listy.addProp(#format, #string)
> listy.addProp(#default, #void)
> listy.addProp(#range,
["mouseUp","mouseDown","mouseE
nter",
>"mouseLeave","mouseUpOutside",
>"mouseWithin","rightMouseDown",
"rightMouseUp","beginSprite","e
ndSprite",
>"exitFrame"])
> theList.addProp(#pHandler, listy)
> listy = [:]
> listy.addProp(#comment, "What is the line of
code?")
> listy.addProp(#format, #string)
> listy.addProp(#default, #void)
> theList.addProp(#pDoWhat, listy)
> return theList
>end
>
>
>[To remove yourself from this list, or to change to
digest mode, go
>to http://www.penwor
ks.com/lingo-l.cgi To post messages to the
>list, email lingo-l penworks.com (Problems, email
>owner-lingo penworks.com). Lingo-L is for learning and
helping with
>programming Lingo. Thanks!]
--
Multimedia Wrangler.
[To remove yourself from this list, or to change to digest
mode, go to http://www.penwor
ks.com/lingo-l.cgi To post messages to the list, email
lingo-l penworks.com (Problems, email owner-lingo penworks.com). Lingo-L is for learning and helping
with programming Lingo. Thanks!]
|
|
[1-2]
|
|