It is currently 28 Apr 2017, 20:52



5006: An ActionScript file can not have more than one extern

Videos, graphics, Flash templates – how to create and play them using CasparCG

Moderators: Macey, Jonas Hummelstrand, didikunz

5006: An ActionScript file can not have more than one extern

Postby tusa » 06 Mar 2017, 07:37

When I try to make the .ft file I get this error:
Crawl2.as, Line 1, Column 1 5006: An ActionScript file can not have more than one externally visible definition: Crawl2, scrolling_speed

Here is my code
Code: Select all
package
{
   import flash.display.MovieClip;
   import se.svt.caspar.template.CasparTemplate;
   import caurina.transitions.Tweener;
   import flash.display.*;   
   import flash.text.*;
   import flash.text.TextField;
   import flash.text.TextFormat;
   import flash.utils.*;
   
   public class Crawl2 extends CasparTemplate
   {
      override public function postInitialize():void
      {
         //crawl_text_mc.mask = crawl_mask_mc;
         //name_mask_mc.x = -1535;
      }
      
      override public function Play():void
      {
         crawl_bkg_mc.gotoAndPlay(1);
         //Tweener.addTween(name_mask_mc, {x:0, time:0.60, delay:0.20, transition:"linear"});
      }

      override public function Stop():void
      {
         crawl_bkg_mc.gotoAndPlay(13);
         //Tweener.addTween(name_mask_mc, {x:-1535, time:0.32, transition:"linear"});
      }
      
      override public function SetData(xmlData:XML):void
      {
         super.SetData(xmlData);
         
         for each (var element:XML in xmlData.children())
         {
            if (element.@id == "f0")
            {
               crawl_text_mc.f0.text = element.data.@value;
            }
         }
         
         //name_mc.f0.text = name_mc.f0.text.toUpperCase();

      }
   }
   
   import flash.events.Event;
   //import flash.utils.Timer;
   import flash.events.TimerEvent;
   //import flash.display.Bitmap;
   //import flash.display.BitmapData;
   import flash.geom.Matrix;
   //import flash.display.Shape;
   
   var scrolling_speed:int = 3;
   //var f1:TextField;
   var format2:TextFormat = new TextFormat  ;
   f0.x = 1827;
   f0.selectable = false;
   f0.border = false;
   f0.multiline = false;
   f0.wordWrap = false;
   f0.autoSize = TextFieldAutoSize.LEFT;
   
   //var format2:TextFormat = new TextFormat();
   f0.setTextFormat(format2);
   
   var snapshot:BitmapData = new BitmapData(f0.width,f0.height,true,0x000000);
   snapshot.draw(f0, new Matrix());
   
   var bmp:Bitmap = new Bitmap(snapshot);
   addChild(bmp);
   
   bmp.x = 1827;
   bmp.y = 60;
   
   //var bmpMask : Shape = new Shape();
   //bmpMask.graphics.beginFill(0x0);
   //bmpMask.graphics.drawRect(300, 0, 1620, 66);
   //bmpMask.graphics.endFill();
   //addChild(bmpMask);
   //bmpMask.x = 0;
   //bmpMask.y = 1005;
   
   bmp.mask = crawl_mask_mc;
   
   bmp.addEventListener(Event.ENTER_FRAME,move_text);
   function move_text(myevent:Event):void
   {
      bmp.x -=  scrolling_speed;
      if (bmp.x < (300 - bmp.width))
      {
         bmp.x = 1827;
      }
   }
}
Can any of you help me with the error?
tusa
 
Posts: 49
Joined: 14 Nov 2014, 15:15

Re: 5006: An ActionScript file can not have more than one ex

Postby didikunz » 06 Mar 2017, 10:24

Abiut half down the file there is another block, that starts with import statements. What is that? That is wrong.
Didi Kunz
CasparCG Client-Programmer, Template Maker & Live CG-Operator
Media Support, CH-5722 Gränichen, Switzerland http://mediasupport.ch/
Problems? Guide to posting Bug reports & Feature requests
User avatar
didikunz
 
Posts: 3430
Joined: 10 May 2010, 09:08
Location: Aarau, Switzerland


Return to Content

Who is online

Users browsing this forum: No registered users and 1 guest

cron