ActionScript 2.0 :: [fmx] Drop Code With A Counting Variable?

Mar 27, 2004

I am having a big problem with some drag and drop code I am trying to write. Basically I have two lists of draggable components, the components and their symbols. The user has to drag the correct component with its matching symbol on drop area which are labelled.When the user gets the right component in the right drop point it has a counter which keeps track of which single part is in the right place.I am having trouble in making a counter which increases when two matching components are placed correctly and to decrease when either of the components are taken out of their correct place...my problem is that it will decrease when a components is just picked up and dropped back into the correct place.If anyone understands my problem and can have a look at the code below Code fr one drag object (in this case a off switch)

Code:
onClipEvent (load) {
this.dropped = 0;

[code].....

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Counting Drag And Drop Events

Aug 11, 2011

I've created a drag and drop activity using a class. Six movieclips are dropped on the target. After each movie clip is dropped I want to display feedback. So I added counter++ to the drop function to trigger the appropriate feedback. The drag and drop functionality works perfectly. Probably because I got most of it from a [URL] activity. Problem: counter++ is not cumulative. So I drop target 1, counter is 1. Then if I drop target 2, counter is 1. If I drop target 2 twice, counter is 2. However, that isn't what I want. I need to either figure out how to make counter++ cumulative, or I need to figure out how to add the different counters together. So if source1...source6 = 1 do this. My counter code is on the main timeline.

[Code]....

View 0 Replies

Actionscript 3 :: Code For Counting The No. Of Clicks And Keyboard Presses Using Flex 4.5

Oct 3, 2011

code for counting the no. of clicks and keyboard presses using Flex 4.5?

View 1 Replies

Javascript :: Pass The Variable So That The Resulting Line Of Code Doesn't Have The Quotes Around The Variable Value?

Oct 3, 2011

I'm trying to pass the contents of variable playnoyes to the long line of code below to decide whether or not to autoplay the flash movie, but doing it as I have below, the resultant line of code has the variable in quotes and therefore the code doesn't execute it as expected. My question is, how can I pass the variable so that the resulting line of code doesn't have the quotes around the variable value.

var playnoyes='true';
var testtext = "<script type='text/javascript'>AC_FL_RunContent ('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.[code]....

View 3 Replies

Actionscript 3.0 :: Counting Down Instead Of Counting Up

Jan 15, 2009

I created a timer with found tutorials and the Flash help files and everything works fine. My timer counts up from 000.000,0 to 999.000,0. Now I would like to also be able to do the same, but counting down from 999.000,0 to 000.000,0
Easy enough I thought, but now . how to make some modifications in my code to count down.

My code for counting up is the follow:

Code: Select allvar hours:Number = 0;
var seconds:Number = 0;
var minutes:Number = 0;
var pauseTime:Number = 0;

[Code].....

View 2 Replies

ActionScript 3.0 :: Drag And Drop A Movieclip With Code?

Jul 17, 2009

I'll try to make a movieclip for drag and drop event this is a code that I've find on the web:

Code:
package
{
import flash.display.Sprite;

[code]....

But this one make a vectoriale circle on the stage and makes it draggable.Now I've a movie_clip called "mc_Image" on my stage (that have inside a image background and some transparent button).

View 1 Replies

ActionScript 3.0 :: Variable Code Within Code?

Mar 28, 2011

I was wondering how you can make variable code within code, for example, normally, you can use this["blabla"+variable]; to make the code say blablavariable. But now i want to make new variables by using this code, within a for loop [using teller1 as the increasing value] this["var ringsegment_mc:Ring_"+teller1+"=new [Ring_"+teller1+"]()"]; which i basically want to have say:var ringsegment_mc:Ring_1=new Ring_1();
 
but this doesnt work, it doesnt make a variable called ringsegment_mc. why I want to do this, is because i need to make an add child which makes 16 parts, from 16 different movieclips.

[Code]...

View 16 Replies

Numerous Drag And Drop Objects And Elegant Code

Mar 13, 2009

I have found the following code and modified it.

Code:
// Drag a piece of garbage.
rubbish_mc.onPress = function() {
this.startDrag(false); }; // When the garbage is dragged over the trashcan, make it invisible.
rubbish_mc.onRelease = function() {
this.stopDrag(); // Convert the slash notation to dot notation using eval.
if (eval(this._droptarget) == trash_mc) {
rubbish_mc._visible = false;
change_score(); } };

My question: I have numerous movie clips for the rubbish. Is there a more elegant way of calling them than repeating the above lines with rubbish2_mc, rubbish3_mc etc.

View 2 Replies

ActionScript 3.0 :: Adding A Target To 'drag And Drop' Code Snippet?

Jul 7, 2010

I would imagine it's a simple enough bit of additional code, but I'm no programmer, and trawling the Web has proved fruitless to date...ithin Flash CS5 and using AS 3, I'm attempting to create a series of drag-and-drop interactions for a learning exercise where items must be dragged into the correct box with positive and negative feedback being generated as a result of where the learner drops the item. All I need is the code to link the drag and drop code snippet (which I have working) to a specific object/location on the stage (which I cannot find nor figure out for the life of me)

View 1 Replies

Xml :: Build A Nice Fluid Drop Down Menu Completely In Code?

Aug 25, 2010

I've just started learning as3 and I've been trying to find a good tutorial on dropdown menu's using just xml and as3. Most of what I've come across so far are either static menus or menus driven with heavy use of the timeline. Is it even possible to build a nice fluid drop down menu completely in code?

View 2 Replies

ActionScript 3.0 :: Drag And Drop Multiple Objects / Improving Code Suggestion

Feb 25, 2010

i want to improve my code for drag drop seven different or multiple objects to be moved in any three of target places then target value will be search by category or feature wise,[code]

View 3 Replies

ActionScript 2.0 :: Menu System Code - Templates On Multi Level (4) Drop Downs?

Feb 17, 2004

I need help coding this menu system and cant find any tutorials or templates on multi level (4) drop downs. I dont know weather to make everything a movie clip and load the mc's or to place buttons inside a movie clip. Everthing will be onrollover.

View 1 Replies

Professional :: Developing A G.U.I 'drag & Drop' Code Module To Place And Replace 3D Objects On A 3D Object?

Mar 27, 2010

I'm developing a G.U.I 'drag & drop' code module to place and replace 3D objects on a 3D object.

View 1 Replies

ActionScript 1/2 :: Add A Code So Drag And Drop Movie Clip Will Not Stick  Once It Is Dragged To Final Place?

Apr 18, 2011

I have to use the old drag and drop code on my movie clips, but the problem is when I drag the movieclip to the area on my .swf file once i release it, it sticks to the hand mover.I am encloseing the action script I am using could someone or kglad tell me what is missing from the code so that once it is released it will not stick, see code belowcircle.onPress = function(){ startDrag(this);}circle.onRelease = function(){ stopDrag();}

View 3 Replies

ActionScript 2.0 :: Drag And Drop Variable Count On Different Levels

Aug 18, 2010

I am creating a 'healthy eating' resource for the local education authority where i work. What i need to do is create a game where healthy food can be dragged into a pot. The variable should increase after each item of food is added and the total added to the dynamic text box. Because the drag n drop script is one level down, i keep getting undefined in the text box on the root level. I cant seem to figure out why this is happening.

Code on draggable mc (this is one level down from root):

on (press) {
startDrag ("_root.carrot");
}
on (release) {

[Code]....

Dynamic text box var is called 'total' and this is also on the root level.

View 1 Replies

Flash :: Using A Dictionary Variable To Match Up A Drop And Drag Exercice?

Nov 3, 2011

I am using a dictionary variable to match up a drop and drag exercice.

var dict = new Dictionary ();
dict[box_a]=s1;
dict[box_b]=s2;
dict[box_c]=s3;
dict[box_d]=s4;

question 1: at the end i would like to check if box_a== with s1 and so on .... how would I do that

for each( var item in dict)
{ item.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
item.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);[code]....

question 2:I would like box_d to accept also s3 how would i do that if i do

dict[box_d]=s4; and dict[box_d]=s3; it wont work because it matches it with the last equal.

View 2 Replies

ActionScript 3.0 :: Setup Variable To Load External Image For A Drag & Drop Object?

Feb 26, 2011

how to set up the URLRequest to load an external image to a movie clip that is being used in a Drag and Drop event.

I have successfully implemented the drag & drop code to my design but I would like to improve it by successfully loading external images to those objects that are being dragged around.

View 4 Replies

ActionScript 2.0 :: Use Value Of A Variable In Code?

Oct 15, 2010

I have this line of [code]...

MOBNAME is the variable that contains the name of the monster that attacked me, and I need to know what I need to put to use the value and not the name of the variable.[code]...

View 2 Replies

ActionScript 2.0 :: Use Code To Detect When A Variable Changes?

Sep 12, 2003

Well basically what I want to do is have my code figure out that a variable has changed value and then call a function to store that value in my class.I have a component with a text box in it that displays a value gotten from either typing in the box or moving a slider. I then need the last value (where they stop sliding or typing) to be stored in my class

View 4 Replies

ActionScript 2.0 :: Using A Variable To Avoid Repeating Code Over And Over?

Apr 8, 2009

I've been trying all morning to figure this out but I'm really not the best when it comes to actionscript. I've looked around and I just simply don't have a clue how to adopt other code to fit my own .I have the following code

Code:
function reActivateTopMenu() {
_root.top_nav.btn1.gotoAndStop(1);
_root.top_nav.btn1.enabled = true;[code]....

I just can't figure out the exact way of writing the code in "flash" talk and not "dave" talk!

View 10 Replies

ActionScript 2.0 :: CS3 XML Variable Doesn't Carry Into Second Bit Of Code

Nov 23, 2009

Flash CS3, AS 2.0 so I have an XML file containing the number 72, and this script:

Code:
var imageNumber = new XML();
imageNumber.load("imageNumber.xml");

Then later, this script:

[Code]...

The problem is, the variable doesn't carry into my second bit of code. I can add a button and use trace to display the correct variable in the output box, so I know it's getting into Flash. The problem is that it's not applying itself to the second piece of script. Triple checked that the code with by putting in the number manually and using a normal variable, only when I use the XML file as a variable does it refuse to work. I'm very new to Flash so sorry if I've left any important information out, but can anybody shed some light on this?

View 6 Replies

ActionScript 3.0 :: Get Value Of A Variable Code Doesn't Work

Dec 11, 2011

In other language I can use this kind of sentences:

[Code]....

How can achieve this? because the above code does not work.

View 1 Replies

ActionScript 3.0 :: Code Doesn't Define Position Variable?

Nov 28, 2010

I run a demo code,it extends Sprite,like follows:

public class Vehicle extends Sprite{   protected var _position:Vector2D;   public function Vehicle(){     _position = new Vector2D();    draw();   }   protected function draw():void{     graphics.clear();     graphics.lineStyle(0); [code]....
 
I don't understand following code,because I only define _position and don't define position variable,why I can use position.x?     x = position.x;     y = position.y;

View 1 Replies

Flex :: 3 - Flash - Change Sate In Code Using A Variable?

Jul 28, 2010

How do I change the application state in code, using a variable? when I provide a static string it works fine, but not with a variable.

[Code]...

View 2 Replies

ActionScript 2.0 :: Adding A Variable To A GetURL Line (correct Way To Code It)?

Jun 13, 2006

all I want to do is add a variable to a getURL line of code.EG:getURL("/index.asp", "_self");I need to add a variable (_root.myvariable) to the end of the link so that it goes to:index.asp?myvar=thevalueofmyvariable

View 3 Replies

ActionScript 2.0 :: Adding Code To HTML Link That Passes Variable Into Flash?

Oct 4, 2006

Is it possible to add code (...html or php?) to an html link (i.e the link will be featured in an html website) that passes a variable into the flash site it links to (just something simple like '_root.pageChoice = "home3" '? So when the site opens the swf turns to a certain page?This will be necessary as there will be links to the site from different html sites and each will need to see a different version of a certain page.

View 4 Replies

Preloader Not Counting?

Aug 21, 2010

hy this very simple preloader is not counting? It sits still on 1%, thats it, then eventually the content of the next scene fills the screen.(I use to import a number of heavy images to Scene 2 to slow the loading process down.)

View 2 Replies

ActionScript 2.0 :: [MX] Counting Up Function?

Sep 7, 2005

and had another query on it. The AS on the first frame so far is :

//start number
var nr = 0;
//end number

[code].....

View 1 Replies

ActionScript 2.0 :: 14,000 Frames And Counting?

Dec 22, 2005

I'm working on a demo (mx 04) and it has a little over 14,000 frames so far. The preloader was working before but now it isn't. Is there a limit or something to how flash works when there are so many frames used?

View 5 Replies

ActionScript 2.0 :: Counting Nodes From XML?

Jun 27, 2006

Let's say I have a XML file with three types of nodes; type1, type2 and type3.How do I count the number of nodes named type1?

View 1 Replies







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