ActionScript 3.0 error messages

Hello people, I am currently creating an application that allows the user to load a jpeg file, manipulate it presets using different button, then press save to JPEG, and I'm getting these error messages!

1061: call to a possibly undefined method save through a reference with static type flash .net: FileReference-> This is the error I get to try to get the record button to work

1013: attribute private may be used only on the property of the class definitions.-> This is the error message to try to get the load image button to work

I am using flash CS3, FP9

This is the code I have...

import flash.display.BitmapData;

Import 12345678910111213import;

import flash.display.Sprite;

import flash.filters.DropShadowFilter;

Import fl.motion.Color;

import flash.events.Event;

import com.adobe.images.JPGEncoder;

var filterArray = new Array();

btnSave.addEventListener (MouseEvent.MOUSE_DOWN, saveJPGimage);

function saveJPGimage(Event:MouseEvent):void {}

var imageCapture:BitmapData = new BitmapData (295, 225);

imageCapture.draw (sp, null, null, 'normal', new Rectangle (10, 10, 295, 225), true);

var jpgEncoder:JPGEncoder = new JPGEncoder (80);

var jpgBytes:ByteArray = jpgEncoder.encode (imageCapture);

var fileRef:FileReference = new FileReference();

fileRef.save (jpgBytes, "" output. "") JPG');

}

btnBlur.addEventListener (MouseEvent.MOUSE_DOWN, BlurImage);

function BlurImage(evt:Event):void {}

var myBlur:BlurFilter = new BlurFilter();

filterArray.push (myBlur);

trace (filterArray);

SP.filters = filterArray;

}

btnGlow.addEventListener (MouseEvent.MOUSE_DOWN, GlowImage);

function GlowImage(evt:Event):void {}

var myGlow:GlowFilter = new GlowFilter();

filterArray.push (myGlow);

trace (filterArray);

SP.filters = filterArray;

}

btnReset.addEventListener (MouseEvent.MOUSE_DOWN, resetImage);

function resetImage(evt:Event):void {}

filterArray = [];

sp.blendMode = BlendMode.NORMAL;

SP.filters = filterArray;

}

btnSharpen.addEventListener (MouseEvent.MOUSE_DOWN, sharpenImage);

function sharpenImage(evt:Event):void {}

sharpen var: Array = [0, - 1, 0,-1, 5 - 1, 0,-1, 0];

var conv2:ConvolutionFilter = new ConvolutionFilter (3, 3, sharpen, 1);

filterArray.push (conv2);

SP.filters = filterArray;

}

btnBrightness.addEventListener (MouseEvent.MOUSE_DOWN, brightnessImage);

function brightnessImage(evt:Event):void {}

var light: Array = [0, 0, 0, 0, 1,1, 0, 0, 0, 0];

var conv2:ConvolutionFilter = new ConvolutionFilter (3, 3, brightness, 1);

filterArray.push (conv2);

SP.filters = filterArray;

}

btnDarkness.addEventListener (MouseEvent.MOUSE_DOWN, brightDown);

function brightDown(evt:Event):void {}

var light: Array = [0, 0, 0, 0, 0.9, 0, 0, 0, 0];

var conv2:ConvolutionFilter = new ConvolutionFilter (3, 3, brightness, 1);

filterArray.push (conv2);

SP.filters = filterArray;

}

btnLoad1.addEventListener (MouseEvent.MOUSE_DOWN, loadFile);

var _loadFile:FileReference;

function startLoadingFile (): void {}

_loadFile = new FileReference();

_loadFile.addEventListener (Event.SELECT, selectHandler);

var fileFilter:FileFilter = new FileFilter ("Images: (*.jpeg, *.jpg, *.gif, *.png)", "*.jpeg;) *.jpg; *.gif; *.png");

_loadFile.browse ([fileFilter]);

}

private void selectHandler(event:Event):void {}

