ActionScript 3.0 :: Jigsaw Have Answer Equal A Movieclip?
Mar 7, 2012
basically i have this jigsaw code, and i need to modify it so that the only jigsaw piece that will be accepted is the answer to a question which is randomised as follows,
I am trying to get an answer from Input text Field and compare it to the correct answer.here is how my code look like:
//I have a confirm button here confirm_button.addEventListener(MouseEvent.CLICK, ConfirmFunction); //I have a correct answer as a String here var correctans:String = "July";
[code]....
This will check if correct answer contains words in the answer from input text field.But that will result on if I key in "July is great", it will still link to the correct answer frame instead of wrong answer frame.I want the answer to be exact same as the correct answer.
I have a grid with 12 movieclip buttons. When a button is pushed a answer is displayed and on the answer frame, there's a button "click for more information".
That button points to information in a frame within the mc button. However, when I test it all the buttons on the root timeline appear on top of this information, covering it up.
Also, when you move the mouse while in this "further info" area, it disappears
The dictionary use strict equals(===) for key comparison, how to change the comparison, so I can use my standard for comparison, for example, I have a class named Student:
class Student{ var id:int; var name:String;[code]....
I want Dictionary use id to compare if the two keys are equal, not use strict equal(===) to compare if the key is the same.
is it possible to make the duration of a movieclip equal the duration of the preloader, i mean is it possible to make something like, the time the preloader needs to reach the 100% = the duration of the movieclip? i'm using AS 3.0 and flash CS4 just in case it helps here is my code for the loader:
Code: loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete); function loadProgress(event:ProgressEvent):void { var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
I am planning to develop a jigsaw puzzle, by designing the puzzle pieces in Photoshop (with each jigsaw piece on a separate layer) and then importing all PS layers into flash, to compile the game. I haven't been using AS3 for too long, but am reasonably happy with the progress I've been making and would like to take this step up in terms of complexity.
The pieces will be stored in an array (piecesAry). I want the pieces to each be registered to a Point on the playing board. For example, if there are 100 pieces in the jigsaw, each piece will have correct place in terms of a 10x10 matrix (10 rows x 10 columns). The unique Point for each piece will, I think, need to be stored in the piecesAry.
My query relates to how I am best assigning the unique Point to each individual piece. For example, to take again the example of the 100 piece jigsaw, would it be possible / effective to create an underlying 10 x 10 bitmap square grid, and have each piece of the grid assigned to an individual piece (the thinking being that the square grid can be "cut up" easier than the jigsaw once in flash).
The top left corner works ok - I copied and pasted the code and made the minor changes. The other 3 parts of the puzzle are causing a real puzzle for me.I've checked instance names, and everything else I can think of.Is there something in the code that could prevent the other bits working properly? Some of the names aren't brilliant - I thought this would only take a few minutes to knock up!
I'm trying to create a jigsaw puzzle and need to show a text when the puzzle is complete. I can't solve it. I have 12 puzzle peaces and when all of them are correct placed i need the "Congratulation" text to show. Is there a easy AC snippet telling a text to show when all peaces are in correct x and y? The puzzle peaces are buttons and have instant names as, puz1, puz2 and so on....
I know how to make a basic jigsaw but at the moment i'm trying to create a map of europe jigsaw. Unfortunately with the map taking up the majority of the room there's no space to have all the pieces on screen at once. I had a look for solutions and i found this... [URL] How would i go about making it so that only 1 piece appears on screen until you have placed it?
I am using the puzzle game sample from adobe and want to use it as part of an interactive narrative for students. However, everytime I try to go to new frame or scene the image stays with me. How do I remove or unload the puzzle frame and bitmap images so that it doesn't follow me. I am not a coder very confusing here is the entire script.
var puzzlePiecesArr:Array;var puzzlePiecesFound:Array;var topDepth:Number;var totalPuzzlePieces:Number;var correctPuzzlePieces:Number;var puzzleBmp:BitmapData;var intervalID:Number;var threshold:Number;var imagesArr:Array; var imageLoader:Loader;var requestURL:URLRequest; var puzzleBoardClip:MovieClip;var holder:MovieClip;
i need to make a jigsaw game. i want to make such a system by code(AS3) that when i give the bitmap it will split it. how can i split the bitmap in such a extraordinary shapes?
After 3 drag and drops of the puzzle I get this error: TypeError: Error #1009: Cannot access a property or method of a null object reference. at MultimediaProducttest_fla::MainTimeline/dropIt() TypeError: Error #1009: Cannot access a property or method of a null object reference. at MultimediaProducttest_fla::MainTimeline/pickUp()
I have a simple jigsaw type puzzle - only 4 pieces at the moment. The top left corner works ok - I copied and pasted the code and made the minor changes. The other 3 parts of the puzzle are causing a real puzzle for me. I've checked instance names, and everything else I can think of. Is there something in the code that could prevent the other bits working properly?
Code: // Drag cameron 2 a2.onPress = function() { this.startDrag(false);}; a2.onRelease = function() { this.stopDrag(); // Convert the slash notation to dot notation using eval. if (eval(this._droptarget) == b_mc) { b_mc._visible = false; c2._visible =true; a2._visible =false; change_score(); }}; The fla is attached.
My code in theory works find but for some reason things aren't doing what they're supposed to. Basically I have all my draggable puzzle pieces as movieclips; they start at specific x's and y's on the axis. You drag them to the corresponding hitbox movieclip and it pops into the other specific x and y spot on the axis (otherwise they go back to the first xy spot).
The problem is sometimes the pieces drag and drop fine, but other times when you click the mouse down, they drag, but when you let go, they don't drop! Randomly! They just follow the cursor around, til you click a few times, and then randomly it will drop and not move (when it's supposed to go back to the original xy position).
I am doing a 5 frame file that on frame 1 has 4 buttons and the following code on (release) { gotoAndStop(4); } on (release) { loadMovieNum("jigsaw.swf", 1); }
I am happy with this as it jumps to frame 4 and loads the movie jigsaw that I done from a tutorial. The problem is I cant get it to close, I have got a button on page 4 that has the gotoAndStop(1) but it just goes to frame 1 (that's the good bit) but the jigsaw is now on frame 1 as well and I dont know how to close it.
I tried on (release) { gotoAndStop(1); } on (release){ unloadMovieNum("jigsaw.swf", 1); } but it does nothing not even go to frame 1
I have a jigsaw puzzle that I want to add the ability to have each peice rotate. This code is based off some code I purchased. I cannot reach the company other than some generic instructions to add an event. The instruction I was given was:
public function rotateActivePiece(dir:int=1):void Rotates the active puzzle piece (last clicked), 90 degrees, clockwise if dir>0, and counterclockwise if dir<=0. Parametersdir:int (default = 1) - Parameter defining the direction of the rotation. CW if pozitive, CCW if zero or negative.
I want to make a jigsaw puzzle in flash. I know how to create square kind of shapes. But I want to create this kind of irregular shapes. See the live demo of puzzles in the links shown
[URL]
I just want to how to create the irregular shapes.
I have 12 movieclip buttons which each contain a question. When you click on one, the answer appears. I need the answer to remain on the screen. On that same frame, there's a button for "more information".When that is selected, it goes to another frame within the mc, and more info appears. However, it is covered up by the other 11 buttons from the main screen
I have a quiz created in Flex using Spark forms, with a series of questions which are a group of radio buttons. When the user clicks "next", I get the value of the selected radio button in the group. What I need to do is keep track of these values; at the end of the quiz I will need to see which value was chosen the most. So if the user mostly picked the questions with a "3" value, I can display a summary based on that, e.g. "You mostly chose type 3 answers". I was thinking about having an int variable for every choice (there are 5), and incrementing the appropriate variable when the user clicks "next", as in
private function enterScore(i:int):void { switch (i){ case 1: num1++; break;
But this seems unwieldy. I also will need to compare the 5 tallies for which one was chosen the most...
I have 2 swf animations (one of a happy bear and one of a sad bear), I want to load them into actionscript. When the player gets it wrong I want the sad animation to play and happy one to play when the player gets it right.
The user needs to submit a dollar amount answer. They could write is several ways. I'm trying to accomodate it with the code below. It always evaluates it as the wrong answer (the else).
i've started to make like a quiz in flash with 218 questions in it! i've made it so the computer will show X amount of random questions.i've already got the code on the buttons so it will jump to a random question, but i'm having trouble with limiting the number of questions asked.
i've got an inputbox so the user can chose how many questions they do and the buttons add 1 each time thier pressed to a different variable.
i've got this code, but it never seems to stop asking questions
on (release) { score = score+0; page = page+1 if( (page == pagemax) ) GotoAndStop(220) if( (page != pagemax) ) myVariable = random(219); //creates a random number between 0 and 5 if (myVariable < 2){ //checks to see if it's value is zero myVariable = 2; //set it to 1 if it is zero } gotoAndStop(myVariable); //goes to and plays the frame. }
I have a couple of mc's that are added to the stage after one another.I want them to have equal space between them.Here i the code snippet with the problem, below is the full code.
Code: for each (var link:XML in settingsXML.links.link) { i++; newsItem = new NewsItem(); newsItem.menuLabel.text = link.@name;
What I would like to do is to be able to store all the answer choices within an array called AnsArr. Can I declare a new array within the same obejct such as AnsArr and push these choices to it?
options as I wish to learn how one would create a tool that would provide allow the end user to enter numbers, in some predetermined/static fields. The tool would then use this data and provide the answer.Simply put, i'm looking to create a basic ROI calculator (Return on Investment).