From: jumpOnCommand on
I'm completely new to Director, but fairly fluent in Flash Actionscripting,
which as I've found, it quite different.

I've been playing about with ebooks, online tutorials and this forum trying to
construct something, but to no avail. I would like to open a simple file. test
e.g.

function mouseUp(me) {
button1.openFile("C:/autorun.inf", 1)
}

when I run the script, I get an error saying "button1 is not defined ".

Help would be greatly appreciated.

jumpOnCommand

From: Rob Dillon - Adobe Community Expert on
A function like you have written would normally be in a behavior script
window. That behavior would then be attached to a sprite, your button,
for instance.

You don't say how button1 is defined. If its a named sprite that holds
this behavior then you don't need the reference. Me refers to the sprite
that holds the behavior. Me is in most respects, very similar to "this"
in actionscript.

If button1 is the name of a sprite other than the sprite that holds the
behavior, then you would refer to it like this:

sprite("button1").

In any case, the name of a sprite is a string. If you don't name the
sprite then its channel number is a number.

If button1 is a cast member's name, then you don't normally refer to the
member name in that way.

OpenFile() is a fileIO xtra function. You need to create an instance of
the xtra before you can call it's functions. If button1 is the name of
the xtra's instance, then it may be out of scope. In order for it work
in your example, button1 would have to be a global or property variable.

--
Rob
_______
Rob Dillon
Adobe Community Expert
http://www.ddg-designs.com
412-243-9119

http://www.macromedia.com/software/trial/
From: jumpOnCommand on
wow... I understood not a single thing of what you just said. Director really
is quite difficult.

While I'm still pottering about Director trying to find this green wrinkley
sprite everyones talking about, would you mind either pointing me, or write me
a quick example of how I would open an *.exe file? I believe its something like
this:

_player.open("C:/notepad.exe")

Thank you for your help

jumpInCommand

From: Mike Blaustein on
Assuming that notepad is indeed in the root of your C:\ drive (which it
is normally not), you would do this (you had it real close, but had the
wrong slash):

_player.open("C:\notepad.exe")
From: jumpOnCommand on
Sorry to sound simple, but where exactly was it I actually put this? I slowly
getting my head around this sprite - behaviour system, but somehow I'm going
wrong. I think I'm trying to use it like Flash.

In Flash I used to write all my script in that _root. But in Director I can't
find it. :)

Could someone start my from a blank movie where this bit goes, please

Thanks Mike.