ActionScript 3.0 :: File Reference (Save) Throws Error

Apr 3, 2012

I have a code which saves a display object locally as an image file, but at some point it began throwing error 2174 (up until then it worked fine). This code is called either from a context-menu click event or a keyboard event.

var sourceBmd:BitmapData = new BitmapData(displayObject.width,displayObject.height);
sourceBmd.draw(displayObject,new Matrix(displayObject.width,0,0,displayObject.height));
var jpgEncoder:JPGEncoder = new JPGEncoder(80);
var byteArray:ByteArray = jpgEncoder.encode(sourceBmd);
try {
filereference.save(byteArray,"posterImage.jpg");
} catch (e:Error) {
Debugging.alert("error: ",e.message);
}

As you can see, the filereference has only a single action - so no reason for error 2174 to be thrown (and yes - I also have a listener for the 'cancel' event). I'm publishing for flash player 10.0

View 1 Replies


Similar Posts:


Actionscript 3 :: Ilereference 'save' Throws Error

Apr 2, 2012

i have a code which saves a display object locally as an image file, but at some point it began throwing error 2174. this code is called either from context-menu click event or keyboard event.

var sourceBmd:BitmapData = new BitmapData(displayObject.width,displayObject.height);
sourceBmd.draw(displayObject,new Matrix(displayObject.width,0,0,displayObject.height));
var jpgEncoder:JPGEncoder = new JPGEncoder(80);
var byteArray:ByteArray = jpgEncoder.encode(sourceBmd);

[Code]...

View 3 Replies

IDE :: When Clip Is Compiled, It Throws An Error : "Cannot Access A Property Or Method Of A Null Object Reference."?

Jan 14, 2009

I have this line of code:

stage.addEventListener (MouseEvent.MOUSE_MOVE, watchMouse);

which works fine when that clip is compiled. It throws an error: "Cannot access a property or method of a null object reference." When loaded into another clip.

View 7 Replies

Flex :: Throws A Warning,unlike Java, Which Throws An Error "Assignment In Conditionals"?

Aug 6, 2009

If I use an Assignment within conditional, for e.g.
if(userType='admin')

Flex throws a warning,unlike Java, which throws an error.Why should Flex be doing this, despite being one of the newest languages? 1100: Assignment within conditional. Did you mean == instead of =?

View 2 Replies

ActionScript 3.0 :: Using The New Save() In The File Reference Class

Jul 22, 2009

For a project I am working on, I allow users to drag stuff around the stage and then let them save it as JPEG. I have used the new save method from player 10. This is my code so far.

var fr:FileReference;
test_btn.addEventListener(MouseEvent.CLICK, showPic);
function showPic(event:MouseEvent):void {

[Code]....

But when I click on the button, I get the following erro

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at homev1_fla::MainTimeline/showPic()

View 4 Replies

Flex :: Error 1061 Call To Possibly Undefined Method Save Through A Reference With Static Type Flash.net:FileReference

Jun 2, 2011

I want to save XML File using Flex 4 SDK

var fr:FileReference=new FileReference();
fr.save( newXmlRow, 'D:/Sample.xml' );

Error Shows :

1061 "Call to possibly Undefined method save through a reference with static type flash.net:FileReference"

View 2 Replies

URLLoader Throws Error#2048 On Mac

Oct 19, 2009

My flash application seems to run correctly on Windows but not on a mac. It is supposed to retrieve data from a php file with the following code:.

[Code]...

When loaded directly from a browser, the php code works fine both on Windows and Mac. But the flash app throws a Error #2048 on Mac. here's the code for the app:

[Code]....

View 1 Replies

ActionScript 3.0 :: GetDefinitionByName Throws Undefined Variable Error?

Sep 17, 2008

Flash CS3 project. Can anyone explain this:

var ViewClass:Class = views.Login;
view = new ViewClass();
// ^works fine

[code].....

View 2 Replies

ActionScript 3.0 :: URLRequest With Https:// Throws Error#2032?

Mar 9, 2010

I am trying to load a sample.xml usinghttps://, When I try loading I get Security Alert pop up. After I accept & even if I install the certificates It fails to load the XML file and  IOErrorEvent gets called. How to load a XML files from secured server using https:// ?
 
Code I am trying is :
var loader:URLLoader = new URLLoader();  configureListeners(loader);
var request:URLRequest = new

[code].....

View 3 Replies

Flex :: FFlexCover 0.81 Throws ServicesDepdendency Error No Matter What

Oct 8, 2009

I've used FlexCover quite a bit before so this is absolutely absurd to me. No matter what version of the flex sdk (3.0, 3.2, or 4) that I apply the appropriate patches too, I get the following error when trying to compile:[code]I have absolutely no idea why this is happening. One thing that is odd however (and I'm hoping is the source of my problem) is that I can NOT download the SDKs that are specifically suggested by the Flexcover documentation. Copying folders on Mac OS X does not merge them and so I was losing the original jar's that needed to stay there.

View 1 Replies

Actionscript 3 :; URLStream Throws Error # 2029 In Flex AIR App?

