-
Hi guys,
is there a way how I can change a function's
function.
When I call the getURL(), flash should not open
the URL, it should set a Variable to a value.
i.e.
getURL("Hello World");
current ---> open Browser with the document Hello World (wrong)
should ---> set variable "foo" to "Hello World" (thats what I need)
Maybe with some OOP, but I don't no how.
-
Senior Member
You can do that directly with
but if you're dying to get a function, you can write a function like this one that's for level0
Code:
function changeValue (variable, value) {
this[variable] = value;
}
changeValue ("foo", "value")/
Now that you mentioned it, why in lots of books about Perl they use "foo" and "bar" and such? I never knew...
-
Thanks,
but no, no, no not it's not that easy way
What I mean is to override the getURL function.
When I add getURL("Hello World") to a button
it should not open a window, it should set a
variable to "Hello World". So the normal function
(open a browser doc) of getURL is no longer available.
U understand me?
-
Senior Member
I did before, but don't see why.
-
Again.
I don't need a simple function like
function changeValue (variable, value) {
this[variable] = value;
}
changeValue ("foo", "value")/
I would disable the getURL function of
flash.
Why? Ok I try to say it short:
I got an engine (swf file) where other
people can add their swf animations, but
they are not allowed to set links (use getURL)
in it.
You understand what I mean?
-
What's up guys?
Is the nut to hard for you
-
Senior Member
Well, I wish you good luck. I'd never know how to do that. I've never needed...
-
hmmm. I thought it would be possible with prototyping, but not quite. adding something like this:
MovieClip.prototype.getURL = function (param) { trace (param); };
works, but only if you call getURL like so:
this.getURL();
Unfortunately, there is never any need to do that, so I wouldn't expect any of your users to code their buttons like that.
Special thanks to Phillip Kerman for his input!
Psx
-
Thanks, psychlonex.
That was the way I tried but it won't work.
Isn't a realy flashguru out there?
-
Ok I see,
nobody knows it.
Let's try it this way:
Can I execute a function in Flash using GETURL?
Maybe like asfunction in HTMLinFLASH. I know
FSCOMMANDS are a way, anything else?
-
Hi AlanSutter,
there is no way in actionscript. While "this.geturl" could probably be trapped, the plain geturl function is present in the swf as an alementary opcode (like "+" or "=" functions)
You could, however, have a script on the server that checks the uploaded file and rejects it if there is any geturl inside.
A potential problem: there may be legitimate uses for loadmovie from an outside server, but if you allow that, you will have to scrutinize those movies as well.
Musicman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|