Tue 15 Jan 2008 10:45:00 AM UTC, comment #13:
Committed.
|
Tue 15 Jan 2008 09:59:03 AM UTC, comment #12:
mc["$foo"] = "OK"; // printed, not sent
mc["fo$o"] = "OK";
mc["foo$"] = "OK";
mc["%foo"] = "OK";
mc["fo%o"] = "OK";
mc["foo%"] = "OK";
mc["&foo"] = "OK";
mc["fo&o"] = "OK";
mc["foo&"] = "OK";
mc["(foo"] = "OK";
mc["fo(o"] = "OK";
mc["foo("] = "OK";
mc["§foo"] = "OK";
mc["fo§o"] = "OK";
mc["foo§"] = "OK";
mc["'foo"] = "OK";
mc["fo'o"] = "OK";
mc["foo'"] = "OK";
mc["/foo"] = "OK";
mc["fo/o"] = "OK";
mc["foo/"] = "OK";
mc["\\foo"] = "OK";
mc["fo\\o"] = "OK";
mc["foo\\"] = "OK";
mc["!foo"] = "OK";
mc["fo!o"] = "OK";
mc["foo!"] = "OK";
mc[".foo"] = "OK";
mc["fo.o"] = "OK";
mc["foo."] = "OK";
mc[":foo"] = "OK";
mc["fo:o"] = "OK";
mc["foo:"] = "OK";
// all others: printed and sent
So yes, probably dollar at beginning is always skipped.
|
Tue 15 Jan 2008 09:45:39 AM UTC, comment #11:
I guess skipping everything starting with a dollar would do for
now. A last test would be testing other starting characters, like number, underscore, dash, slash, backslash, at....
you can use the _root['@name'] syntax to avoid syntax errors..
|
Tue 15 Jan 2008 09:43:18 AM UTC, comment #10:
Not confirmed.
var mc = this.createEmptyMovieClip("mc", 100);
mc.foo="bar";
mc.key="value";
mc.tricky="this is a value with some spaces and & ampersands....";
mc.$dollarfirst = "accepted";
mc.dollar$middle = "accepted";
mc.dollarlast$ = "accepted";
mc.$version = "foobar";
for(var key in mc)
trace(key+"="+mc[key]);
/*
PRINTS:
$version=foobar
dollarlast$=accepted
dollar$middle=accepted
$dollarfirst=accepted
tricky=this is a value with some spaces and & ampersands....
key=value
foo=bar
*/
mc.loadVariables("http://10.1.1.1/formtest.php", "Post");
/*
SENDS:
array(5) {
["foo"]=>
string(3) "bar"
["key"]=>
string(5) "value"
["tricky"]=>
string(53) "this is a value with some spaces and & ampersands...."
["dollar$middle"]=>
string(8) "accepted"
["dollarlast$"]=>
string(8) "accepted"
}
*/
ie. variables with dollar sign at the beginning of the name are not being sent
|
Tue 15 Jan 2008 09:32:57 AM UTC, comment #9:
> Could be that variable names with special chars are stripped for security reasons, too.
Could you test the above statement ?
Name a variable with the dollar sign in the middle,
or other unsafe characters ?
Make sure the variable assignment worked fine always.
|
Tue 15 Jan 2008 09:24:31 AM UTC, comment #8:
mc.$dollarvar = "accepted";
mc.$version = "foobar";
Both variables are printed with { for (key in mc) } but none of them is posted via loadVars (tested GET and POST).
Could be that variable names with special chars are stripped for security reasons, too.
|
Tue 15 Jan 2008 08:59:17 AM UTC, comment #7:
I belive I removed the $version skip, sending everything is enumerable. That should have reintroduced sending $version.
Could you try defining a parameter starting with the dollar
sign, and also overriding $version and see if those are
sent ?
|
Tue 15 Jan 2008 08:42:16 AM UTC, comment #6:
Looks good, thanks.
However, even though Adobe has a _root.$version, it does not send it with loadVariables().
//--------
var mc = this.createEmptyMovieClip("mc", 100);
mc.foo="bar";
mc.key="value";
mc.tricky="this is a value with some spaces and & ampersands....";
for(var key in mc)
trace(key+"="+mc[key]);
trace("TEST: mc.$version="+mc.$version); // empty string
trace("TEST: _root.$version="+_root.$version); // WIN 8,0,22,0
_root.loadVariables("http://10.1.1.1/formtest.php", "Get");
//--------
Posted vars (proprietary player):
array(2) {
["mc"]=>
string(10) "_level0.mc"
["key"]=>
string(3) "foo"
}
PS: I think we can remove that "TESTING" message now...
|
Mon 14 Jan 2008 08:09:20 PM UTC, comment #5:
There was good test coverage in swfdec testsuite.
Committed a fix for this.
Please let me know if it fixes your case.
|
Sat 12 Jan 2008 08:01:18 PM UTC, comment #4:
About being only defined for _root, could you try adding
test for it in misc-mtasc.all/levelxx.as
and to misc-ming.all/DragDropTest.as ?
Both testcases load stuff. levelxx.as onlhy load in levels,
DragDropTest.as load both in a _level and in a child movieclip.
Every load is on itself a kind of "root" (would be _root
if loaded directly). The question is: do these "loaded"
movie contain a $version member ?
If so, do a function defined in an SWF4 called by code
defined in an SWF5 that loads the SWF4 one get access to a $version
trought the call stack, and which one ?
|
Sat 12 Jan 2008 03:43:10 PM UTC, comment #3:
BTW, I tried to filter user members ("foo") from standard properties ("_alpha") using getOwnProperty() but it returns always a valid pointer.
if (getOwnProperty(VM::get().getStringTable().find(name))) continue;
|
Sat 12 Jan 2008 03:39:08 PM UTC, comment #2:
But $version does not even exist in the proprietary player:
var mc = this.createEmptyMovieClip("mc", 100);
trace(mc+".$version = ["+(mc.$version)+"]");
//prints: _level0.mc.$version = [undefined]
That property seems to exist in _root only.
|
Sat 12 Jan 2008 03:14:47 PM UTC, comment #1:
enumerating or not is a property flag.
Whether or not $version is a property can be
checked using hasOwnProperty('$version')
Also, there are some variables that are members
but return false by hasOwnProperty. we call them
non-proper properties.
Most of the time it is possible to figure out
what object contains the member using hasOwnProperty.
Like Object.prototype ? _global ?
|
Sat 12 Jan 2008 10:54:45 AM UTC, original submission:
The following code prints a "$version" variable, while Adobe Flash does not (and apparently doesn't know about a "$version" member).
var mc = this.createEmptyMovieClip("mc", 100);
mc.foo="bar";
mc.key="value";
for(var key in mc)
trace(key+"="+mc[key]);
Gnash output:
TRACE: foo=bar
TRACE: $version=LNX 8,0,99,0
TRACE: key=value
|