Nov 2, 2010

In my AIR app,I am trying to implement a file downloader using URLStream.


public class FileDownloader {
// Class to download files from the internet
Function called every time data arrives[code].....

I simply create an object of the above class and passing the url and the file and call the load function. For some files I get the following error.

remotePath: http:[url].....error while writing bytes from...Error:Error #2029: This URLStream object does not have a stream opened.Which means the error is from the file stream(fileAccess) that I am using. I am unable to figure out why this could be happening. If I try to open the url http:[url]... in the browser, it opens properly. This happens randomly for some files.

View 1 Replies

Flex :: Papervision3D Throws An Error When A 3D Object Is Clicked?

Aug 25, 2011

I am working on a game in which there are several Plane objects that the player can click. My main application class extends the BasicView class. I made this whole game as an ActionScript project and everything works fine when I run it as one.

Now I load this game in a Flex application. When added to the Flex application, it runs perfectly until I click somewhere at which point it throws the following error:

undefined
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at org.papervision3d.core.utils.virtualmouse::VirtualMouse/update()[D:Omer

[Code]......

View 1 Replies

ActionScript 3.0 :: Russian Text Throws Error 2032

Jan 27, 2010

I'm having some trouble understandig this. What i'm doing is using a very basic urlLoader to send text to an ASP. Everything works just as expected using English and Swedish, but if i try and send some Russian (cyrillic) Flash throws an error 2032 on a script working flawless up to this point. Am i missing the obvious here? the first one to admit never worked with russian thext in this fashion before, does it need special encoding or is there something i need to do to make this work?

View 1 Replies

ActionScript 3.0 :: FileReference Throws Error On Domain With Htpasswd?

Apr 9, 2009

I'd never used FileReference on a domain protected by htaccess and htpasswd. I'm getting I/O and Stream errors when my SWF is hitting those PHP scripts. I know I can host the PHP on an unprotected domain, but I'd prefer not to do that.

View 3 Replies

ActionScript 3.0 :: FileReference Throws Error On Domain With Htpasswd

Feb 12, 2011

I'd never used FileReference on a domain protected by htaccess and htpasswd. I'm getting I/O and Stream errors when my SWF is hitting those PHP scripts. I know I can host the PHP on an unprotected domain, but I'd prefer not to do that. Is there a Security item I can use to get past the Errors, or maybe something in the PHP?

View 2 Replies

Flash :: AS3 - Using For / Do Loop With Many Movieclips Throws Implicit Coercion Error

Oct 21, 2011

I have the following function constantly running to check for collision between a player-controlled ball (mcBall) and a number of walls (aptly named mcWall1, mcWall2, etc.): (the var numberofwalls gets its own value in each different frame where there is a different number of movieclips.)

[Code]....

View 1 Replies

ActionScript 3.0 :: #1009 - Error Throws When Doing Multi Select On Tree Nodes

Feb 14, 2011

whenever i try to select multiple nodes in tree component i'm getting this error. i want to know what might be the cause for this error.

[Code]...

View 1 Replies

Javascript :: Returning A Byte String To ExternalInterface.call Throws An Error?

Jan 21, 2010

I am working on my open source project Downloadify, and up until now it simply handles returning Strings in response to ExternalInterface.call commands.

I am trying to put together a test case using JSZip and Downloadify together, the end result being that a Zip file is created dynamically in the browser, then saved to the disk using FileReference.save. However, this is my problem:

The JSZip library can return either a base64 encoded string of the Zip, or the raw byte string. The problem is, if I return that byte string in response to the ExternalInterface.call command, I get this error:

Error #1085: The element type "string" must be terminated by the matching end-tag "</string>"

ActionScript 3:

var theData:* = ExternalInterface.call('Downloadify.getTextForSave',queue_name);

Where queue_name is just a string used to identify the correct instance in JS.

JavaScript:

var zip = new JSZip();
zip.add("test.txt", "Hello world!
");
var content = zip.generate(true);
return content;

If I instead return a normal string instead of the byte string, the call works correctly.I would like to avoid using base64 as I would have to include a base64 decoder in my swf which will increase its size.

Finally: I am not looking for a AS3 Zip generator. It is imperative to my project to have that part run in JavaScript

View 2 Replies

Flex :: Application Throws Error When Making Http Call (GET Request)?

Jun 13, 2011

I get following error occasionally while running my flex application. I dont know what is wrong as it works intermittently.

Error occured (mx.messaging.messages::ErrorMessage)#0
body = ""
clientId = "DirectHTTPChannel0"

[code].....

View 1 Replies

ActionScript 3.0 :: Delay A For Loop - Throws An Error Saying It Can Only Perform One Upload At A Time?

Feb 9, 2010

I'm writing an upload program to upload multiple files. It works great as long as I only upload one file but as soon as I add a second file it throws an error saying it can only perform one upload at a time.Is there a way I can have it not loop back through the for loop until the upload has completed?Here is a chunk of my code

Code:
for(var q:int = 0; q < selectedFileArray.length; q++)
{
trace("Loop marker 1");[code].....

View 4 Replies

Flash :: Robotlegs Module Throws Null Pointer Exception (Error #1009)?

Feb 8, 2012

I have a problem with an application that uses RobotLegs in a Flex module. I finally managed to load my module successfully, but when I try to add this line of code in the module view's Mediator:view.addElementAt(applicationContainer,0);

I get this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.core::UIComponent/getStyle()

[code].....

View 1 Replies

ActionScript 3.0 :: Error #2174 (only One Download, Upload...) With Two File Reference Objects?

Jan 11, 2010

I've got a situation that involves error #2174. Flash 10 apparently doesn't allow more than one upload/download/load/save at a time, but my code doesn't actually do that. A skeleton:

ActionScript Code:
private function uploadFile(endpoint:String):void
{

[code].....

View 4 Replies

ActionScript 3.0 :: Error #1009: Cannot Access A Property Or Method Of A Null Object Reference - File Doesn't Own CS4

Sep 2, 2010

I'm experiencing a problem that I've having difficulty solving. I built a project in CS4 using AS3. Everything worked fine. Unfortunately, it needed to be accessible via CS3 (the person using the file doesn't own CS4). No problem. I converted it to CS3 - and now I'm receiving this error:

[Code]...

View 7 Replies

ActionScript 3.0 :: Compiler Is Throwing That 1000: Ambiguous Reference Error For Any Reference ?

Sep 3, 2007

I'm having this frustrating error showing up and I have no idea why. Let me show you my classes and see if you can spot anything wrong.
First, here's my ILode interface:

ActionScript Code:
package com.schelterstudios.lodeSystem.flash.lodescode].....

So the problem I'm having is the compiler is throwing that 1000: Ambiguous reference error for any reference to instance.priority or instance.label. Why??? Instance is typed to IFlexLodeInstance, and IFlexLodeInstance lists method signatures of priority and label getters, and it inherits ILode, which lists method signatures for priority and label setters. What can I do to get the compiler to stop complaining?

View 9 Replies

Actionscript 3.0 :: Remoting Call Throws Code=NetConnection.Call.BadVersion Error

Sep 27, 2009

I'm trying to get the AS3 Flash remoting example found here: [URL]. and I keep getting this error: Code: Select allError #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Call.BadVersion at amfphp1_fla::MainTimeline/frame1() Here's the code I'm trying:

[Code]....

View 1 Replies

Css :: Flex 3 Embed Throws "Invalid Embed Directive In Stylesheet' Error On Linux

Mar 9, 2010

We have a flex application which compiles fine on windows box using mxmlc ant task but when we try to run the same build scripts on linux, it throws the 'Invalid Embed directive in stylesheet' error indicating it is not able to resolve the path to the image files.

Can someone pls. educate me on if there is a difference in the way the image files are looked up, in a CSS file, on windows vs linux.

Flex sdk version is 3.3. The same sdk is used on both windows and linux. Not sure if this has been fixed by any future 3.x sdks.

View 2 Replies

Actionscript 3.0 :: Make A Public Static Method Call Another Method, But Flash Throws Error 1180?

Feb 19, 2010

I'm tryng to make a public static method call another method, but Flash throws error 1180, sayng that the method called by the static method is undefined.

Code: Select allpackage
{
import flash.display.MovieClip;[code]....

View 2 Replies

ActionScript 3 :: Save File Locally In Flash Without Displaying Save Dialog

Jan 31, 2010

How do we save file locally in Flash (ActionScript 3) without displaying dialog. I know we can use the following code to save file locally but it prompts Save dialog. I don't want this dialog while saving file locally.

[Code]...

View 3 Replies

ActionScript 2.0 :: Save File By Prompting Save Window?

Nov 21, 2006

I need to create a notepad in flash.here how could i save the file by prompting the save window?

View 11 Replies

Professional :: TypeError: Error #1009 - (Null Reference Error) With Flash?

Jun 13, 2010

I am not an expert in flash, but i do work with AS and tweak Flash projects , though not having deep expertise in it. Currently i need to revamp a flash website done by one another guy, and the code base given to me, upon execution is throwing the following error."--- TypeError: Error #1009: Cannot access a property or method of a null objectreference.atNewSite_fla::MainTimeline/__setProp_ContactOutP1_ContactOut_Contents_ 0() at NewSite_fla::MainTimeline/frame1() --"The structure of the project is like, it has theifferent sections split into different movie clips. There is no single main timeline, but click actions on different areas of seperate movie clips will take them between oneanother.All the AS logic of event handling are written inline in FLA , no seperate Document class exists.

Preloader Movie clip is the first one getting loaded. As i understood the error is getting thrown initially itself, and it is not happening due to any Action script logic written inline, because it is throwing error even before hitting the first inline AS code.I am not able to figure Out what exactly it causing the problem, or where to resolve it. I setup the stuff online, for reference if anybody want to take a look at it, and here is the link.You need to have flash debugger turned ON in your browser, if need to see the exception getting triggered.

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved