Flash :: Convertion BitmapData?

Dec 8, 2009

I'm trying to load several jpeg images dynamically XML into bitmapdata object in fla. I can see them on the stage of this .swf file.However, I load it into another .swf which is my main to call while clicking on one of menu option.I got this error:Error #1034: Type Coercion failed: cannot convert com::Fashion@1daf4ca1 to flash.display.MovieClip.Does anyone know how to convert that??

private function initBitmapFile(file:String):void
{
loadBMP = new Loader();

[code].......

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Voice Recorder + Mp3 Convertion?

Feb 11, 2011

i'm trying to make a on line voice recorder + server upload. Today, i can do it in wav format, but i really wish to record it in mp3 or wma or other format so i can record small files. The actionscript is:

[Code]....

View 1 Replies

ActionScript 1/2 :: Convertion From A Code Put Into A Movie Clip Into 1 Put Into The Timeline?

Nov 21, 2011

i could how to change this conpatible to timeline.
 
onClipEvent (load) {
//data you may want to change
width = 550;
height = 400;
speed = 0.1;

[Code]...

View 3 Replies

ActionScript 3.0 :: Convertion To C++ - Modal Window And Nested Functons?

Aug 14, 2009

I'm converting some code form C++ to AS3 ... and in C++ have so called Modal window ... lets say we have an function in C++ like this

Code:

CYESNO m_yesno=new CYESNO();

if(m_yesno.DoModal()==IDYES) {[code]....

a know that this can be achieved with events, and with breaks the code into several functions ... but i don't want that ... i want to keep things simple.just when i call CYESNO m_yesno=new CYESNO(); the code stops and after selecting an option, then code continues to execute from corresponding if() block in the same function.i thought that nested functions will help me but unfortunately i was wrong.Or not ?

View 1 Replies

ActionScript 2.0 :: Flash 8 BitmapData - Getting Error : The Class Or Interface 'BitmapData.loadBitmap' Could Not Be Loaded?

Jan 31, 2007

I'm using Flash 8, with this code in the first frame:

import flash.display.BitmapData;
rissa._x=Stage.width/2;
rissa._y=Stage.height/2;[code].....

When I publish the file, I'm getting the following error message in the Output panel:

**Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 7: The class or interface 'BitmapData.loadBitmap' could not be loaded.
var plaid:BitmapData.loadBitmap("plaid");

Total ActionScript Errors: 1 Reported Errors: 1

View 8 Replies

ActionScript 3.0 :: Error #2015: Invalid BitmapData At Flash.display::BitmapData()

Oct 14, 2009

I am trying to use the reflect class from "http://pixelfumes.blogspot.com/2007/03/reflection-class-v3-with-source .html" but I keep getting this error:
 
ArgumentError: Error #2015: Invalid BitmapData.
at flash.display::BitmapData()
at Reflect()
at Site_fla::GalleryPage_29/loadThumbs()
at Site_fla::GalleryPage_29/sortXML()

[Code]...

btw, first I used assigned thumbContainer as the mc argument (outside the loadThumbs() function) and it worked but not exactly what I wanted... because I thought it is supposed to update when the movieclip is animated but it actually didn't... when I use a scroller, only the thumbs that are first loaded to the stage get the reflection..

View 10 Replies

Actionscript 3 :: Quickly Rotate The Pixels That Make Up BitmapData Without Using BitmapData.draw()?

Dec 29, 2011

I've been using BitmapData.copyPixels() to draw graphics onto a canvas (Bitmap).I need to rotate the resulting graphics without the use of draw() because it's vastly slower.How can I rotate the target graphic? I'm assuming that there might be a formula or library that I can use which will first reorganize the pixels that make up a graphic based on an origin (point) and radians.I'm pretty certain that I'm not capable of creating such logic, so if there are any known libraries that do this, that would be awesome.I'd like to achieve something similar to XNA's SpriteBatch.Draw() method, which accepts rotation as its 5th argument.

View 3 Replies

ActionScript 3.0 :: BitmapData.hitTest - What Angle Or Coordinate Of The BitmapData The Collision Happens?

Sep 1, 2011

how to use the bitmapData collision method. Now I'm trying to figure out if there is a way to see at what angle or coordinate of the bitmapData the collision happens? I need it in order to figure the accurate bounce angle after the collision occurs.

View 2 Replies

Flex :: AddChild A BitmapData Or Draw A BitmapData To Screen?

Jul 15, 2009

I'm currently working on a flash game and I need to know how to addChild a BitmapData or draw a BitmapData to screen. If I can't than how can I give a DisplayObject my BitmapData?

View 2 Replies

ActionScript 3.0 :: BitmapData = New BitmapData(); Eating Up Memory?

Dec 22, 2011

I've made a mobile version of my software, with low-res images and such, and I can now fully buffer all my content (including a 360 frame animation which is buffered to memory). Problem is, that everytime I update the view, more memory is used.When I write image = new BitmapData();, does it store the previously created BitmapData's in memory? Do I have to flush the memory somehow before I draw my second picture in BitmapData?Example:

ActionScript Code:
// In this example I draw using the same bitmapData several times, also
//overwriting the first image. Do I have to somehow delete the data first, to

[code].....

View 1 Replies

ActionScript 3.0 :: Using BitmapData.draw(stage) - Error #2123 Security Sandbox Violation: BitmapData.draw

Jan 9, 2012

I am having an issue with using BitmapData.draw(stage). I am getting the following error:

SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: file:///C|/Documents%20and%20Settings/bla...bla...bla.swf cannot access null. No policy files granted access. Here is a portion of my code:

var bd:BitmapData = new BitmapData(2800, 2100); bd.draw(stage);//this is where the error happens All of the files referenced (.xml/.jpg/.swf) are located in the same local folder as the main .swf. How do I get around this error? The main objective is to print the stage using PrintJob(). I am using Flash Professional CS5.5 and publishing to Flash 10.0/10.1. Let me know if I need to supply any more info.

View 4 Replies

Actionscript 3 :: Graphic Object BitMapData Type The Same As BitmapData Type?

Dec 29, 2009

The title might be a little misleading. Look at my code and I will explain

public static function loadTile(tileDir:String = "empty"):void
{
if(tileDir != "empty")
{
tPoint = new Point(0,0);
tRect = new Rectangle(0,0,30,30);

[Code]...

I am trying to do tiling with sprites. I want my tiles to be interactive, so that is why I am using the sprite object instead of using regular bitMaps to represent my tiles. You might be wondering why I wouldnt just use graphics.beginBitmapFill(tImage); and graphics.drawRect(0, 0,tWidth ,tHeight ); to pick out the tiles I want to use. Well reason being is because it turns out that drawRect() first and second parameters actually alter the location of where the actual sprite sits at.

So if I set the x and y properties of the sprite to x = 20, and y = 20. then I set my drawRect(20,20). it actually adds an extra 20 pixels to my x and y coords of my sprite. And I know the reason why, I just need to know a better way.

View 2 Replies

Flash - Cut A Shape Out Of BitmapData?

Dec 5, 2010

I have a filled Shape, and a BitmapData that is the same width and height as the Shape's bounding box. I need to cut the Shape from the BitmapData (basically draw the BitmapData onto the shape...) [URL]I use the rather hackish method of:

public static function cutPoly(img:BitmapData, s:Shape, bounds:Bounds):BitmapData {
var temp:BitmapData = new BitmapData(bounds.width, bounds.height, true);
Main.inst.stageQuality("low"); //hack to kill anti-aliasing

[code]....

View 4 Replies

Flash :: How To Use BitmapData.fillRect()

Jun 6, 2010

When I use it, the only thing that is filled is a white rectangle, doesn't matter the parameter.This is what I do:var map:Bitmap = new Bitmap (new BitmapData(200,200))map.bitmapData.fillRect(new Rectangle(0,0,100,100),0xFF0000)A 100x100 rectangle is added to the bitmap, but it is always a white shape. I want it to be red, as set in the parameter (0xFF0000).

View 1 Replies

ActionScript 3.0 :: Can A Flash.display BitmapData Object Be Converted To Flash.displayObject

Nov 14, 2009

Can a flash.display bitmapData object be converted to flash.displayObject? i bump with an error when i tried to convert a bitmapData to DisplayObject

=> setChildIndex(DisplayObject(bitmapData),0);
"TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::BitmapData@35f4779 to flash.display.DisplayObject."

View 2 Replies

Flash - Using Array Bitmapdata To Record Video From Webcam And Generate Flash Movieclip File?

Sep 8, 2009

is there any sample on using array bitmapdata to record video from webcam and generate flash movieclip file? i want to record sound as well without using red5/flash streaming server

View 3 Replies

Flash :: BitmapData.draw Method Or Bug?

Oct 2, 2009

I have problem when drawing transparent png image on transparent bitmapData.

code of first frame:
 
stop();import flash.display.Bitmap;import flash.display.BitmapData;import flash.display.BlendMode;import flash.geom.ColorTransform;import flash.geom.Matrix;
var bmd: BitmapData = new BitmapData(500, 400, true, 0);var bitmap: Bitmap = new flash.display.Bitmap(bmd);addChildAt(bitmap, 1);

[Code]...

View 1 Replies

AS3 :: Flash - BitmapData Of A Masked Image?

Dec 14, 2009

I am trying to take a snapshot of the masked region of an image... so, I load my image then perform the following functions:

private function manageLoadedImage(e:Event):void
{
_bitdata = e.currentTarget.content; // get the bitmap
_bithold.addChild( _bitdata ); // add the bitmap to a sprite on the stage

[Code]....

I have a movie, inside that movie I have a thumbnail editor name ThumbEdit.

ThumbEdit has a movieclip on its stage called "holder1". In the document class of ThumbEdit I create a sprite "_bithold" and place it on the stage at holder1.x and holder1.y. When the image loads, I add the image to _bithold and then mask _bithold with a shape. So, I want to grab a snapshot of the masked region of _bithold but I'm not sure how I should go about doing that.

View 3 Replies

Flash :: Most Efficient Way To Overwrite Bitmapdata?

Jul 15, 2010

I have a bitmapdata object that is filled with n rectangles of a width of 1 pixel and of varying heights.

I want to run through a loop and remove the old rectangle and replace it with a different one.

Should I do something like reset the each bitmap column of pixels to a background color and then add the rect i want?

[Code]...

View 1 Replies

Flash :: Check When BitmapData Is Valid?

Feb 3, 2011

I have a very complex Flash application (think Photoshop in Flash).

There is a lot of image manipulation, and all is working well with the exception of one bug.

The application has an undo/redo feature that sometimes throws an error. There is way too much code to paste here, but the issue revolves around this line of [code]...

View 3 Replies

Flash :: Alternative To Bitmapdata For Snapshotting?

Jul 4, 2011

I'm currently loading a remote swf through as3 (with a domain policy to allow all from that domain - the policy file can't be changed by myself), that i want to take a snapshot of. The problem is that the main swf that i load, is loading child swf's from another domain that does not have the allow all policy turned on.. This makes the snapshot feature call a "sandbox security" error. I'm wondering if there's an alternative to the bitmapdata draw function to still take a "snapshot" without conflicting the sandbox security.

View 3 Replies

Flash :: Use HitTest Between BitmapData And An Object?

Aug 23, 2011

I have converted a PNG into a bitmap, then converted that into bitmapData.

I have a object called _player, and I wish to add collision detection, however I can seem to get it to work.

my code is:

if(bmd1.hitTest(new Point(_player.x, _player.y))){
trace("hit");
}

bmd1 is my bitmapData,_player is the object is wish to test against.

I am getting the following error:

1136: Incorrect number of arguments, Expected 3

I have looked around but cannott find what argument I am missing

I have tried

if(bmd1.hitTest(new Point(_player.x, _player.y), 50, _player)){
trace("hit");
}

I should mention that the reason for me taking this approach is that I have a PNG, with transparent areas, I need to test for collisions in the non-transparent areas, which is why I was using this approach

I have a PNG, i import that and convert to bitmap, then convert to bitmapData

View 3 Replies

Flash - How To Check If BitmapData Empty

Sep 2, 2011

I have a code to erase a masked movieclip. I would like to know how I can check if the whole movieclip is been erased. So I thought I had to check if the BitmapData is empty. How can I check if every pixel of the movieclip has been erased?

if (erasableBitmapData = empty){
trace("empty")
} var lineSize:Number=40;
var doDraw:Boolean=false;
var resumeDrawing:Boolean=false;
[Code] .....

View 2 Replies

Flash :: Add BitmapData To A NetStream Publishing To A FMS?

Oct 28, 2011

A webcam feed is published to a Flash Media Server. Now I want the Augmented Reality layer to be a part of this video capture, rendered into one NetStream.

Has anyone done something like adding a watermark to a NetStream before?

View 2 Replies

AS3 :: Flash - Upload BitmapData To A Server?

Jan 13, 2012

I have bitmapData. I want to upload it to a server using URLLoader. I tried many ways, but with no result.This is my current code in ActionScript 3:

import flash.net.URLLoader;
import flash.net.URLRequest;
import mx.graphics.codec.JPEGEncoder;

[code].....

View 3 Replies

Php :: Why Is The Bitmapdata Not Posted To Server Side With Flash

Jul 3, 2010

Here is the code I used to post the bitmapdata to server side(PHP):

private function savePicToServer(bmpData:BitmapData):void
{
trace("in savePicToServer");
trace(bmpData);

[code].....

Finally the trace output is :

in savePicToServer
[object BitmapData]
finish savePicToServer

View 1 Replies

Flash :: Uploading BitmapData Using Facebook Graph Api?

Feb 1, 2011

I've been looking around the internet on how to use the PostRequest class given by the Facebook in their Graph Api, but I couldn't find anything on it. I'm wondering how to use it to upload a bitmapdata. It just doesn't seem to be moving at all

[Code]...

Both doesn't work, which puzzles me. The first one worked without encoding it in any way, so I don't get why it doesn't work when I try to just call it like that.

View 1 Replies

Actionscript :: Image From Flash BitmapData To PHP To Webpage

Apr 6, 2011

I'm trying to display an image exported from a flash BitmapData in a basic webpage.[code]the above code does NOT work, I can't find a way to display the image embedded in the webpage.

View 2 Replies

Flash :: Use BitmapData.draw With NetStream.appendBytes?

Apr 9, 2011

I am using NetStream.appendBytes() to play a local video (no server involved) in Adobe AIR. I would like to use BitmapData.draw() to take a picture of the video output, but I am getting this error:

Error #2123: Security sandbox violation: BitmapData.draw: cannot access null. No policy files granted access.

Here is some sample code:

package
{
import flash.display.Sprite;
import flash.filesystem.File;

[Code].....

This is only sample code use for an explanation. The error would happen when calling the getImage method while the video is playing. The error mentions a policy file not found. Since the file is loaded locally there isn't really a place to put a policy file. Is there a policy setting somewhere that needs to be set or is the BitmapData.draw feature just not available when using appendBytes?

View 5 Replies

Flash :: Show A Bitmap Which Is Only A Portion Of Its BitmapData In AS3?

May 14, 2011

I am writing a screen scroller for a game I'm making. There's a BitmapData object which holds the background graphic, yet I do not want to show/render it on screen all at once.

For example, I want to show only a 500x500 section of the data but the entire BitmapData is 1000x1000. I wanted to use the scroll() method to scroll the data but my problem is that I cannot restrict how much of the BitmapData is drawn on the Bitmap. I tried setting the height/width properties of the BitmapData to 500x500 (and draw all the 1000x1000), but any data drawn beyond the boundaries I defined is not really drawn.

Another option I considered is to store a different BitmapData object which holds the entire data, and then use copyPixels() from it to the one used on the Bitmap itself, although then I cannot use scroll() and have to use different methods to achieve scrolling.

View 4 Replies







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