ActionScript 3.0 :: Creating Scratch Lottery Ticket Using BitmapData Class?
Nov 5, 2009
I'm trying to make an scratch lottery ticket in as3 by using the bitmapData class. The scratch function is working fine, but I want to add an function that is challenging. When 75% of the lottery ticket surface is scratched of I want to trigger an event.
My ActionScript Code:
var toolsize = skraper_mc.width;
var tooloffset = toolsize/2;
var basepoint = new flash.geom.Point(0,0);
var bitmap:Bitmap=new Bitmap();
[Code] .....
View 4 Replies
Similar Posts:
Jun 1, 2011
I have the following code
///Get BitmapData from library in SWC
var ClassReference:Class = getDefinitionByName(products[i].producticon+"Data") as Class;
// Create new BitmapData Instance From it
[Code]....
I get null in the trace. How do I make a dynamic class that I can refer to for this bitmap similar to how your reference a class from and embedded media?
View 1 Replies
Nov 16, 2011
I need to create a webcam chat which i intend to use in my website. It will allow two or more persons to video chat through their webcams.I want to develop the webcam chat from the scratch. I have no idea which software to use. I did a thorough search for this topic and alli got is adobe flash with some actionscript is required to build it.
View 1 Replies
Mar 14, 2011
I have started learning about flash about 3 years ago, I had a shot at making a small application for my boss' website and that went down well... but since this first feeling of flash, this technology has evolved rather quickly. I used to write my scripts in AS 2.0, now AS 3.0 has come with a bunch of new stuff like event listeners and such. I have tried to catch up for the past two weeks but I kind of lack some training on all the new stuff added to or changed in AS 3.0.
So to come to the problem, I have tried to make a pretty simple menu from scratch, I wanted it dynamic so I took advantage of reading data in an xml file. I have created buttons but figured that movie clips were actually more flexible so I went down this way and it kind of works except that when i click one of my buttons, the button_down state works once but not twice, it stays as the button_over state even if i click repeatedly. My script is quite ugly as I could not figure out how to loop the creation of my menu buttons from a single set of movie clips (one for the up state, one for the over state and one for the down/clicked state).
View 0 Replies
Mar 19, 2011
I want to create an online q-bank with questions pertaining to a specific medical board examination. This is similar to the way kaplan and other companies creates Q-banks for standardized exams. The reason: No banks exist for these board examinations
what tools would you use to create a Question bank that has the ability to sort questions by user settings, implement timers, keep track of overall performace, display explanations for each questions, and have the options for video explanations. Is ActionScript up to this task?
View 2 Replies
Jan 19, 2010
Are there any tutorials available that will show me how to create a multiple class program from scratch? I have 2 classes working with a fla and when I add a 3rd class every object I create comes up as an error.1120: Access of undefined property.I'm very frustrated cause I can't figure what the problem is. I have just migrated to OOP so I'm relatively new at this.
View 2 Replies
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
Apr 8, 2003
Code:
Scratch = function() {
this.previousClip = null;
this.startScratch = function(clipName) {[code].....
I'm trying to set the previousClip variable (which belongs to the Scratch-class) in the onMouseUp function. I know I'm not doing it the right way, but can someone tell me how to set a the previousClip variable properly?
View 6 Replies
Feb 28, 2012
Good day - how do i create a support request for my new Flash Media Interactive Server? I've tried to contact our Russian Adobe support - but got a reply stating, that FMS is not supported by adobe support.. Btw - how can that be?! But, nevertheless - i do need to open a support ticket, as i have several problems, which interfere with production of FMS..
View 5 Replies
Mar 17, 2011
I need to make an application to calculate your chances of winning the lottery i want to use input textfields.
View 2 Replies
Dec 10, 2003
There are two buttons and a dynamic text box in my flash. The two buttons are start and end button. When you click the start button, you will find the random data in the dynamic text box changing constantly until you click the stop button.
View 3 Replies
Oct 17, 2009
I'm trying to modify the alpha layer of a bitmapData by taking a source iamge and masking out areas that don't have the correct channel. ATM I'm using copyChannel to achieve the effect, but I'd liek more than 3 channels (use alpha kills the other channels it seems). 255, 0, 255 should be able to act as another mask.
This is what I'm doing now...
Code:
bitmap.bitmapData.copyChannel(tempMask, new Rectangle(0, 0, tempMask.width, tempMask.height), new Point(0, 0), BitmapDataChannel.RED, BitmapDataChannel.ALPHA);
So the red parts of the image mask out the source image. All I want is to be able to mask out things basic on multiple channels (the lesser of the 2).
1) How does copyChannel work? Can I just test each pixel manually and achieve relatively similar speeds? and 2) if the Flash inline functions are infact faster, is there a function that can do what I want, or would it be better to use a shader?
Code:
var tempBitmapData:BitmapData = new BitmapData(tempMask.width, tempMask.height);
var matrix:Array = [];
matrix = matrix.concat([0, 0, 0, 0, 0]); // red
matrix = matrix.concat([0, 0, 0, 0, 0]); // green
[Code].....
View 1 Replies
Nov 26, 2009
I have the following code:
ActionScript Code:
_camera = Camera.get();
_camera.setMode(320, 180, 12, false);
_video.attachVideo(_camera); //attaching to Video object
[Code]....
2) why is the image from the camera so small? It doesn't fill the 320x180 white background, it's size is actually 160x120. Is this some Flash limitation or how exactly did it get to this size?
View 3 Replies
Sep 4, 2007
I am trying to create a BitmapData object of a jpg that is loaded into a movieClip, so that I can then remove the jpg and have just the BitmapData of the image to manipulate. I have the original image loading into my temporary MC without any problems..and am using a listener to check to make sure that the image has been fully loaded before it moves onto creating an empty movie clip for the BitmapData... but for some reason the BitmapData isn't working as nothing shows up in my holderMC.. and it says the width of the holderMC is 0 when it should be something liek 367 for the 'surf.jpg' test image I am using. My code is below..
Code:
import flash.display.BitmapData;
stop();
_root.createEmptyMovieClip("tempMC", 1, {_alpha:0});
[Code].....
View 1 Replies
Aug 21, 2008
I am using bitmapdata to make me a nice lil' background image, and it works great...until it's resized. Whats happening is it's creating a new bgHolder clip on the resize, NOT resizing the current empty clip "bgHolder"
Here's the code:
import flash.display.BitmapData;
#include "mc_tween2.as"
Stage.align = "TL";
Stage.scaleMode = "noScale";
var myListener:Object = new Object();
myListener.onResize = function() {
[Code] .....
View 1 Replies
Sep 5, 2011
In my flash IDE library there's an imported jpg Image. Its class base is automatically BitmapData. How to get its data ? The following doesn't work:[code]But how to do without using away3d just for it!?
View 5 Replies
May 3, 2011
[ Embed('Assests/ui/Main.swf', symbol='backgroundImage')]
private var background01:Class;
private function getBitmapData(className:String):BitmapData[code]....
I want to return bitmapData from a symbol that is embedded in a flash swf file. background01 is the class name exported to as3 in the flash swf file. As you can see from above I'm finding the swf with no problem. and I'm pullin the data back from the swf file with no prob. I can type addChild(new background01) and the image will show up. But when I've tried to cast to a bitmap , bitmapasset and movieclip. It always returns null. I want to get access to the bitmapdata of this image/movieclip. It should be returning a vertex circle drawn in flash and created to be a movieclip symbol. So what I would expect to be returned would be a MovieClip.
View 1 Replies
Nov 4, 2008
I am working with the BitmapData class for the first time for a transition and I am running into a problem loading a new image from the array. I have modified a tutorial from flash-db by Jorge Solis. The function dissImg is firing but I can't work out how to load another image from the array into the container! Please see the code below:
Code:
import flash.display.*
import flash.geom.*
[code].....
View 5 Replies
Mar 6, 2012
I am using BitmapData to draw the objects in my game. But, I'm not sure I am using this in the best way.In each class I have a draw method where I call a renderer where copy the pixels of my object to the game canvas.For example, I have an Avatar class and its contains a BitmapData instance. There is a method where I draw my character into the bitmapdata of this class and I apply the filters or visual modification I need frame by frame. When I finish this process I copy the result to the main canvas. It is in a renderer class that contains another bitmapdata.I believe this is not the best way to render the objects of a game.
View 1 Replies
Jul 16, 2009
I'm trying to use BitmapData Class to capture an animated movieclip and adding it to the display list by using addChild, but it's causing my computer to bog down because it's adding a zillion children. what do I do to remove the old, or rather, update the current child with the new one?
View 1 Replies
Feb 17, 2011
Is there a way to generate an instance of a class that implements an interface based on the name of the class?
I am trying:
var ClassReference:Object = getDefinitionByName("movement.OuterSpaceMovement") as IMovement;
var m:IMovement = new ClassReference as IMovement;
trace("startup..." + m);
-But I am getting an error message ReferenceError: Error #1065 (OuterSpaceMovement) not defined.
I have several classes that implement the same interface (IMovement) but I need to be able to generate new instances of these classes and then pass these instances as a datatype (IMovement datatype) to other classes...
So then I tried:
var ClassReference:Class = getDefinitionByName("OuterSpaceMovement") as Class;
var m:IMovement = new ClassReference() as IMovement;
and this doesn't seem to work...but the following
var m:IMovement = new OuterSpaceMovement();
View 1 Replies
Jul 22, 2009
I'm trying to create a new instance of a MovieClip when the original one has been used. Would sound easy enough. Just use: var
instanceName:ClassName = new ClassName();
the class name/mc in the library im trying to duplicate is MCg1 so
var instanceName:MCg1 = new MCg1(); right?
However, the particular object in the library i'm trying to duplicate has a base class that is an external class file (just to control it's drag drop functionality)... i.e baseclass is not set to the standard flash.display.MovieClip, or whatever the case maybe. So i end out with a: TypeError: Error #1009: Cannot access a property or method of a null object reference.
View 6 Replies
Apr 1, 2012
I'm getting the compiler errorThe Class or interface 'BitmapData' could not be loaded. (actionscript 2.0)
View 1 Replies
Mar 29, 2010
I am using bitmapData and bitmap classes to render a mouse cursor on the display screen. The bitmapData consists of an area whose colors should be inverted according to the background color. This is a very basic thing which could be observed with text cursor(the vertical line with two small horizontals on top and bottom), when moved over the text area. want to be able to do the same with the pixels in my bitmapData, is there a way to find out the background color effectively and invert the color values? In this process i will be redrawing the whole pixels, is there any other efficient way to do that ?
View 1 Replies
May 3, 2011
I am developing an application similar to MS Paint. I am building a Flash Paint application. The basic structure is this. I have two layers namely topLayer_mc and bottomLayer_mc. The actual vector drawing is drawn on the top layer and onmouseUp of the tool, a bitmap copy of the vector graphics on the top layer is taken and added as a bitmap to the bottom layer. The top layer is cleared subsequently. It is working for the pencil tool.
Now I need to create an eraser tool. This is where things get tricky. In the application there is an option to save the image as png, so alpha has top be preserved. So the coventional method of draw a brush using the vector and using the draw method of bitmap will not work. Of course, on a visual level it would work if the brush drawn using the vector is to have the same color as that of the background. The eraser's are rectangular in shape.
The technique I am tring to use is to use the copyChannel method of BitmapData class. Specify a channels (say GREEN channel )hex value as 00 and make it as the source. Then make the destination channel ALPHA. I got it working without using movieclips as shown below.
[Code]....
View 1 Replies
Aug 7, 2009
I am trying to rebuild "Pixelator" class writen by Eric Hallander, becouse I need it for my personal site, and orginal class doesn't give me all that I need. I thought I have everythig right scripted but after compilate debuger gives me an error:
ArgumentError: Error #2015: Invalid BitmapData.
at flash.display::BitmapData$iinit()
at tmk::Pixelate/::pixelateOut()
This is code of my MainClass - calling a Pixelation effect:
Code:
package src {
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.display.Bitmap;
import flash.display.BitmapData;
import tmk.Pixelate;
[Code] .....
View 5 Replies
May 18, 2010
I'm creating a slideshow where each slide can have:- a video or a still- 1 audio track or many (up to 3)- 1 button or many (up to 3)I was thinking that each slide can be it's own object, and then I would pass the video, audio, buttons, etc., into it as parameters:
package
{
import flash.media.Video;
[code].....
View 2 Replies
Feb 12, 2009
I have a class that represents a turret in the center of my screen.When I hold down SPACE, I want it to create a "bullet"-object that moves in the direction of the turrets cannon, every frame the SPACE key is held down. I am having problems with this cause I am getting this error when I am trying to create the object:
Error #1009: Cannot access a property or method of a null object reference.
This is where the error occurs:
ActionScript Code:
public function chaingun(x_:int, y_:int, rot:int, cd:Number, spd:Number, sprd:Number, life:Number) {
this.Cooldown = cd;
this.Speed = spd;
[code]....
PS: What happens is that when I press the SPACE key, the "turret" class event handler runs the function "Shoot_Chaingun" and that function creates a new Chaingun-object (which actually is a bullet), that inherits the x, y, and rotation of the turret, along with some additional varaibles, including lifetime. Then upon creation, I use "addChild(this)" to add it to the main stage, and "removeChild(this)" once it's lifetime is up.
EDIT: And also, I just realized I don't have a MovieClip linked to this chaingun class. How do I make sure that every time a chaingun object is made, the MovieClip is also loaded?
View 4 Replies
Apr 16, 2007
I try to make a simple copy of a flv video in a new MovieClip using the BitmapData class.
Here is my code :
Code:
var video1:MovieClip = this.attachMovie("mcVideo","videoMC",1);
var objVideo = video1.v;
var _nc:NetConnection = new NetConnection();
[Code]......
View 6 Replies
Apr 21, 2009
I googled this online, and almost all of them start with dragging the scrollpane from the component toolbar.
I don't like the way this scrollpane looks. How to change the color, shapes, etc. Can I do this through altering the code, or do I need to start from scratch?
View 5 Replies