Copy link to clipboard
Copied
Hi guys...
I have a (what I think is) a little problem but after being the whole night awake I can´t think anymore...
I have a button which sends you to frame 10 and in frame 10 I suppose to intialize the class I imported:
import Payment;
getpremium.addEventListener(MouseEvent.CLICK, PI);
function PI(e:MouseEvent):void {
gotoAndStop(10);
}
Now in frame 10 the only thing I have is:
Payment();
and the class (how it starts) is:
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.text.TextField;
import flash.text.TextFormat; //etc
public class Payment extends Sprite
{
private var paymentSystem:PaymentSystem;
private var buyList:List;
private var loader:URLLoader;
private var pastPurchases:Array = [];
private var alltextformats:TextFormat = new TextFormat();
public function Payment()
{
paymentSystem = new PaymentSystem(); //etc
What do I suposse to write down on frame 10 for the class to be initialized?
Thanks!!!
Normally what you need to do is instantiate a Payment object...
import Payment;
var payment:Payment = new Payment();
Copy link to clipboard
Copied
Normally what you need to do is instantiate a Payment object...
import Payment;
var payment:Payment = new Payment();
Copy link to clipboard
Copied
Great!. Thanks... unfortunatelly I had to move everything into FB since the native code I need to use is not recognized in Flash CS6
Copy link to clipboard
Copied
You're welcome
Find more inspiration, events, and resources on the new Adobe Community
Explore Now