Error in the phase of Action Script assigniment

Hello guys!

I created the following action script, named "sketch.as":

package

{

import flash.display.Sprite;

import flash.events.MouseEvent;

import com.adobe.images.JPGEncoder;

public class sketch extends Sprite {}

public void sketches (): void {}

It's your documentclass constructor

}

stage.addEventListener (MouseEvent.MOUSE_MOVE, moveCursor);

Mouse.Hide ();

function moveCursor(event:MouseEvent):void

{

Pencil.x = event.stageX;

Pencil.y = event.stageY;

}

var canvas_mc:MovieClip = new MovieClip()

addChildAt (canvas_mc, 0);

canvas_mc.swapDepths

function sketch()

{

canvas_mc. Graphics.beginFill (0xFFFFFF);

canvas_mc. Graphics.drawRect (0, 0, 600, 500);

canvas_mc. Graphics.endFill ();

canvas_mc.addEventListener (MouseEvent.MOUSE_DOWN, startDrawing);

canvas_mc.addEventListener (MouseEvent.MOUSE_UP, stopDrawing);

canvas_mc.addEventListener (MouseEvent.MOUSE_MOVE, makeLine);

}

function startDrawing(event:MouseEvent):void {}

canvas_mc. Graphics.LineStyle (1, 0, 1);

canvas_mc. Graphics.MoveTo (mouseX, mouseY);

canvas_mc.addEventListener (MouseEvent.MOUSE_MOVE, makeLine);

}

function stopDrawing(event:MouseEvent):void {}

canvas_mc. RemoveEventListener (MouseEvent.MOUSE_MOVE, makeLine);

}

function makeLine(event:MouseEvent):void {}

canvas_mc. Graphics.LineTo (mouseX, mouseY);

}

Sketch();

var serverPath:String = "";

function createJPG (m:MovieClip, q: number, fileName:String)

{

var jpgSource:BitmapData = new BitmapData (m.width, m.height);

jpgSource.draw (m);

var jpgEncoder:JPGEncoder = new JPGEncoder (q);

var jpgStream:ByteArray = jpgEncoder.encode (jpgSource);

header: var URLRequestHeader = new URLRequestHeader ("Content-type", "application/octet-stream");

var jpgURLRequest:URLRequest = new URLRequest (serverPath + "" jpg_encoder_download.php? name = ' + name + '.jpg' ");

jpgURLRequest.requestHeaders.push (header);

jpgURLRequest.method = URLRequestMethod.POST;

jpgURLRequest.data = jpgStream;

var jpgURLLoader:URLLoader = new URLLoader();

jpgURLLoader.load (jpgURLRequest);

navigateToURL (jpgURLRequest, "_blank");

}

save_btn.addEventListener (MouseEvent.CLICK, saveBtnPress);

save_btn.addEventListener (MouseEvent.ROLL_OVER, saveBtnOver);

save_btn.addEventListener (MouseEvent.ROLL_OUT, saveBtnOut);

function saveBtnPress(e:Event):void

{

createJPG (canvas_mc, 90, "sketches");

}

function saveBtnOver(e:Event):void

{

Mouse.Show ();

Pencil.Visible = false;

}

function saveBtnOut(e:Event):void

{

Mouse.Hide ();

Pencil.Visible = true;

}

}

}

Recently, I created a .fla file in the root of the .as file name 'sketch.fla '.

When I try, in the form of Adobe Flash CS4 Professional, to assign to 'FLA' in the properties to publish my action script, the following message appears:

«A definition for the document class is not found in the classpath, then it will be automatically generated in the tha to export SWF file»

Of course, this does not

Could someone help me?

take a screenshot of the files in the directory of your fla and a screenshot of your property panel indicating the document class.  Glue the two images on this forum.

Tags: Adobe Animate