_loadFile.removeEventListener (Event.SELECT, selectHandler);

_loadFile.addEventListener (Event.COMPLETE, loadCompleteHandler);

_loadFile.load ();

}

If you use CS3, his version of AS3 does not at all support the FileReference.Save () method.  You will need to find another way of saving a file (PHP script on the server side).

Tags: Adobe Animate

Similar Questions

  • I suddenly get a variety of error messages

    In Flash Player, I suddenly get a variety of error messages (#1009, 1069 # 2121, #1502 #, #2147) appearing in the upper left corner of my screen.  Have no idea what they mean, what causes them or how to fix them.  Someone please help.

    If you get errors ActionScript using IE 11 point 8.1 of Windows, see kb3087916 Windows Update [August] installs the DEBUG version of the Flash ActiveX in IE11 on 8.1 Windows systems (32 bit).

  • Pointing to an unavailable AS error message line #.

    Hello

    I get the error message indicates that the culprit may be on the #235 line.  I have no the number of the line anywhere.  But I must admit, I have two layers of Actions in my main script.  If line numbers are combined the two layers of actionscript?

    TypeError: Error #1034: Type coercion failed: cannot convert flash.display::BitmapData@173f8f11 to 12345678910111213import.
    function / WebsiteNew_fla:MainTimeline/RollingTractor/e WebsiteNew_fla:tractorBodyLoadComplet / WebsiteNew_fla:backWheelLoadComplete/WebsiteNew_fla:frontWheelLoadComplete() [WebsiteNew_ fla. MainTimeline::frame1:235]

    Yes.  layers do not exist in your swf file.

    Thus, to find the problematic line number add the total lines in each layer from the top layer (unless you specify a different load order).  the first layer that exceeds the number of line problem contains the line of problematic code.  subtract the total of the lines in the layers above the layer containing the problem of line number in the error message, and you will have the number of problematic line in the layer containing the problem.

  • Linkage error message

    I did a .jpg file, make the drag to the stage, convert it to button symbol, click to enable export to actionscript, then add a variable onRelease button to control a video source to video playback. When I publish, I get an error message which seems to cicuitous:

    * WARNING * the binding identifier "symbol 1" was already assigned to the symbol ' symbol 1' and impossible to assign to the symbol ' symbol 1', because binding identifiers must be unique. "" "»

    EDIT: Never mind, I found the answer - does not check export to ActionScript box. Reminder to self - spell of the expression of better research next time.

    I did a .jpg file, make the drag to the stage, convert it to button symbol, click to enable export to actionscript, then add a variable onRelease button to control a video source to video playback. When I publish, I get an error message which seems to cicuitous:

    * WARNING * the binding identifier "symbol 1" was already assigned to the symbol ' symbol 1' and impossible to assign to the symbol ' symbol 1', because binding identifiers must be unique. "" "»

    EDIT: Never mind, I found the answer - does not check export to ActionScript box. Reminder to self - spell of the expression of better research next time.

  • Image slideshow Gallery error message

    I've never posted anything before so I hope I'm in the right place! I just wanted to know if someone could help me with this request.

    I created a flash slide show gallery, by following the tutorial step by step from the following link: http://www.layersmagazine.com/flash-slideshow-image-gallery.html

    When I go to preview the slide show, I get the following error message:
    "1119: access to property may be undefined delivery through a reference with static type flash.display:SimpleButton.".

    Code has been copied exactly as it is in the link (the code as follows):

    Stop();

    Next button
    {next_btn.onPress = Function ()}
    {if(mc_content._currentframe==mc_content._totalframes)}
    mc_content.gotoAndStop (1)
    } else {}
    mc_content.nextFrame)
    }
    }

    last button
    {last_btn.onPress = Function ()}
    {if(mc_content._currentframe==1)}
    mc_content.gotoAndStop (mc_content._totalframes)
    } else {}
    mc_content.prevFrame)
    }
    }

    He seems to have a problem with the function "next_btn.onPress = function () {}" but I'm not really sure how to change!

    Any ideas would be a great help! :) Text

    The code in the tutorial was written for Actionscript 2.0. Never forget what you have to do is change your publication for Actionscript 2.0 settings. Replace the Flash Player 8 If you are still experiencing a problem in 9 (but you shouldn't).

  • Error message when running a SWF file

    Hi all
    IAM trying to run a SWF file that has its actionscript written in AS3. When I run this, I get an error message that reads

    Check the error 1030 # depth of the stack asymmetric 1! = 0.

    Can someone tell me what could be the cause?

    Thanks in advance,
    Mesha Srinivasan.

    Hi all
    I am able to find the cause for it. For AS 3 classes, during the analysis of the CBA code, each body of the method will be a set of instructions in which each statement will have a lag to it. This shift will be useful to mark targets for the branches as if instructions, everything, etc... Because these instructions contains targetoffset as parameter to which the investigation is to jump when the condition becomes true or false. The process of what I do, is do a code injection to replace the URLRequest calls. The flash file in which I got this error, I have replace the URLRequest call to my call of method and copy the following code was wrapped by an IF block. Because of code injection, I need to update the offset of the instructions with the offset value of difference. I did, but I missed the parameter jumpoffset of the if block my injected code which was the main cause of packaging. I solve this...

    Thank you
    Mesha Srinivasan.

  • Combine two tables using Actionscript Flex Applications errors

    Hello

    I have a set of Actionscript code below that I would run based on a query and have it display what are all of the selections that I posted from the checkbox elements two repeater.

    This doesn't seem to work every time when I get to the checkBox_change2 function. I still see some error messages popping up telling me that I have references null to that particular line: var selArr3:Array = selArr2.concat (selArr);

    Could someone tell me how I can get checkBox_change2() don't forget the selections, I did in checkBox_change()? I tried to use public var for the [Bindable] above but I still get the same error.

    Thanks in advance.

    Alice

    You are declaring your selArr not always correctly.
    The statement [Bindable] private var selArr:Array; is an instance variable. It is defined outside of any function and is visible from almost anything in your object.

    In your service
    private void checkBox_change(evt:Event,x:Array):void {}
    selArr:Array = [];

    selArr is defined as a local variable that is visible only in the function checkBox_change. Because the names are the same that you override the instance variable. (In reality this is not compiling correctly... your first try for var selArr:Array = [] was the valid syntax for the variable substitution)

    To remedy this, you just need to change
    selArr:Array = [] in selArr = [];

  • error message when try to sync the iPhone, "invalid response from the device?

    What can I do when I receive this error message when you try to sync to my iPhone 5 s - "invalid response from the device?

    -What are your 5 updating to 10.0.2 iOS iPhone? If this is the case, you must have the latest version of iTunes on your computer, which is required for Mac OS X 10.9.5 12.5.1, or above. To meet these specifications will be receiving this error.

  • When I press the button Add card on my phone app here is I get the error message

    Hi thanks, my cards have been on my iPhone 6plus for quite awhile. I recently bought an iwatch series 1. Watch and phone software is up to date. My app to watch on my phone recognizes my cards when I press the map button Add on my phone app here is I get the error message.

    Hello

    To be able to add cards to pay Apple on your watch, it will first the configuration of the area selected (like on your iPhone):

    • On your iPhone, in the application of the watch, go to: Watch My > general > language and region - check Format correct region is selected.
    • If they are already correct, it can help to select again the two the same Format of the region and also the language of the system itself.

    Then follow the instructions here to add cards to the Watch:

    More information:

    Pay help, add maps of Apple - Apple Support

  • is itunes error message cannot connect to my iphone because of an invalid response was received from the device

    get error message that IOS 10 unable to connect to my iphone iTunes 6 because of an invalid response was received from the device

    Make sure you are using iTunes 12.5.1 or later, as it is required to communicate to iOS 10.

    If iTunes does not recognize your iPhone, iPad or iPod - Apple Support

  • On Win 7 after update itunes Error Message error 7 (Windows error 127) whenever I have start download iTunes

    On Win 7 after update itunes Error Message error 7 (Windows error 127) whenever I have start download iTunes

    HI MikeGeorgen,

    I understand that you have updated iTunes on your Windows 7 computer, but now you see an error when you try to open it. I know it's important to have iTunes working properly, so you can sync your device, so I'm happy to help you.

    Make sure that you logged in as an administrator on your computer, and that you have the latest Windows updates. Then check out the additional troubleshooting steps that are listed here:

    Remove and reinstall iTunes and the components of the software for Windows 7 and later versions

    Thank you for using communities Support from Apple. See you soon!

  • "iPhone is disabled, connect to iTunes" AND "iTunes can not connect to the iPhone because it is locked with a password" error message on the phone and the computer! Help!

    So I recently had my password wrong too many times and my iPhone 4S locked out telling me "iPhone is disabled; Connect to iTunes'. And so I connected to iTunes and decided to restore my phone. I finished the process of restoration of the configuration of my phone, but ultimately, it was not even let me in the phone! Once AGAIN he said "iPhone is disabled; " Connect " to iTunes '. However, this time, this message appeared just when I turned on my phone with a black background. I didn't scan the screen for the error message is displayed (and there was no time to be shown). When I tried to connect to iTunes again as he asked, now it says "iTunes can not connect to the iPhone because it is locked with a password".

    So now, he said "iPhone is disabled; ' Connect to iTunes' on my iPhone 4S and ''iTunes can't connect to the iPhone because it is locked with a password ' on my computer. WHAT should I do?

    As described in step 2 of "Erase your device with iTunes" in this article, you will need to use the Recovery Mode.

    Recovery mode is described in this article as well.  You may try to go into recovery mode more than once to succeed.

    If you have forgotten the password for your iPhone, iPad or iPod touch, or your device is disabled - Apple supports

  • 10 - IOS Installation error message

    My iPhone is loaded and updated iOS are downloaded to the phone.  There are 10 GB free so space should not be a problem.

    Software update confirms 1 update to download and it is for the iOS 10.  It shows the preview of iOS 10 features etc.  When I confirm the installation, I get an error message that says: "unable to install the update. 10 iOS installation error.  Retry.  Remind me later. "  It gives no other details.

    Does anyone else have this problem?  I use the beta on my phone - do I need to uninstall the present?

    I also already backed up the phone on my computer too.

    iTunes says the phone has been updated and gives the option.

    Hi boujis, you need to put your device in recovery mode, and then click Update when you are prompted to download the public version

  • 6 s iPhone download new software error message

    Today, I downloaded the upgrade of the iOS 10 software and sync with iPhone 6s received an error message. Now the phone is stuck on the peak of the cable that need to sync with iTunes. Hit restore, update, etc. and always stuck with peak on the phone. Tried to shut down phone, disconnect usb, etc and nothing will get in the phone to see whats up. Next steps?

    Try the steps on this page - If you can not update or restore your iPhone, iPad, or iPod touch - Apple Support

  • error message 908719.emlx

    I tried to delete a large number of emails at once by digging them into the trash in Apple mail. I get this error message 'e-mail name' could not be moved to the 'Trash - job' mailbox '908719.emlx' failed to copy to 'Messages', because an item with the same name already exists. How can I clear this error?

    Greetings, sfsinfonia!

    Errors in a messaging application can be worrisome because there aren't usually has for items stored in it. I'll be happy to help you find the culprit and clear this error.

    Mail (El Capitan): rebuild the mailbox -instead of having to dig through everything, reconstruction of the mailbox will be things properly configured again.

    Thank you for using communities of support from Apple!

Maybe you are looking for