If you are looking for the decompiler itself, visit https://github.com/jindrapetrik/jpexs-decompiler
NEW : We have got a new blog where we post some interesting SWF internals info.
List of issues#2072 issue with fully qualified names
Author: 3plus4i
Date created:
Type: bug
Visibility: Everybody
Assigned to:
Labels: AS3Direct Editation
State: closed
I'm trying to edit a file where I have to use fully qualified names because of a naming
conflict. The file originally uses only Starling sprites, but I have to add a native Flash
Sprite, because Starling doesn't support text input fields. So I replaced all the existing
`new Sprite()` commands with `new starling.display.Sprite()`, which works fine. But my
added line `new flash.display.Sprite()` throws an error 'Variable flash is not defined'.
Checking the P-Code, it says
> getlex QName(PackageNamespace(""),"flash")
> getproperty
Multiname("display",[PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin"),Pa
ckageInternalNs(""),PrivateNamespace("Menu"),ProtectedNamespace("Menu"),StaticProtectedNs(
"Menu"),PrivateNamespace("Menu.as$53")])
> constructprop
Multiname("Sprite",[PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin"),Pac
kageInternalNs(""),PrivateNamespace("Menu"),ProtectedNamespace("Menu"),StaticProtectedNs("
Menu"),PrivateNamespace("Menu.as$53")]), 0
That doesn't look correct, although I know P-Code barely at all.
I'm not sure whether it's an issue with the compiler or whether I'm doing something wrong,
so I'm going to post it as a question.
Peculiar: I just noticed that the variable initialization works fine `public var
EDTinputContainer:flash.display.Sprite;`
in the import section I put `import flash.display.Sprite;`
1) What version of FFDec do you use?
2) Could you attach sample code - the whole script?
And also the whole SWF you are talking about would be great.
I tried to compile the sample in attachment and it was working okay for me.
test_2072.png (119 KiB)
State: new→opened
1) 18.5.0
2) I'll attach both. The issue is in line 99.
Also, unrelated to my actual issue, the method updateSprites() looks like it doesn't
represent the entire code in the decompiled file.
Idle Sword edit.swf (4,492 KiB)Menu.as (26 KiB)
The "Variable flash is not defined" problem should be fixed in nightly 2554.
To the updateSprites method: The method in the swf file you attached does not contain any
more code. Maybe original unedited SWF contained more code, then at some point, was lost.
Please attach original unmodified code(SWF) so I can investigate whether there was any
code previously.
The P-code looks different, but I have no idea what's supposed to be going on there. Here
is the original file:
Idle Sword.swf (4,489 KiB)
In the "Idle Sword.swf" file, the updateSprites method contains only
switch(this.director.state)
{
case "menu":
case "startGame":
}
and nothing more. The P-code does not contain anything other than this.
It seems that updateSprites does not do anything useful.
So it's not a problem in FFDec.
State: opened→upgraded
Type: question→bug
Type: question→bug
Thanks! Good to know.
I can confirm that the issue is solved in v.19.0.0. Thanks again!
State: upgraded→closed