It turns out that’s it’s impossible to declare a class inside a embedded <fx:Script><![CDATA[
so it turns I need to put and include the actionscript code inside an external Sourcefile. The error is commented out
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="1955" minHeight="1600">
<fx:Script source="URLRequest.as" />
<s:layout>
<s:BasicLayout />
</s:layout>
<s:Panel x="0" y="0" width="955" height="600" title="Bypass">
<s:layout>
<s:BasicLayout />
</s:layout>
<s:Label x="1" y="1" text="Please enter the ɢɪᴛ repository ʜᴛᴛᴘ ᴜʀʟ :"/>
<s:TextInput x="224" y="1" width="726" id="txtName" text="http://ytrezq.sdfeu.org/flashredirect/?http"/>
<s:Button x="1" y="12" label="ɢɪᴛ push !" click="send()"/> <!-- Undefined Method method error -->
</s:Panel>
<fx:Declarations>
</fx:Declarations>
</s:Application>
and in URLRequest.as :
final public class MyClass {
// some stuff
}
public function send():void {
var request:Myclass=new Myclass(txtName.text);
// Some stuff with
}
So the question is simple but I couldn’t found the answer anywhere. At least not with for mxml with Spark.
send()
doesn’t need to be in a class and as you can see is outside a class. But it needs to use a custom class.
So how can I call send()
from URLRequest.as ?