Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Having trouble with stage handling movieClips.

New Here ,
Nov 15, 2015 Nov 15, 2015

Hi there!

I am creating a Quiz where the user selects one of the two multiple choice options. If correct, the user is prompted to click on the star movieclip which depicts it moving

and being placed on the star templates at the bottom. After the scene has completed this tween, it automatically spawns in a star at those coordinates.

For some reason, the first star is staying throughout the whole process, however, the other stars if correct, are being removed from the stage once the next question has been answered as correct.

Scene where user must click on star to add it:

var starOneClaimed:Boolean = false;

stop();

star.addEventListener(MouseEvent.CLICK, claimStar);

Correct.play();

function claimStar(evt:MouseEvent):void

{

  starOneClaimed = true;

  Sparkle.play();

  gotoAndPlay(52);

}

If the user gets the answer correct, (starOneClaimed) -> spawn one in at the exact coordinates of the template so that it stays there for the next 6 questions (7 total):

import flash.display.DisplayObject;

stop();

if(starOneClaimed)

{

  var starOne:ClaimedStar = new ClaimedStar();

  starOne.x = 200;

  starOne.y = 357;

  stage.addChild(starOne);

}

It is adding it to the stage, however, once the second star has been claimed (2nd question), and the 3rd question is asked, it removes the 2nd star from the stage. And this process repeats for each question asked, the star before is removed.

4.png

When this button is clicked to continue to the next question:

5.png

Notice there is a star in the top left, however the coordinates are the same except the x is altered a small part from the others. I dont understand. Help please?!

TOPICS
ActionScript
266
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 15, 2015 Nov 15, 2015

Ask in the correct forum, which presumably is the Flash Pro one.

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 15, 2015 Nov 15, 2015

I cant for some reason 😕 It doesnt let me choose it

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 15, 2015 Nov 15, 2015
LATEST

I have notified someone who might be able to help that the Flash forums all appear to be disabled as far as adding new postings go, as well as not being able to move this one there.  Hopefully they can resolve that as fast as they were able to mess it up.  They have been shutting some of the less used ones down (most are these days) and likely got carried away clicking things.

Meanwhile, can you explain how you have this file arranged as far as the code goes?  You mention "scene" and your code shows changing locations along the timeline, while your naming of variables appears to be related only to the first star (starOne) even though it is clear you create an instance of it at least once.  How does the code for adding the other stars look?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines