Classes may only be defined in external ActionScript 2.0 class scripts.

i try to use the BitmapExporter 2.2.
i inserted the .as file into the first frame in my fla but
when i try to test movie i get
"Classes may only be defined in external ActionScript 2.0
class scripts."
since i am not expert in extensions - what did i do wrong and
hoe can i properly use this extension?

remove the .as file code from your fla. put the .as file in
the same directory with your flash files. when you publish your
swf, flash will incorporate the .as code in your swf when you use
the new BitmapExporter() statement.

Similar Messages

  • 'Basic' external actionscript file/class usage

    Hey All,
    I'm a bit baffled by something that should, in my humble opinion, be a piece of cake...
    The setup is really easy. A simple application with a single textinput, a button and a text component.
    When the button is clicked a function is called that sets the text from the inputfield to the text component.
    code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
        <mx:Script>
            <![CDATA[
                public function click(inputText:String):void {
                    outPutTxt.text = inputText;
            ]]>
        </mx:Script>
        <mx:TextInput x="10" y="10" id="inputTxt"/>
        <mx:Button x="178" y="10" label="Button" id="Btn" click="{click(inputTxt.text)}"/>
        <mx:Text x="251" y="12" text="Text" id="outPutTxt"/>
    </mx:Application>
    As I said, really easy.
    What I want to do is put the function 'click' into an external actionscript file or class. And still be able to, from within the external file, modify the outPutTxt stuff.
    I'm aware that I could create a public bindable variable inside of the external file and then bind the outPutTxt to that variable, but I would really like to be able to 'simply' force the value...
    Is that possible? If yes: how plix
    If it's not possible, I'd like to know as well! And in that case, how would I then re-use the same instance of a class/file in multiple seperate components? Say I got a 'login' thingie where a user logs in (data stored externally in a seperate actionscript file/class) and I want to re-use that information on other pages... Or is this done automatically?
    Any and all comments/answers are higly appreciated!
    Pieter

    Hey Levancho,
    thanks for your answer!! Much appreciated.
    However, the code you proposed threw an error...
    Errormessage:
    ReferenceError: Error #1069: Property outPutTxt not found on controls.Control and there is no default value.
        at controls::Control/btnClick()[C:\...\FlexTest_03\src\controls\Control.as:13]
        at FlexTest_03/__Btn_click()[C:\...\FlexTest_03\src\FlexTest_03.mxml:11]
    So I tried something else where I bind the text in my OutPutTxt to a variable inside of the external class file.
    Code:
    Class:
    package controls
        public class Control
            [Bindable]
            public var outPutText:String = "";
            public function Control()
            public function btnClick(inputText:String):void {
                this.outPutText =  inputText;
    Mxml:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
        <mx:Script>
            <![CDATA[
                import controls.Control;
                [Bindable]
                private var control:Control = new Control();
            ]]>
        </mx:Script>
        <mx:TextInput x="10" y="10" id="inputTxt"/>
        <mx:Button x="178" y="10" label="Button" id="Btn" click="{control.btnClick(inputTxt.text)}"/>
        <mx:Text x="251" y="12" id="outPutTxt" text="{control.outPutText}"/>
    </mx:Application>
    And this basically did what I wanted to do... so I just need to do some major binding between my application and the classes I'll be using for my business logic.
    Now for something else entirely...
    Is there a way for me to pass the instance of my class between flex components?
    Pieter

  • ActionScript 2.0 class scripts may only define class or interface constructs.

    This is driving me nuts. I have an old AS1 project which I
    upgraded to AS2. It uses an include file, settings.as, which has
    stuff like this:
    settings = new Object();
    settings.property = 'some value';
    Then I include it on the main timeline like this:
    #include "settings.as"
    Every time I render, I get a million and one Compile Errors
    stating:
    "ActionScript 2.0 class scripts may only define class or
    interface constructs."
    But it isn't an ActionScript 2.0 class! It's just a regular
    include. How do I avoid the bogus Compile Errors?

    Okay, I found why the compiler is getting confused.
    In my settings.as file I create an object named 'settings' as
    mentioned. Later in my code elsewhere on the timeline, I refer to
    settings.property. When Flash sees that, I guess it sees that I
    refer to an object 'settings' and that there's a .as file called
    'settings' and it erroneously assumes it should be a class or
    something. I concluded this because if I change the object or .as
    name so that they do not match, the compile errors go away. As far
    as I know there's no way to tell the compiler that settings.as is
    not a class, despite the fact I'm not telling Flash that it is a
    class.

  • Error "You may only define methods within "CLASS class IMPLEMENTATION"

    We have code in LMIGOSMC so that the vendor batch number appears in the MIGO transaction for certain movement types.  We have created another, custom movement type in which this functionality should be available so I need to add it to LMIGOSMC.  When I go in and try to make the modification I am getting the following error:
    "You may only define methods within "CLASS class IMPLEMENTATION ...ENDCLASS".
    What am I doing wrong?

    Hi,
    You are not doing anything wrong with regard to the syntax error you are getting.  During the syntax check of include program LMIGOSMC, the system is not aware of the CLASS... ENDCLASS statements within the program LMIGOSM4.  Try the syntax check at the LMIGOSM4 program level (or even better, at the SAPLMIGO level) and you will see that the error is not given.
    Regards,
    Jamie

  • How to import classes from an external actionscript file

    This is driving me crazy, I've been trying to resolve this on my own for ages, and I've reviewed a lot of different materials, but I still can't seem to just import some external actionscript classes correctly.
    I'm using Flash Builder 4 with the Flex 4 SDK on mac osx 10.6
    the class I'm trying to import (I'll call it DesiredClass) is in a folder like this
    /libraries/com/foreignproject/com/foreignproject/DesiredClass.as
    within the class itself, the package declaration looks like this (I left all the guts out for clarity):
    package com.foreignproject
        import flash.display.Sprite;
        public class DesiredClass extends Sprite
            public function DesiredClass()
    I'm working on a totally different actionscript file at
    /Users/username/Documents/Adobe Flash Builder 4/TestProject/src/TestProject.as
    in this file I try to import the DesiredClass:
    package
         import com.foreignproject.DesiredClass;
         import flash.display.Sprite;
         public class TestProject extends Sprite
              public function TestProject()
              var neatClass:DesiredClass = new DesiredClass();
    And then I try to add the class I want to the source path.
    I've tried adding each folder to the source path separately:
    /libraries/com/foreignproject/com/foreignproject/DesiredClass.as
    /libraries/com/foreignproject/com/foreignproject/DesiredClass.as
    /libraries/com/foreignproject/com/foreignproject/DesiredClass.as
    /libraries/com/foreignproject/com/foreignproject/DesiredClass.as
    /libraries/com/foreignproject/com/foreignproject/DesiredClass.as
    If I choose the libraries folder or either of the com folders then an error shows up in theTestProject.as file, saying:
    Definition com.foreignproject:DesiredClass could not be found.
    But f I choose either of the foreignproject folders then an error shows up in theDesiredClass.as file saying:
    a file found in a source-path must have the same package structure 'com.foreignproject', as the definition's package, ".
    What am I doing wrong? Please help. I bought a book on actionscript, started doing the flex-in-a-week series, read numerous online discussion boards, and I still can't import these classes.
    Thanks in advance.

    I don't know if this method is supported anymore but you can give it a try.
    If you backed up bookmarks in IE using the following directions, you should be good!
    *In IE, "File -> Import and Export -> Export Cookies".
    *Open newly exported "cookies.txt" in a text editor and put a period before every line that starts with a domain. So a line starting with <b>altavista.com TRUE / FALSE 1388491200 AV_ALL 1</b> will become <b>.altavista.com TRUE / FALSE 1388491200 AV_ALL 1</b>
    *Then, move the "cookies.txt" file to your profile folder.
    You can get to the Profile folder two ways
    *Help > Troubleshooting Information > Profile Directory > Show Folder
    or
    *Go to '''about:support''' and click Show Folder next to Profile Directory.

  • Flex 3 vs Flex 4 Preprocessor directives and code behind (External Actionscript file)

    I have a framework that I've built that I want to use on Flex3 and Flex4.
    I've added pre-processor directives as per this link (http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_21.html) and got my Flex 4 code to compile nicely.
    I then went to flex 3 and discovered my sub-class of Application wouldn't compile because it was based off of spark. No problem, I'll add in a directive.
    Except now my overridden class has duplicate code, specific to which SDK it is using.
    No problem, I'll put all of the application class code in an Actionscript file and include it in both Application class declarations for each directive.
    It works nicely in Flex 3, so I went to Flex 4, tried to compile and now I'm getting compiler errors saying things such as "The (private|public|protected) attribute may only be used on class property definitions." and "The (private|public|protected) attribute can only be used inside a package.
    This same file works in Flex 3, but not in Flex 4.
    What can I do to make the code compile in both places?
    I'll work on a simple case so I can upload some code.

    Nevermind.
    I got around this issue by renaming my sub-classed Application to "...Application".
    Now I can use a directive to specify an import statement for the extends Application portion rather than specifiing the fully qualified spark.components.Application or mx.core.Application.
    Lame - but done.

  • Why do button functions included in external actionscript not persist across frames?

    this one drives me nuts!
    if i include an external actionscript file in frame one of my
    movie, then [as you'd expect] all the functions, global variables
    etc contained in that external AS file are available throughout my
    movie - with one notable exception.
    if i add a button to the stage - in a frame other than frame
    one - whose onRelease handler is defined in the external AS, the
    function is not called when the button is clicked - i have to
    re-include the external AS file again on the frame in which the
    button resides, in order for the buttons function to be called.
    anyone know why this is - and if there's a way round it?
    how come all the other functions in the AS persist across all
    frames and all timelines in the movie, but the button handlers only
    seem to be available on the actual frame in which the AS file is
    included?
    download
    example

    I think you and I are dealing with similar issues and the
    root cause is referred to as "scope." The only difference between
    your and my problems is that your code is in an external as file
    and mine is on the timline. But in both instances, code that should
    work doesn't. Robert Reinhardt has covered this in an article at
    http://www.communitymx.com/content/article.cfm?cid=8E4DF.
    He is the author of the Flash Actionscript Bible series and so
    knows what he is talking about. I have been studying it for an hour
    and darn if I can understand the second page of it. I've asked for
    help myself about this at
    http://www.kirupa.com/forum/showthread.php?t=248316.

  • External actionscript file

    Hi, I've more than two components accessing the same
    function. Hence, I would like the function to be on an external
    actionscript file.
    My codes are as followed:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:HDividedBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="100%" height="100%">
    <mx:Metadata>
    [Event(name="scaleChange",
    type="actionscripts.sliderChange")]
    </mx:Metadata>
    <mx:Script>
    <![CDATA[
    import actionscripts.sliderChange;
    import mx.managers.DragManager;
    import mx.core.DragSource;
    import mx.events.DragEvent;
    import flash.events.MouseEvent;
    import mx.containers.Box;
    [Bindable]
    [Embed(source="/images/map.jpg")]
    public var map:Class;
    public var oWidth:Number = 2800; //original map width - 1200
    public var oHeight:Number = 2100; //original map height -
    900
    public var xOff:Number;
    public var yOff:Number;
    private function dragMap(event:Event):void{
    event.currentTarget.addEventListener(MouseEvent.MOUSE_DOWN,
    mouseMoveHandler);
    private function doDragEnter(event:DragEvent):void{
    DragManager.acceptDragDrop(Box(event.target));
    private function mouseMoveHandler(event:MouseEvent):void{
    event.currentTarget.useHandCursor=true;
    var dragInitiator:Image=Image(event.currentTarget);
    var ds:DragSource = new DragSource();
    ds.addData(event.currentTarget, 'img');
    var imageProxy:Image = new Image();
    imageProxy.source = map;
    xOff = event.currentTarget.mouseX;
    yOff = event.currentTarget.mouseY;
    DragManager.doDrag(dragInitiator, ds, event, imageProxy, 0,
    0, 0.00);
    private function doDragDrop(event:DragEvent):void{
    targetMap.x = event.currentTarget.mouseX - xOff;
    targetMap.y = event.currentTarget.mouseY - yOff;
    public function onSliderChange():void{
    var temp:Number = 100-scale.value;
    targetMap.width = temp/100*oWidth+1200;
    targetMap.height = temp/100*oHeight+900;
    map.smoothing = true;
    var nWidth:Number = targetMap.width;
    var nHeight:Number = targetMap.height;
    var sliderObj:sliderChange = new sliderChange(nWidth as
    Number,nHeight as Number,"scaleChange");
    dispatchEvent(sliderObj);
    ]]>
    </mx:Script>
    <mx:Canvas id="scaling" width="75%" height="100%">
    <mx:VBox width="100%" height="100%"
    horizontalAlign="center" verticalAlign="middle">
    <mx:Box id="mapContainer" width="500" height="500"
    horizontalAlign="center" verticalAlign="middle"
    horizontalScrollPolicy="off" verticalScrollPolicy="off"
    dragEnter="doDragEnter(event);" dragDrop="doDragDrop(event);">
    <mx:Image source="{map}" id="targetMap"
    scaleContent="true" creationComplete="dragMap(event);" />
    </mx:Box>
    <mx:HSlider id="scale" liveDragging="true" minimum="1"
    maximum="100" labels="['1','100']" width="500" height="30"
    change="onSliderChange()" />
    <mx:Text text="{scale.value.toFixed(2)} km" />
    </mx:VBox>
    </mx:Canvas>
    <mx:Canvas width="25%" height="100%"
    styleName="sideBar">
    <mx:Label text="test test" />
    </mx:Canvas>
    </mx:HDividedBox>
    How do I make the drag and drop functions in the
    <mx:Script></mx:Script> to be in an external
    actionscript file so that this component can access it for the drag
    and drop to work?
    Any help is very much appreciated. ^^

    You can reference a external actionscript file in a
    <mx:Script source="myScripts.as"/>
    I do not use it this way as it is not a vary OO way to do
    things.
    I will generally create a singleton class (so it is only
    instantiated once)
    and use it for utility type functions.
    For example:
    public class UtilityClass
    private static var _instance:UtilityClass;
    public function UtilityClass()
    public static function getInstance():UtilityClass
    if(_instance == null)
    _instance = new UtilityClass();
    return _instance;
    public function myFunction():void
    Then in a mxml
    <mx:list id="list"
    dragDrop="UtilityClass.getInstance().myfunction()"

  • I downloaded several cds to my external hard drive in .mp3 format. Later, I copied them to iTunes. The songs only play when the external hard drive is plugged in. I tried to load the songs from iTunes to my iPhone and the songs don't play.

    I downloaded several cds to my external hard drive in .mp3 format. Later, I copied them to iTunes. The songs only play when the external hard drive is plugged in. I tried to load the songs from iTunes to my iPhone and the songs don't play. I thought iTunes allowed me to transfer music to my iPhone and play it. What am I doing wrong?

    Hi skoorb1,
    When adding music to iTunes, you can set it to either make a local copy of the file, or simply point to the original location of the file (for example, on an external hard drive). If it is set to do the latter, it will not be able to play or transfer those files when the external hard drive is not plugged in. You may find the following article helpful:
    iTunes: About the Add to Library, Import, and Convert functions
    http://support.apple.com/kb/ht1347
    Regards,
    - Brenden

  • Cash Discount may only be granted up to 3%

    Hi Guys,
    Im new to FI. While posting an invoice in MIRO, we encounter an error "Cash Discount may only be granted up to 3%".  Payment term we are using has cash discount of 5%. I want to take out the limit of the cash discount, how will I do it? What transaction codes to be used? Thanks.

    this is held in tolerances
    This is in SPRO "Define Tolerances Vendors"
    You have groups, and the tolerance group is assigned to the Vendor

  • Help needed to define a xsd for a java class that has initialization block

    public class Employee{
    public final static Boss boss1 = new Boss("George","Male");
    public final static Boss boss2 = new Boss("Barbara",'Female");
    public class Boss{
    private String name ;
    private String sex;
    Boss(String name,String sex){
    this.name = name;
    this.sex = sex;
    I am working on a wsdl first webservices.
    Can someone come with an xsd for this two class.I am struggling to come with an xsd becuase of the initialization of boss1 and boss2
    Please help.
    thx
    m

    shet wrote:
    I am struggling to come with an xsd becuase of the initialization of boss1 and boss2Why do you think that there is a dependecy of initialization to XSD development? Normally, you should only be creating the XSD to represent the class structure, not the runtime final value of instance member.
    You will have to write the initilization logic in helper or utility classes.
    Edited by: Adhir_Mehta on May 17, 2010 8:16 AM

  • Your message wasn't delivered due to a permission or security issue. It may have been rejected by a moderator, the address may only accept e-mail from certain senders, or another restriction may be preventing delivery

    HI,
    We are getting following error message for all users while sending mail to external but we able to receive mail from internet.
    Your message wasn't delivered due to a permission or security issue. It may have been rejected by a moderator, the address may only accept e-mail from certain senders, or another restriction may
    be preventing delivery.

    Hi,
    Please follow Luke and Shelly’s suggestion to check your SPF record and Send Connector configuration. Also you can post the complete NDR message(with NDR status code) here for further analysis.
    If there is any updates, please feel free to let us know.
    Thanks,
    Winnie Liang
    TechNet Community Support

  • Calling a function in an external actionscript

    Hi. First of all I'd like to put my hands up and say that what I know about Flash is antiquated (I used to work with Flash 4 / 5), and have now been thrown into the deep end, as it were.
    I have an application that has a button component. In an external actionscript file there's an event listener that calls a function when this button is pressed. I want to replace the button with a graphic that switches according to whether the button is 'on' or 'off'. I've created a movie clip that cycles back and forth between the on and off states when clicked, but the trouble I'm having is getting it to call the function. I have no idea how to do it, other than to just include function_name(); (or call.function_name();) in the onRelease handler (which doesn't work). Is it possible to use event listners for movie clips (rather than components?) Or else how can I call this function? It should be really simple and I'm tearing my hair out trying to get it to work! The function is declared 'public', by the way...
    Oh yes, this is ActionScript 1 (I think...)
    Eternal thanks and gratitude to anyone who can help me...

    Do you mean to copy it here, or copy it into the fla? I've already tried doing the latter, which doesn't work - the script imports other external as files and I think that that's messing things up. The function only seems to work when it's located in this external file. The function I'm trying to call is
    public function toggleAudio() {
           //if (btnAudio.label == "Sound Off") {
           if (_root.audio == "mute" or btnAudio2.label == "Sound Off") {
               trace("toggleAudio AUDIO: Off");
               //btnAudio.label = "Sound On";
               _root.audio = "unmute";
                         // stop recieving audio from in stream
               ServiceLocator.getInstance().getService("nsService").returnInStream().receiveAudio(false) ;
               // stop sending audio on out stream
               ServiceLocator.getInstance().getService("nsService").returnOutStream().attachAudio(null);
                     } else {
               trace("toggleAudio AUDIO: On");
               btnAudio2.label = "Sound Off";
               _root.audio = "mute";
                         // start recieving audio from in stream
               ServiceLocator.getInstance().getService("nsService").returnInStream().receiveAudio(true);
               // start sending audio on out stream
               ServiceLocator.getInstance().getService("nsService").returnOutStream().attachAudio(Servic eLocator.getInstance().getService("camService").returnMic());
    The bit at the beginning where I've commented some stuff out is where I've been trying out different things to get it to work.
    For all intents and purposes though the function could be
    public function please_work() {
    trace("I work!");
    All I need is for a way to call this from the main flash movie

  • Ebflow: Problem defining an external service using WF_EXTSRV

    I'm trying to define an external service for the Webflow to use. In transaction WF_EXTSRV I have to provide details of the service. One field requires the Logical System to be nominated. The help says that this entry must be in table TWPURLSVR. In our system this table is empty, and I cannot figure out in customising where to populate this table.
    Anyone have any ideas about this?
    Anyone also know what may be a better forum to post this message in?
    BR,
    Tony.

    Hi Anthony,
    Better forum to post it on is on the BPM & Workflow forum which can be found under SAP NetWeaver. I'm now experiencing the same problem as you. No entry in this table. But when I leave the field blank in WF_EXTSRV, I don't have any problems calling my service from the workflow.
    If you already have an answer to your own querstion, could you let me know?
    Kind regards!
    Joost van Poppel

  • Problem defining an external service using WF_EXTSRV

    Hi,
    I think that this is the most appropriate forum to post this message, but please correct me if I am wrong.
    I'm trying to define an external service for the Webflow to use. In transaction WF_EXTSRV I have to provide details of the service. One field requires the Logical System to be nominated. The help says that this entry must be in table TWPURLSVR. In our system this table is empty, and I cannot figure out in customising where to populate this table.
    Anyone have any ideas about this?
    BR,
    Tony.

    Hi Anthony,
    Couple of things:
    1) You may make manual entry in this table.
    2) the necessary steps can be found in the documentation: SAP@Web Installation Guide, chapter "Post-Installation Activities".
    3) from se80 go to utilities->settings->ITS choose the server where you want to publish or choose all available servers. (note if you dont see the ITS server list in the drop down -ITs may not be configured properly)
    I hope these clues help.
    regards,
    Sanjeev

Maybe you are looking for

  • Mouse or keyboard won't work in Gnome

    Hello, Since a system update I made yesterday, there is no way to interact once logged in Gnome 3.4. The Super key won't open the shell, Alt+F2 do nothing, there is no element of the upper panel I can clic on (calendar, system...) - but I can see mou

  • How to generate goods receipt / goods issue (gr/gi) slip no. ?

    Hi all SAP experts,    i did following steps 1) by using omc1 assigned gr/gi slip number for our plant. 2) created internal number range for no. range group code. 3) intervals are created for gr/ir slip in 2009 by using omj6 t-code. 4) assigned no. r

  • Long runtime when Generate Org model with CRM_R3_ORG_GENERATE. never finish

    Hi All, I tried to generate org.model with CRM_R3_ORG_GENERATE. But it ran for a long time. For a day and still not finished. I killed it and did again.  Same situation happen. I see process is running and use almost CPU time. Is this normal for this

  • GRPO not posting to Purchase Variance Account

    SBO Version: 8.82 PL05 Forum, I have the following scenario: The Goods Return was not created from a Goods Receipt PO, however its value was €249.83  and this is the value shown on the open item list. The journal posting relating to this return detai

  • OAS WEB FORM 9.0.4 configuration for NLS_LENGTH_SEMANTICS=CHAR

    We have NO issue using Oracle Form(Developer 2000) with Oracle Application Server Configuration with UTF8 characterset. Everything is set correctly. As UTF8 is multi BYTE character set, we have to find a way Oracle Form can work with NLS_LENGTH_SEMAN