Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help importing a class and initializing it

Explorer ,
Sep 17, 2013 Sep 17, 2013

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!!!

TOPICS
ActionScript
692
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Sep 17, 2013 Sep 17, 2013

Normally what you need to do is instantiate a Payment object...

import Payment;

var payment:Payment = new Payment();

Translate
LEGEND ,
Sep 17, 2013 Sep 17, 2013

Normally what you need to do is instantiate a Payment object...

import Payment;

var payment:Payment = new Payment();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 18, 2013 Sep 18, 2013

Great!. Thanks... unfortunatelly I had to move everything into FB since the native code I need to use is not recognized in Flash CS6

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 18, 2013 Sep 18, 2013
LATEST

You're welcome

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines