ActionScript 3.0 :: Creating A Percentage Of Marked Objects From A Bag?

Feb 2, 2011

i've had good feedback and help from these forums before so thought i'd pick your brains again...

I'm looking at making a sim/game based around random results. The experiment im supporting has (for example) 100 rubber ducks in a bag, you pick out 30 and mark them with a cross and place them back in the bag. Then you pick another 30 and note how many of the marked ducks you have found again.

I have some knowledge of Flash and have managed to make a random dice simulator and a few others. I figure the best way is to forget about manually marking the ducks but instead have a drop down box where you can sellect how many of the 100 will be marked.Then have an action button which produces the results (in numbers?) underneath each corresponding duck (1 normal yellow, one marked).

View 32 Replies


Similar Posts:


ActionScript 2.0 :: Creating A Percentage Progress Bar, With Day Change?

Apr 1, 2012

I have a project portal for software development. To show my team, how far we are in development, i created a graphic showing a progress bar, and a percentage number.

Every now an then, i open flash, and change the percentage number, and scales the progress bar a bit.

My question here is:

Can i make the Percentage number change from (currently) 22% to 100% (22, 23, 24 etc), over the duration of 30 days? So it automatically changes 2-3 times a day?

Can i also make a progress bar that scales automatically, and slowly becomes longer and longer, to match the Percentage number?

View 2 Replies

Flash :: Recycle Objects When Creating An Array Of Objects?

Dec 18, 2011

Is this the correct, most efficient way to recycle objects when creating an array of objects?