Similar Questions

  • I need help on the matrix of action script 3.0

    I need help on the matrix of action script 3.0

    [Ask in the correct forum allows... Left non-technical Forum Lounge for forum specific program... MOD]

    to apply a matrix for mc mat oppose:

    var mat: Matrix = new Matrix;

    mat.a = Whatever;

    mat.b =

    mat.c =

    mat.d =

    mast. TX =

    mat.Ty =

    MC. Transform.Matrix = Matt;

  • Extracting XML error. The XML file that is assigned in the configuration.xml is either incorrect or damaged.

    1. some web pages gives "error extracting XML. The XML file that is assigned in the configuration.xml is wrong or corrupt.

    2 Youtube gives, after having pressed the button start, message "an error has occurred. Please try again later.
    Even youtube opening page with IE, there is no problem.

    3. scrolling on Mozilla firefox pages only works with the sidebar not with the mouse wheel.

    Other user accounts on this computer is not these problems.

    BR Juha

    This can be caused by a recent update of Flash 11.3.

    See:

  • Boolean Boolean value in the returned java action script implementation

    Hi all

    I have a called checkLogin() actionscript function that calls a remote java method called login()). Login supports two channels, user name and password and returns true if the combination is found in the database, and false if not.

    CheckLogin function either displays an alert if the connection function returns true or it'll run an animation sequence if it is false.

    The problem is that, although my java connection method returns true I can't define her revealing Boolean in the true action script. The Boolean remains "authenticated" as false. I know because I used a breakpoint after that that he has created and used the debugger to check the value of the variable.

    I know that my remote object is configured correctly because using network monitor I see the answer as true.

    It is the button that triggers the function:

    < s:Button = "8" x = "83" label = "Login" click = "checkLogin ()" / >

    Here is my function checkLogin() actionscript:

    private function checkLogin (): void {}
    authenticated = mainentry.login (username.text, password.text) as Boolean;
    {if (Authenticated)}
    Alert.Show ("connected!");
    } else {}
    Shake.Play ();
    }
    }

    Here is my statement of the remote object:

    < mx:RemoteObject id = "Mainentrance' destination = 'hand '.

    source = 'infrastructure. Hand '.

    / >

    Here's my exit Network Monitor: (Please note the right login and password for this application example is "admin" "admin"

    Request:

    Flex Message (flex.messaging.messages.RemotingMessage) operation = connection clientId = null destination = hand messageId = B1FF60B2-40E8-2580-209D-13CF5BCB9547 timestamp = timeToLive = 0 body 0 = [ admin, admin ] hdr (Iddm) = 2B5D49D7-A10B-DEA0-4A20-1D57FB576314 hdr (DSEndpoint) = my - amf

    Answer:

    Flex Message (flex.messaging.messages.AcknowledgeMessageExt) clientId = 2B5D53DD-8C0E-F45F-B5B1-19CF70CA88F6 correlationId = B1FF60B2-40E8-2580-209D-13CF5BCB9547 destination = null messageId = 2B5D53E2-6E0F-74FC-F37C-2170EAB2DEAD = 1284527580238 = 0 = true body timeToLive timestamp

    Any help would be greatly appreciated.

    -Felix

    Remote service calls are asynchronous in flex. You need listen to the EEG of result the result to the server event.

    private void mainentry_resultHandler(event:ResultEvent):void
    {
    authenticated = event.result;
    }

  • Fill the stage with Action Script

    Hello

    I'm new to flash and Action script. I would like to know how I could fill (instead of copy and paste) the scene with a small button e.g. 10 x 10 px. Let me explain what I'm trying to do here. It's a simple game that includes 4000 buttons, 50 lines of 80 buttons. Each button has States, not available, available and in the process. Visitors come to the page and start clicking, wins the one who has the most clicks.

    So instead of doing this with the painful copy and paste, to give the button a unique id, I was wondering if there is a way to do this with action script, generating 50 lines, 80 buttons per line, and each of them giving an id with j ++ or something.

    Thank you very much and sorry for my English.

    Of course, no problem actually. I would use two pieces of code. The first would be a
    class, which extends MovieClip and attached to your button element in the library.
    Then a little to the loop on the main timeline to attach buttons to the
    step and you're all set.

    For the class:

    class com.yourdomain.Sample extends MovieClip
    {
    var myID:Number;

    function Sample() {}

    public function set id(newID:Number):Void
    {
    myID = newID;
    this.onRelease = function() {}
    trace (this.) MyID);
    }
    }

    }

    Of course, you will need to change the com.yourdomain to your own class path.
    Then just put your clip in the library to export for ActionScript and set
    class: com.yourdomain.Sample

    In the main timeline then write a function createGrid bit as follows:

    function buildGrid (tot, sx, sy, pc, cs, rs) {}
    var startX = sx;
    var currX = startX;
    var startY = sy;
    perCol var = pc;
    var colSpace = cs;
    var rowSpace = rs;
    Use tot + 1 because we are not going to go 1-0 in the loop below
    var total = tot + 1;

    for (var i = 1; i)< total;="">
    Clip var = this.attachMovie ("btn", "btn" I, I + 10, {_x:currX,)
    _y:startY});
    clip.ID = i;
    currX += colSpace;
    If (I % perCol == 0) {}
    startY += rowSpace;
    currX = startX;
    }
    }
    }

    And call it:

    buildGrid (100, 20, 20, 10, 12, 12);

    This will make a grid of 100 occurrences of the element named "btn" (one with)
    your attached class), from 20,20 with 10 per line and 12 pixels
    between the centers... When you click on one any of them they will trace their
    appropriate index 1-100

    HTH

    --
    Dave-
    Developer leader
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.Adobe.com/communities/experts/

  • Error in the configuration of RMAN script for physical Standby creation

    Version of database - Oracle Database 11g Enterprise Edition Release 11.2.0.1.0

    I do creating waiting using physics 'RMAN duplicate script.

    The standby db is in nomount State.

    But when you connect to the primary database of standby DB to run the RMAN script on the backup server, I get the below error: -.

    [oracle@manu ~] $ rman target sys/oracle@orcl auxiliary sys/oracle@ORCL_STBY path = duplicate.trc

    Recovery Manager: release 11.2.0.1.0 - Production on Fri Jan 18 13:13:11 2013

    Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

    RMAN-00571: ===========================================================
    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.
    RMAN-00571: ===========================================================
    RMAN-00554: initialization of the package manager internal collection failed
    RMAN-04005: target database error:
    ORA-01031: insufficient privileges


    I checked a few password file is to say things as db and Eve tnsnames.ora and listener.ora primary in both primary and standby, everything seems perfect.

    Can someone help me find the real problem?

    All tips/ideas would be very appreciated

    Published by: 918868 on January 18, 2013 12:25 AM

    Published by: 918868 on January 18, 2013 12:27 AM

    Hello;

    I don't know I would use sqlplus to solve a problem of RMAN. At the end of the day, you still have to use RMAN to connect.

    You can debug by taking:

    rman target sys/oracle@orcl auxiliary sys/oracle@ORCL_STBY trace=duplicate.trc
    

    And then just try:

    rman target sys/oracle@orcl 
    

    Assuming this works, you can refine the RMAN connection problem.

    Connection string your RMAN:

    rman target sys/oracle@orcl auxiliary sys/oracle@ORCL_STBY trace=duplicate.trc
    

    Is different from the ones I use:

    rman target sys/password@PRIMARY auxiliary /
    
    OR
    
    rman target=sys/password@primary auxiliary=sys/password@standby
    

    In addition, you must have a static entry on the side of the day before, so you have something to connect to:

    Example of

    LISTENER =
        (DESCRIPTION_LIST =
          (DESCRIPTION =
            (ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = 1521))
          )
        )
    
    SID_LIST_LISTENER =
        (SID_LIST =
          (SID_DESC =
          (global_dbname = STANDBY_DGMGRL.hostname)
          (ORACLE_HOME = /u01/app/oracle/product/11.2.0.2)
          (sid_name = STANDBY)
          )
          (SID_DESC =
          (global_dbname = STANDBY.hostname)
          (ORACLE_HOME = /u01/app/oracle/product/11.2.0.2)
          (sid_name = STANDBY)
    )
    

    The listener must be restarted to see this entry.

    The tnsnames.ora will also the entries for two databases as both sides need to connect.

    Keys to success

    1. new Eve started NOMOUNT on new password file. (So the watch is a current master password renames and then the database started in NOMOUNT use it)
    2. hard coded listener on the new standby server.
    3 fix the tnsnames.ora files.
    4 fix the command duplicate.

    Best regards

    mseberg

  • Error during the deployment using Ant Scripts

    Hello

    I use the Ant scripts for projects on the Enterprise BPM deployment.

    However, every time I try the project deployment deployment takes a long time (about 15-20 min.) followed by the following error message:


    means: Java heap space

    This error message is followed by several lines explaining the same error.


    Kindly help me with the solution or the necessary changes I have to do in order to get the deployed project.


    PS: When I try to deploy some of the examples given, they all work very well.

    try to increase a lot of ants
    Export ANT_OPTS = "- Xms256m - Xmx256m" (ksh/bash)
    Define ANT_OPTS = "- Xms256m - Xmx256m" (Windows)

    HTH
    Peter

    Edited by: user12083480 the 23.10.2009 11:45

  • Help! Need to know how to swap the depths with Action Script 3

    So, I have several video clips on a single layer.  Its a gallery interactive where when a photo is selected it both the clip and the picture expands to fill the screne.  The problem is, given that the animations take part in video clips and all film clips exist on the same layer when they are selected and grow to fill the screne they are being hidden behind all the movieclips in front of her in this layer.  I know that there is an action to bring movieclips to the highestdepth or to the front on click/release, but I have no idea where to start. But I work in actionscript 3.0

    If it helps we can post a link to the flash file.

    Thank you!

    You can use addChild (obj); to make an object to move to the top of the heap.

  • change the image using action script 3

    Hello

    my game is built using AS3, no time line code.

    I have an image in step (image 1) that serves as background

    However, I can't seem to figure out how to do so when level 2, it becomes the background image turns into a different image?

    I know it's a conditional statement, but I do not know how to move images if you understand what I'm saying.

    would be something like

    If (CurrentLevel == 2)

    {

    code

    }

    Are you allowed to use Movieclip symbols?  If so, you can create a Movieclip (placed in frame 1) that has the different pictures on different periods and which frame Movieclip is on with your control code.

    Otherwise, you will have to consider dealing with the Loader class for your images, where you load them dynamically.

  • How to get all the attributes of the component of action script

    Hello

    I'm new to flex. I use ActionScript 3.

    I have a component with the name template1.mxml. In this, I have 10 text boxes with the unique id

    I want to erase all the text boxes when the user clicks on the button "delete".

    For this feature, I need to wirte something like that

    "

    templateObj.name.text ="";

    templateObj.address.text ="";

    templateObj.city.text ="";

    templateObj.like.text ="";

    ".

    I have 25 models like this one, and all models have different attributes. The above code became cumbersome for me.

    Is there a way I can get the picture of the id attribute of the object then iterate over this array and write only one line

    Like that: -.

    for each (var i in templateAttrArray) {}

    templateObj.templateAttrArray [i] .text ="";

    }

    I tried the getChildren(); methods, but he's back, whatever it is.

    There may be solutions for this one?

    Any help appreciated.

    Thank you

    Tushar Gandhi

    Hi there, that should do it


    http://www.Adobe.com/2006/mxml"layout ="absolute">
       
            Import mx.controls.TextInput;
    private void clearAll (): void {}
    {for each (var ti: TextInput in {vbox.getChildren ())}
    TI. Text = "";
    }
    }
               
               
    ]]>
       

       
           
           
           
           
           
       

       

  • citing the .exe using action script

    Hello
    I want to call an .exe file using flex3. I also need to pass arguments to command line to the .exe file called.
    Is this possible. Please answer. An example would be sufficient.

    Thank you!!!

    A Flex application running in Flash Player, hosted in a browser is prohibited by security constraints to access any local client assets, including the file system, ports, programs, etc.

    The same application running under AIR is allowed access to assets, but the last I heard, he still not directly supported running native programs. I heard of some workarounds. Google for it.

    Tracy

  • I got error #2044 while I run my script

    I have two .as files and a film 'adp.flv '.

    PlayVideoAbstract.as and PlayAbstract.as

    I have flash document with the class name is "PlayVideo". I'll run the movie in the method of the abstract object, but while I run the script, film works, but shows the error message #2044. How can I remove this error. I'm using action script 3

    PlayAbstract.as

    package {}

    import flash.display.Sprite;
    import flash.net.NetConnection;
    to import flash.net.NetStream;
    import flash.media.Video;

    SerializableAttribute public class PlayAbstract extends Sprite {}
    Instance of the PlayAbstract class
    private var conn: NetConnection;
    private var stream: NetStream;
    private var vid:Video;
    private var flick:String = "adp.flv";

    Construction
    public void PlayAbstract()
    {
    var regarderit = new PlayVideoAbstract(conn,stream,vid,flick,100,50);
    addChild (playIt);
    }

    }
    }

    PlayVideoAbstract.as

    package {}
    The library import
    Flash.netnetconnect
    import flash.net.NetConnection;
    Flash.net.NetStream
    to import flash.net.NetStream;
    Flash.Media.Video
    import flash.media.Video;
    Fash.Display.Sprit
    import flash.display.Sprite;

    Make the grade
    SerializableAttribute public class PlayVideoAbstract extends Sprite {}
    Manufacturing construction
    public void PlayVideoAbstract (nc:NetConnection, ns:NetStream, vid:Video, flick: String, xpos:uint, ypos:uint) {}
    NET connection
    NC = new NetConnection();
    NC. Connect (null);

    NS = new NetStream (nc);

    vid = new Video();
    vid.attachNetStream (ns);

    NS. Play (Flick);

    VID.x = XPos;
    VID.y = YPos;
    addChild (vid);

    }
    End of the constructor
    }
    }

    Hello:

    your code has a lot of bug, I have fixed something bug and have it tested, already it works very well.


    PlayAbstract:

    package {}
    import flash.display.Sprite;
    SerializableAttribute public class PlayAbstract extends Sprite {}
    private var flick:String = "adp.flv";
    public void PlayAbstract() {}
    var playIt:PlayVideoAbstract = new PlayVideoAbstract(flick,100,50,stage);
    }
    }
    }

    PlayVideoAbstract:

    package {}
    import flash.net.NetConnection;
    to import flash.net.NetStream;
    import flash.media.Video;
    import flash.events.NetStatusEvent;
    public class PlayVideoAbstract {}
    private var nc:NetConnection;
    private var ns:NetStream;
    private var vid:Video;
    private var flick: String;
    private var xpos:uint;
    private var ypos:uint;
    private var obj:Object;
    public void PlayVideoAbstract (String Flick, Xpos:uint, Ypos:uint, Obj:Object) {}
    Flick = Flick;
    PosX = Xpos;
    YPos = Ypos;
    obj = Obj;
    NC = new NetConnection();
    nc.addEventListener (NetStatusEvent.NET_STATUS, netStatusHandler);
    NC. Connect (null);
    function netStatusHandler(event:NetStatusEvent):void {}
    Switch (event.info.code) {}
    case "NetConnection.Connect.Success":
    connectStream();
    break;
    case "NetStream.Play.StreamNotFound":
    trace ("stream not found:" + flick);
    break;
    }
    }
    function connectStream (): void {}
    NS = new NetStream (nc);
    ns.addEventListener (NetStatusEvent.NET_STATUS, netStatusHandler);
    NS.client = new CustomClient();
    vid = new Video();
    vid.attachNetStream (ns);
    VID.x = XPos;
    VID.y = YPos;
    NS. Play (Flick);
    obj.addChild (vid);
    }
    }
    }
    }
    class CustomClient {}
    public void onMetaData(info:Object):void {}
    trace ("metadata: duration =" + info.duration + "width =" + info.width + "height =" + info.height + "framerate =" + info.framerate);
    }
    public void onCuePoint(info:Object):void {}
    trace ("cuepoint: time =" + info.time + "name =" + info.name + "type =" + info.type);
    }
    }

    Good luck and success to you!

  • In FLex and Flash action script

    Please give me advice.

    I understand just that flex and different flash actionscript?

    If so can you give me the reference material action script in flex?

    ActionScript is the same in flash & flex.   Think that flex is a framework actionscript for the flash player.

  • Interpolation with action script + / from a fixed location

    I know the basics of the interpolation with action script, but I have a picture located in the center of the stage at x = 50.  With a click, I, move this photo - 10 x from this position if it will end the interpolation at 40.  A different button, I would make the oppositie, + 10 x to its current position and if it was at 40 you come back at the beginning and if it was at the beginning, it would be at age 60.

    Thank you

    You can use:

    prevTX.onRelease = function () {}

    this.useHandCursor = false;

    nextTX._visible = true;
    prevTX.enabled = false;
    nextTX.enabled = false;

    addition of the var: number = 100 + thTX._x;
    var myTween1:Tween = new Tween (thTX, "_x", Strong.easeOut, thTX._x, addition, 3, true);
    myTween1.onMotionFinished = function() {}

    prevTX.useHandCursor = true;
    prevTX.enabled = true;
    nextTX.enabled = true;

    }

    }

  • I try to install an air 320u sierra wireless card and I get an error message "could not access vb run time for custom action script. Cannot install the Manager of mobile broadband services.

    could not access vb run time for custom action script

    I try to install an air 320u sierra wireless card and I get an error message "could not access vb run time for custom action script.  Cannot install the Manager of mobile broadband services.  Any ideas?

    Hello

    I suggest you run the fixit and see if it helps:

    http://support.Microsoft.com/mats/Program_Install_and_Uninstall

    Also check out this link:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-windows_programs/error-2738-could-not-access-VBScript-run-time-for/1a4499ae-8bc1-4534-9c6f-4d399ac70d9a

    It will be useful.

Maybe you are looking for

  • Office 365: sync problems

    Hello I recently installed Office 365 for Mac (personal subscription) but in the calendar and Contacts, I see only local files (on my computer): E-mails work rather well. I already asked the community of office, but they have no idea about Mac produc

  • Safe to upgrade to El Capitan Yosemite?

    It's confusing. I read a lot of discussion. I guess I still need help from you guys. Attached is my Etrecheck report. No alarming red in there. My question: is it safe to upgrade to El Capitan? I'll make a Time Machine backup first, of course. What i

  • HP Pavilion g6: error when trying to dual boot Windows 7 and Windows 8

    OK, just seems to have a problem trying to start Windows 7 Setup, it says - no boot device - insert boot disk and press any key. For now, I guess it is a related issue of BIOS, but it could be a software related issue. I can't seem to find much on th

  • Impossible to associate Microsoft Bluetooth Mobile Keyboard 6000 with XP

    I can't pair my Microsoft Bluetooth Mobile Keyboard 6000 with my XP laptop. I am running 2002 Profession of XP SP 3. My laptop is able to find the device but it freezes on the screen of security configuration. When I select the matching device I get

  • used to power jet on scottrade now can not

    I used to be able to get on Scottrade, now I can't get on the site.