This content has been marked as final. Show 2 replies
> On MouseDown
> fio = xtra("FileIO").new()
> file = fio.displayOpen()
> fio = void
> newMember = new(#windowsmedia)
> newMember.fileName = file
> sprite(3).member = newMember
> newMember.duplicate(52, "media")
Works for me - except for the member duplication. As suggested in the
other forum you posted to, it would be better *not* to use key words as
variable names (like 'file' and 'newMember').
It's not clear why you create a new member in castLib(1) and link it to
sprite(3) only to then duplicate it to a different castLib. Why don't
you start with a #windowsMedia member in slot 52 of castLib("media") and
simply change its filename property?
on mouseDown me
tMember = member(52, "media")
if tMember.type = #empty then
tMember = _movie.newMember(#windowsMedia, tMember)
-- tMember.name = "WMV"
fio = xtra("FileIO").new()
tFile = fio.displayOpen()
fio = VOID
tMember.fileName = tFile
sprite(3).member = tMember
Strange that the member duplication doesn't work for you as it does for me but I'm using director 11 so that could be the reason.
As for using keywords, well, as I'm almost completely new to lingo scripts myself it was a code that I found and used to import graphics into the cast during run-time.
I tried adjusting the script to import the graphics directly into a external cast member but I couldn't get it to (looks away embarrassed). Hence the duplication part of the script.
Anyway, many many thanks for explaning and even providing a sample code. It works exactly as what I tryed to program.