package com {
public class CreateList extends MovieClip {
//this is the object I will be recycling
private var newProperty:PropertyRow;
//this is the array I will use to reference the objects

[Code]...

View 2 Replies

ActionScript 3.0 :: Local Variables / Object Need To Be Marked When Set To Null?

Jul 1, 2011

If I have a variable that is declared within a method of a class, should that variable EVER need to be marked for garbage collection (set to null).

For example:
Code:
public class MyClass extends MovieClip{
public function MyClass():void{
//constructor
myMethodThatLoadsAPage();
}private function myMethodThatLoadsAPage():void
[Code] .....

I am making a 24/7 kiosk app and am noticing that the "pages" I load from the library using the above technique continually increases the memory usage (using Monster Debugger 3 and testing the SWF from within Flash Pro CS5 on a Mac.) As I understand it "myVar" are the only references to each "SomeObject" object that gets instantiated. Shouldn't the fact that myVar is local mean that SomeObject should be available for garbage collection after each new page is loaded?

View 8 Replies

ActionScript 3.0 :: Subclass, Overriding A Function Not Marked For Override?

Nov 9, 2011

I have a .fla and one.as(DisablingButtons.as).The .fla currently has only one key frame and three movie clips.First movie clip has base class flash.display.MovieClip and class DisablingButtons.as.The other two movie clips have base class DisablingButtons and their own classes (set by flash on export). The movie clips have identical timelines, 20 frames, two motion tweens, and the only action is stop();on frames 1,5,10,15. I get two errors:5000: The class 'DisablingButtons' must subclass 'flash.display.MovieClip'and 4 copies of 1024: Overriding a function that is not marked for override (on frames 1,5,10,15 of movie clip #2)

I am importing flash.display.MovieClip and have public class DisablingButtons extends MovieClip.Code below...[code]..........

View 2 Replies

Actionscript 3 :: 1024 Overriding A Function That Is Not Marked For Override?

Mar 29, 2012

Keep getting this error in a flash instrument im making. 1024 overriding a function that is not marked for override

View 2 Replies

ActionScript 2.0 :: Button Functions - Playing Marked Keyframe In Another MC

Apr 21, 2008

How can I direct a button placed in one mc to play a marked keyframe in another mc. Here's what I'm trying to do?
on (press) {
gotoAndPlay(_root.animMc, "go");
}

View 2 Replies

ActionScript 2.0 :: Why Yellow Marked Classes In Actions Panel

Apr 13, 2011

anyone has any tips about why i have these yellow marked classes in my actions panel?

View 3 Replies

Actionscript 3 :: Error: 1024: Overriding A Function That Is Not Marked For Override?

Sep 1, 2011

I'm trying to override dispatchEvent(), with no success in the Flash IDE. Reviewing Adobe docs on the method, it should simply be:

override function name()

As demonstrated by Grant Skinner, this is commonly and easily performed:

override public function dispatchEvent(evt:Event):Boolean {
// code here
}

And while a thorough google search will repeat this syntax successfully used in Class files, doing so inside timeline code, natively in the Flash IDE is proving impossible. The first issue being that the use of public throws the error 1114: The public attribute can only be used inside a package.That was obvious, however upon removing that, running the following (on the first frame of a new .fla file):

override function dispatchEvent(evt:Event):Boolean {
trace(evt.type);
return super.dispatchEvent(evt);[code]..........

results in this error: 1024: Overriding a function that is not marked for override.

Documentation on this error implies that I failed to prefix the identically named function with the override statement, but obviously that's a fallacy, and I'm left flabbergasted as to what the solution may be.

To be clear, we know a class file will work, but that's an irrelavant issue. How do we get override function dispatchEvent() working in timeline code?

View 2 Replies

Flex :: Error - 1024: Overriding A Function That Is Not Marked For Override

Oct 7, 2011

I have got an open source "Organisation Chart" component in Flex from the below link [URL]..But the component is in Flex 3, and I want the same in Flex 4.When I am trying to run the same in Flex 4, I am getting some weird errors :

1024: Overriding a function that is not marked for override. OrgChart.as

Any one has any idea, Please help me with this.Also If any one knows any other "Org chart" component for Flex4, Please let me know.

View 1 Replies

ActionScript :: Flex: Why Are The ApplyResult And ApplyFault Methods Of AsyncToken Marked Mx_internal

Oct 21, 2009

As the title suggests, why are the applyResult and applyFault methods of AsyncToken marked mx_internal?There have been a few times that I would have liked to use AsyncToken in my code, but I've ended up re-writing it because I don't want to force clients to use namespace mx_internal.

View 1 Replies

Creating Loop To Set Color Objects?

May 8, 2009

I'm trying to create a for loop to set the color objects outlineColor1...100 to the value defined in variable _root.outlineCol. Everything works fine when I set the color to these objects via 100 lines of code but I'd like to replace them with a for loop of course. I suspect the syntax in the first part of the second line is incorrect but I'm not sure.

for (var i:Number = 1; i <= 100; i++) {
outlineColor[i].setRGB(_root.outlineCol);
trace(i);
}

View 2 Replies

ActionScript 3.0 :: Creating Objects Using GetDefinitionByName

Sep 14, 2010

I am trying to create a library of transition effects. Each transition type or preset is its own class. In the Client/Main class I would like to create the transition type I need based off a static constant, hoping to save myself from having to write a long switch statement to select which type of transition class to instantiate.[code]I am not using the getDefinitionByName utility correctly, what am I missing here? Is there a different way to achieve class instantiation by passing in the name of the class as a string.

View 9 Replies

ActionScript 2.0 :: Creating Dynamic Objects?

Apr 3, 2004

this is a wierd problem I am facing in flash I need to create a dynamic global variable where the variable's name is stored in another variable. say I need to create a global variable , _global.fam , but "fam" is stored in a variable temp="fam";

now how can I declare the global variable 'fam' using the variable temp.

But the loophole here is that after creating the global variable I should be able to access the variable as

View 1 Replies

ActionScript 2.0 :: Creating Objects In A For Loop

Apr 4, 2007

This piece of code gives me an error because i have an equation on the left side of the equal sign, logically it makes sense, but flash doesn't like the code how would i do some thing like this?[code]

View 2 Replies

ActionScript 2.0 :: Creating Multiple Objects?

Apr 11, 2009

My goal is to create multiple objects that fall downwards. The problem now is that the object stays in the left upper corner. I've linked the object to actionscript with the name "object". Can someone help me?

This is my code:

Code:
var namer:MovieClip = this.createEmptyMovieClip("objectHolder", 1);
for (i=0; i<=count; i++) {
var newName:String = "object"+(count);

[code]....

View 2 Replies

Actionscript 3 :: Objetcs Created Inside A Function Are Automatically Marked For Garbage Collection If Not Referenced Anywhere Else?

Feb 11, 2011

Objetcs created inside a function are automatically marked for garbage collection if not referenced anywhere else? Letīs say, I have a class called SubClass. in the constructor I create some displayObjects.Then I instatiate SubClass somewhere. When I remove this SubClass instance, will the objects inside be marked for garbage collection?

View 1 Replies

ActionScript 3.0 :: Creating Sequential Sound Objects?

Aug 30, 2008

In my .fla Library are 10 audio files named "Beep0",

var btnSnd:Array = new Array();
for(var d:Number=0;d<10;d++){
btnSnd.push(d);

[code]....

View 3 Replies

ActionScript 3.0 :: Creating Objects From Preferences File?

Sep 25, 2010

Now, I have a file, prefs.elf, that contains my preferences in the following formatlocation:USAaccountID:48996151894Now, what I'm hoping to be able to do is create an object with the labels as the object.So, I have an object, preferences, which I'd like to be able to get at these values through - like this: preferences.email or preferences.location. can read the file and toss these in an array really easily, but I'd like to do it a little more eleganty with objects.My main question is, how do I create the sub-objects to hold the value? In other words, how would I create preferences.location, or preferences.accountID without explicity specifying them in my code

View 2 Replies

Actionscript 3 :: Creating An Array Of Objects - Set A Value Of One Object?

Apr 7, 2012

I would like to add a bunch of cars to the stage, and store them in an array as objects. The problem is I hate using external AS files and would like to keep it as simple as possible.I tried doing :

var car:Object = {carcolor:String,carscale:Number,carpower:Number};
var test:Array = new Array()
for (var i:Number=0; i<10; i++) {
test.push(car)
}

The problem is if I try to set a value of one object in the like test[1].carscale = 5

Every object in the array gets their attribute carscale set to 5.Is there any way I can do this without using external class files?

View 4 Replies

ActionScript 3.0 :: Creating Random Number Of Objects?

Apr 25, 2011

I have an object calls "level" and I want to create random number of objects with random position on the stage.

I've reached how to create random position but I still have only 1 object "level" on my stage.

View 8 Replies

ActionScript 3.0 :: Creating Objects From Arrays On Stage

May 7, 2011

I've got four arrays which I want to use to create objects on the stage.
The first one is what the Object Class is called.
The second one is what I want the instance name to be.
The third and fourth relate to the x and y co-ordinates respectively.

ActionScript Code:
var objectName:Array = [Background, Frame, Up, Down, SideBar, Yellow, Green, Pink, Blue, Titles,
TimeBar, TimeBarSlider, Stop, Play, Pause, ThumbnailOutline, Thumbnail];
var instanceName:Array = [bg, frame, up, down, sideBar, yellow, green, pink, blue, titles,
TimeBar, timeBarSlider, stopBtn, playBtn, PauseBtn, thumbnailOutline, thumbnail];
[Code] .....

The "i" would relate to the parameters for the same object. So, if i = 0, then the Object Class Name would be: 'Background', the instance name would be 'bg', the x position would be '0', and the y position would '0'. What code would I need in the for loop to create this?

View 7 Replies

ActionScript 3.0 :: Creating 2D Array Of Objects (Checkbox)

Feb 27, 2009

I've tried to make 2d Array. I need to make 2d array of objects(CheckBox). My code is:
Code:
Select allvar a:Array=new Array();
for (var i:uint=0;i<5;i++) {
for (var j:uint=0;i<5;i++) {
var b:Array=new Array();
var ch:CheckBox=new CheckBox();
[Code] .....

View 1 Replies

ActionScript 2.0 :: Creating MultiDimensional Array With Objects?

Feb 16, 2009

I have a XML document that has 8 main sections, and under each section there is a number of sub sections and under each of those sections their is a number of sub sections and then one more level. I am trying to create one main multi-dimensional array that can reference the particular sub section. For example by using this notation:

"_global.Link_arr[main section id][sub section level 1][subsection level2][sub section level 3].link " (or _global.Link_arr[0][0][0][1].link)"

Is this possible to do with the following script.

_global.Link_arr = [];
navBtn.subfolder = category[i].childNodes;
var l:Number;
var subArrNum:Number = 0;

[code]....

I do not know how to create an array within a multidimensional array like I am doing?

View 3 Replies

ActionScript 3.0 :: Creating Basic 3D Objects In Flash CS4

Aug 3, 2009

I've started using the 3D capabilities of Flash CS4 recently, particularly with respect to transforming the rotation and translation properties of movie clips with AS3. Which is fine for planar shapes, but I want to know how to create true 3D objects that I can similarly manipulate. The problem is, that although there are plenty of excellent tutorials covering simple changes in X, Y and Z properties, there seems to be a distinct lack of tutorials explaining in simple terms how to go about creating, say, a basic cube that can be displayed and transformed dynamically. Adobe's Flash CS4 files mention perspective projection and the Matrix3D object, but I don't find these section particularly clear. What I would like to do, for starters, is create a simple cube to which I can apply x, y and z axis transformations in the same way I can to movie clips.

View 2 Replies

ActionScript 3.0 :: Creating Objects In Shape Of Circle

Mar 16, 2010

How I might use actionscript to place say 100 small MC's on the stage in a circle? I assume I would need some sort of trigonometric function, but my math skills are a bit rusty...

View 1 Replies

ActionScript 2.0 :: Creating Resizable Objects - Movieclips

Oct 1, 2003

where I can find a tutorial to create resizable movie clips? The viewer should be able to resize movie clips during playtime... I tried a lot of things... the objects get resized but they just "blow up" from all sides...

View 3 Replies

ActionScript 2.0 :: Creating New Sound Objects For Each Explosion?

Nov 7, 2004

i'm making a game with tanks at the moment, and there will be explosions happening from side to side on the screen. i was thinking that it would be good to pan the sounds, so explosions on the right of the stage would play on the right speaker etc.

i tried to do this by creating new sound objects for each explosion and then setting the pan for each, individually, but it seems that when i set the pan for one sound object, it sets that for all of them. is there a way around is?

View 7 Replies

ActionScript 3.0 :: Creating Simulation - Remove Objects From Vector?

Aug 4, 2009

I'm creating a simulation in which a large number of objects are added to vectors and then taken away in random order (as more are being added). To remove the objects, I splice the object from the vector it's in, and notify all the other objects that an object ahead of them was removed so they can change their indices accordingly. As far as I know, the objects have no other references (I think), and within the object, I set everything to null. I read somewhere that you can't put "delete this" in the class, so I didn't bother with that. Will this be sufficient to get the object garbage collected, or should I do something else? What are the best ways to get something like this garbage collected?

View 2 Replies

ActionScript 3.0 :: Creating Generic Actions For Multiple Objects?

Feb 3, 2010

want to simplify coding and wondered if there was a way to write a script that could be used on multiple objects without having to write it to address each object individually. I am building a simple menu where I want the menu link to rise and scale up when the button for it is rolled over and then return to its original position when the mouse rolls off. I know I can write this per button and per item, but wanted to see if there was a way to write it once and then apply the action to everything. EX. My menu consists of 5 items (and respective buttons) home_mc (home_btn), menu_mc, dining_mc, contact_mc, specials_mc.If I write the code

home_btn.addEventListener(MouseEvent.MOUSE_OVER, homeOver);
home_btn.addEventListener(MouseEvent.MOUSE_OUT, homeOff);
function homeOver(MouseEvent) {

[code].....

View 5 Replies







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