Flash Questions Help

Hi all


In a game in progress that I am, I met the problem stacked questions ontop of each other. By that, I mean I have a range of issues that are going on the issue of the buttons 1 at a time. The problem is that for each question, I answer, it also answers questions before her at the same time (thus ruining my score)... Anyone has any advice on how to fix the code below so that it won't happen?

I have the whole game at this link: https://www.dropbox.com/s/sfopgwoyxgpq4xs/kid%20game%20may22%20cs4.fla but here is the code which originated the questions.

I really need help as soon as POSSIBLE and thanks


function Hitwat5(event:Event)
{
If (Person.hitTestObject (Watcoin5))
{

yScroll = 0;
qBack5.visible = true;
(qBack5);
Watcoin5.y-= 1200;
var buttons: Array = [qBack5.button15, qBack5.button25];

questions of the var: Array = [];
questions.push (["what is 40 divided by 5?", 1, "10", "8"]);
Support;
questions.push (["sides how many are there in a Pentagon?", 0, "5", "6"]);
questions.push (["which has the same value as 3 x 4?", 1, "5 x 2", "6 x 2"]);
questions.push (["what is missing? 17 _ plus 28? », 0, « 11 », « 9 »]) ;
questions.push (["how many ribs is on a cube?", 0, "6", "4"]);
questions.push (["What's 9 x 4?", 1, "32", "36"]);
questions.push (["how much is 2 + 3 nickles worth dimes?", 0, "35cents", "25cents"]);
questions.push (["what is 350-60?", 1, "260", "290"]);
questions.push (["what is missing? 2 _ 4", 1, "=", "<"]);
questions.push(["What is 23.4+20.3?", 0, "43.7", "41.5"]);

function init(questionNum:int)
{
currentQuestion5 = questionNum;
question of the var: Array = issues [questionNum].
question [0] = qBack5.questionText5.text;
var j: int = 2;
correctAnswer5 = question [1];
trace (correctAnswer5);
for (var i: int = 0; i < buttons.length; i ++)
{
buttons [i] .addEventListener ("click", onClick);
keys [i].answerText.text = [i + 2] on the issue;
}
}

function onClick(event:Event)
{
var int index = buttons.indexOf (event.target.parent);
trace ("buttonIndex =" + index + "right answer =" + correctAnswer5);
If (index is correctAnswer5)
{
onCorrect();
}
on the other
{
onIncorrect();
}
}

function onCorrect()
{

score += 5;
trace ("scoreCorrect" + score);
nextQuestion();
}

function onIncorrect()
{
score = 5;
trace ("scoreINCorrect" + score);
nextQuestion();
}

function nextQuestion()
{
Update();
for (var i: int = 0; i < buttons.length; i ++)
{
buttons [i] .removeEventListener ("click", onClick);
qBack5.visible = false;
yScroll = Defaulty;
}

If (currentQuestion5 > = questions.length - 1).
{
gotoAndStop ("Menu", "Menu");
}
on the other
{
currentQuestion5 ++;
init (currentQuestion5);
}
}

function update()
{
scoreText.text = String (score);
}

Stop();
init (0);
}
}


Thank you very much

Flash noob.


Try:

import flash.events.Event;

Stop();

var xScroll:int = 15;

var yScroll:int = 7;

var BeachDefaulty:int = 1;

var ForestDefaulty:int = 300;

var Defaultx:int = 15;

var Defaulty: int = 7;

var leftBumping:Boolean = false;

var rightBumping:Boolean = false;

var upBumping:Boolean = false;

var Rightgo:Boolean = false;

var Leftgo:Boolean = false;

var leftBumpPoint:Point = new Point (460,260);

var rightBumpPoint:Point = new Point (500,260);

var upBumpPoint:Point = new Point (Person.x, Person.y);

var currentQuestion5:int = 0;

var correctAnswer5:int = 0;

var currentQuestion10:int = 0;

var correctAnswer10:int = 0;

var score: int = 0;

var scoreHigh:int = 0;

var button: int = 0;

Person.x = stage.stageWidth / 2;

Beachback.x = Person.x;

Beachback.y = BeachDefaulty;

Forestback.y = ForestDefaulty;

Forestback.x = Person.x;

Watcoin5.x = (Math.random () * 833 + 9

Watcoin10.x = (Math.random () * 833 + 9

qBack10.visible = false;

qBack5.visible = false;

SUMMARY. Visible = false;

MainMenu.Visible = false;

stage.addEventListener (Event.ENTER_FRAME, loop);

function loop(e:Event):void

{

trace (Person.y)

Beachback.y += yScroll;

Forestback.y += yScroll;

Watcoin10.y += yScroll;

Watcoin5.y += yScroll;

Finishgame.y += yScroll;

If (Rightgo)

{

Person.x += xScroll;

}

on the other

{

Person.x += 0;

}

If (Leftgo)

{

Person.x-= xScroll;

}

on the other

{

Person.x-= 0;

}

If (Watcoin10.y > 370)

{

Watcoin10.y-= 1200;

Watcoin10.x = (Math.random () * 833 + 9

}

If (Watcoin5.y > 370)

{

Watcoin5.y-= 1200;

Watcoin5.x = (Math.random () * 833 + 9

}

Hitwat10 (e);

}

function Goright(event:Event):void

{

Rightgo = true;

}

function Goleft(event:Event):void

{

Leftgo = true;

}

function stopGoright(event:Event):void

{

Rightgo = false;

}

function stopGoleft(event:Event):void

{

Leftgo = false;

}

function pausegame(event:Event):void

{

yScroll = 0;

xScroll = 0;

SUMMARY. Visible = true;

MainMenu.Visible = true;

}

function resumegame(event:Event):void

{

yScroll = Defaulty;

xScroll = Defaultx;

SUMMARY. Visible = false;

MainMenu.Visible = false;

}

function mainmenu(event:Event):void

{

gotoAndPlay(1,"Start");

}

Shiftleft.addEventListener (MouseEvent.MOUSE_DOWN, Goleft);

Shiftright.addEventListener (MouseEvent.MOUSE_DOWN, Goright);

Shiftleft.addEventListener (MouseEvent.MOUSE_UP, stopGoleft);

Shiftright.addEventListener (MouseEvent.MOUSE_UP, stopGoright);

Pause.addEventListener (MouseEvent.MOUSE_DOWN, pausegame);

Resume.addEventListener (MouseEvent.MOUSE_DOWN, resumegame);

Mainmenu.addEventListener (MouseEvent.MOUSE_DOWN, mainmenu);

Watcoin10.addEventListener (Event.ENTER_FRAME, Hitwat10);

Watcoin5.addEventListener (Event.ENTER_FRAME, Hitwat5);

Finishgame.addEventListener (Event.ENTER_FRAME, gameEnder);

function gameEnder(event:Event)

{

If (Person.hitTestObject (Finishgame))

{

if(score > scoreHigh)

{

scoreHigh = result

}

gotoAndPlay(1,"Start")

}

}

var questions10:Array = [];

questions10.push (["Bedmas using, what is 4 x 2 + 3?", 0, "11", "20"]);

Hard;

questions10.push (["what is 8 x 9?", 1, "63", "72"]);

questions10.push (["what is missing? 28 _ 23", 1,"<", "="">"]);

questions10.push (["which is 124 + 130?", 0, "254", "234"]);

questions10.push (["what number is greater than 865 but less 941?", 1, "964", "893"]);

questions10.push (["what is 76.23 + 11.3?", 0, "87.53", "84.74"]);

questions10.push (["what is missing? 9 x _ = 81 ", 0, '9', '8']);

questions10.push (["what number is missing? ([941, 952, _, 974 ", 0, '963', '957']);

questions10.push (["Bedmas using, what is 3 + 4 x 4?", 1, "28", "19"]);

questions10.push (["apples of 25 cents-how much can you buy with $4.25?", 1, "15", "17"]);

var questionNum:int = 0;

function Hitwat10(event:Event) {}

If (Person.hitTestObject (Watcoin10)) {}

yScroll = 0;

qBack10.visible = true;

(qBack10);

Watcoin10.y-= 1200;

Watcoin10.x = (Math.random () * 833 + 9;

var buttons: Array = [qBack10.button110, qBack10.button210];

Stop();

init();

}

}

function update() {}

scoreText.text = String (score);

}

function init() {}

question of the var: Array = questions10 [questionNum];

question [0] = qBack10.questionText10.text;

correctAnswer10 = question [1];

trace ("CorrectAnswer10" + correctAnswer10);

for (var i: int = 0; i< buttons.length;="" i++)="">

buttons [i] .addEventListener ("click", onClick);

keys [i].answerText.text = [i + 2] on the issue;

}

}

function onClick(event:Event) {}

var int index = buttons.indexOf (event.currentTarget.parent);

trace ("buttonIndex =" + index + "right answer =" + correctAnswer10);

If (index == correctAnswer10) {}

onCorrect();

} else {}

onIncorrect();

}

}

function onCorrect() {}

score += 10;

trace ("scoreCorrect + 10 =" + score);

nextQuestion();

It is probably wrong: removeEventListener ("click", onClick);

}

function onIncorrect() {}

score = 10;

trace ("scoreInCorrect + 10 =" + score);

nextQuestion();

It is probably wrong: removeEventListener ("click", onClick);

}

function nextQuestion() {}

qBack10.visible = false;

yScroll = Defaulty;

Update();

for (var i: int = 0; i< buttons.length;="" i++)="">

buttons [i] .removeEventListener ("click", onClick);

}

questionNum ++;

{if(questionNum==questions10.) Length)}

gotoAndStop ("Menu", "Menu");

} else {}

init();

}

}

Tags: Adobe Animate

Similar Questions

  • Flash Question helps Insert

    Hello

    I designed a slideshow in Banner Zest and saved to a Flash file with all the codes and images. Because I can not find where to put the code, how can I insert everything so that my living room will take place on the site?

    You can place the SWF file if file-> Place. If you have dependent resources to download thus required for the flash file run, take a look at this thread - http://forums.adobe.com/message/5087131.

    Thank you

    Vinayak

  • Mac mini (late 2012) flashing - question mark folder recovery does not work

    Hi all

    earlier today, I upgraded my Mac mini (end 2012) to the latest version of macOS Sierra.

    After 1 hour of use, I realized that many of my plugins FCPX were not working.

    I contacted the developers, and they said does not update the plugins and they told me to go back to El Capitan.

    I decided to listen to them and try to downgrade my OS.

    I restarted the Mac and held down Cmd - R or something like that that took me to the disk utility screen.

    Then I went down to dinner, and when I returned 30 minutes later my Mac had entered the sleep mode for some reason any.

    I woke up the Mac and 40 seconds later the power went out for 5-10 minutes.

    After the blackout, I restarted my Mac that took me to a black screen with a flashing question mark folder.

    I followed some tutorials online (including how to enter get - and the recovery of internet mode), but after a while even restoration of the internet shows me the flashing question mark folder.

    I don't know what to do.

    And no - unfortunately I don't have a Time Machine backup.

    But I have a backup with all my most important files.

    Is it possible to force the Mac to reset itself or something like that?

    Help, please.

    Best regards

    Filip

    Mac mini (late 2012)

    I7

    16 GB OF RAM

    500 GB Samsung SSD of 840 - evo

    Graphics Intel HD 4000

    What happens exactly when you start Internet recovery

    by pressing Command + Option + R at the start of the OS X Internet Recovery*.

    and go to disk utility and repair the startup disk?

    If repairable, the startup disk to format and install OSX via recovery. you install Mountain Lion or dependent Mavericks when the Mac was made. Then OSX you want.

  • Flashing question mark in the Macbook Pro Retina early 2015 at startup problem

    I have the 128 GB of Macbook Pro retina early 2015 model. I bought my macbook, the year last January 2015. I am just now having problem with my mac. When I'm trying to boot my laptop it shows the flashing question mark and it does not start after that. For a while it worked, but after the update the laptop is never again.

    After reading all the articles related to this issue and even after trying it the entire process for the departure of mac. I'm not able to start.

    I tried all the normal recovery process in the process of recovery of the internet, but still it does not work for me. When I select the disk utility in the dialog box, the drive does not appear here, so I can't erase and start to reinstall the operating system.

    What should I do now? I was looking for OEM SSD, but it's very expensive. with this prize money of (here in INDIA RS - 50 k) I can get the Macbook Air.

    If please guide me on how to start the mac or what do I do next?

    Thank you.

    Frank Bsu

    We have no way of knowing exactly what you have tried that doesn't work unless you tell us. A flashing question mark boot means that your Mac is unable to locate a startup disk to boot from.

    If you haven't tried... start your Mac holding the key Option. That should launch the boot window manager have been, you can select the startup disk, and then click on restart.

    If this does not help, you will need to take the Mac for the service.

    If a flashing question mark appears when you start your Mac - Apple Support

  • Hourglass flashes always help a few seconds-

    Hourglass flashes always help a few seconds-

    Hello

    I understand that the hourglass flashes always a few seconds on the computer. I understand the inconvenience.

    1. when exactly you get this flash hourglass?

    2. is the specific question when running a particular application?

    3. did you of recent changes to the computer before the show?

    It seems that there are a few applications that run in the background of the computer. Then I suggest you perform a clean boot and check if it helps.

    Method 1: Clean boot

    http://support.Microsoft.com/kb/929135

    Note: When the diagnosis is complete, don't forget to reset your computer to normal startup. Follow step 3 of the aforementioned article.

    Method 2: Virus scanner

    You can download Microsoft Safety scanner, which provides on-demand scan, and remove viruses, spyware and other malicious software. It works with your current antivirus software.

    See the link below to download Microsoft Safety scanner on the system.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Note: The Microsoft Safety Scanner ends 10 days after being downloaded. To restart a scan with the latest definitions of anti-malware, download and run the Microsoft Safety Scanner again.

    Warning: The data files that are infected can be cleaned by removing the file completely, which means that there is a risk of data loss.

    It will be useful. For any other corresponding Windows help, do not hesitate to contact us and we will be happy to help you.

    Kind regards!

  • non-working hp psc printer shows 'E' and has a flashing question mark

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    Ideas:

    • You have problems with programs
    • Error messages
    • Recent changes to your computer
    • What you have already tried to solve the problem
    It's a question of HP. You should check w / their tech/support forums.
     
    "joan morse" wrote in message news: c069e7a2-0126-4 c-24-abd5-a7432c8a3872...
     
    > non-working hp psc printer shows 'E' and has a flashing question mark
     
     
     
  • Flash-based help system

    Hello

    I tried without success to get examples of Flash-based help files: the use of Flash and AS3 to create a (similar to CHM or WinHelp help authoring style) help file.

    I would like to create a small, very basic help file in a Flash AS3 project, with the look / feel of a Windows style help file. Perhaps, there are a few examples, sample FLA that can help me to avoid "reinventing the wheel."

    All the tracks would be appreciated.

    saratogacoach

    do not adjust cont, otherwise your _html will inherit the distortion.

    Sub is simply a way of positioning your html loaded (_html) easily.

    You can also load _html above Sub

    with

    addChild (_html) _cont.addChild //instead (_html)

    and position the upper left corner of the _html where you need

    with

    _html.x = 50

    _html.y = 80

  • Bug - Flash CS6 help does not load

    New install of WIndows 7 (32 bit). Test Flash CS6 installation costs. Click Help > using Flash and nothing happens. Help does not load. Browser opens. Nothing happens. Even with the help > Centre de Support Flash. Also installed Photoshop CS6 trial and this system does help support (browser opens to the online help page). Flash CS6 help is completely dead. Does anyone else know this? Or better yet - how to fix?

    Hi Alec,.

    It is a known problem and you need to install Flash Pro CS6 help update to display help within Flash Pro CS6.

    Please let me know if you still encounter problems look a help.

    In addition, at any time you can view the last material assistance, learning and getting started with http://helpx.adobe.com/flash.html

    Kind regards

    Suhas Yan

  • Elasticity: the conversion of Flash 5 help code in Flash 8

    Hello

    because I have to make a menu flash with elasticity effect I came across this tutorial: http://www.kirupa.com/developer/actionscript/spring.htm
    Everything is OK, but the code only works with Flash 5. I managed to whip up some code that works for Flash 6, but still I came not even near a working code in Flash 8. I only use Actionscript from version 7, I don't know anything about Flash 5 and 6. So please, more experienced guys, help me!

    The code that I've come up with is:
    MovieClip.prototype.move = function (centerx, centery, inertia, k) {}
    This.x = - this ._x + centerx;
    This.y = - this ._y + CenterX;
    This.XP = this.xp * inertia + this.x * k;
    This.YP = this.yp * inertia + this.y * k;
    This this.xp of ._x +=;
    This ._y += this.yp;
    };
    {onEnterFrame = function ()}
    This.Move (_root._xmouse, _root._ymouse, 0.9, 0.1);
    }

    This code set is in the chronology of the MC is misplaced.
    So now, the only thing I need is to make this code work for Flash 8
    Help, please

    Just managed to do!

  • Help please! Artist faced w / Flash Question!

    I bought a Flash video tutorial online for animation and the FIRST step is to create a circle with the circle tool and the guy does online, and he is looking. I repeat its actions exactly and I get about the same result. I just get a circle. I work in CS3, I don't know what is the instructor. But someone, please help! I just want to learn, but I can't get past the first step!

    Kara

    When you select the circle drawing tool, look in the properties panel, and do not forget to specify the fill and the colors of the race.  And perhaps, in order to ensure, select a fill color that is not the same as the background color.

    If you still see only a draft, then there is a chance that you have the outline mode turned on, or to the layer of the file.  If this is the layer, then you'll see that is indicated by the rectangle next to the layer not having domain name does not a fill - click on the rectangle to cancel it.  If it's the file, then you will see outlines selected if you choose View-> Preview Mode... Choose another mode of preview, if this is the case.

  • Stuck flashing question mark.

    I had a few circle of problems of death. I've formatted it to el Capitan. I had problems in formatting as well. But when I did a clean install to external hard drive, I was able to format correctly without taking a lot of time. But still sometimes the circle of death occurred even when I had enough disk space, and also when I don't have a heavy use of Mac.

    Now when I was surfing, all of a sudden my Mac stop automatically and when I rebooted him question mark flashing appears. Tried all the things available on net - but is not able to detect my drive hard back. So not able to repair or use first aid for hard disk and no option to format.

    So according to the different peoples view I think it's perhaps because of one of these:

    1 hard drive failure.

    2. defective cable.

    I'll be very grateful if someone can help me with this.

    Thanks in advance.

    Hi Senoritalife,

    Yes, it sounds like you may have a defective hard drive, or the fastening cable that became it loose. I advise to visit your local apple store and have then check hard drive status.

    Also, please try all the steps in this article before contacting the genius of Apple: https://support.apple.com/en-gb/HT204323

    Thank you

    Alex

  • "Latest" flash player help page also decommissioned?

    I use flash player direct download links on the help page to download the latest version of Flash Player for Firefox and IE, after that I received a notice from the CERT. I then use these installation programs to update our images. My question is will that page be dismantled as well, and I should just stop to download installers "last"? Links to actual installation are:

    https://fpdownload.Macromedia.com/pub/flashplayer/latest/Help/install_flash_player.exe

    https://fpdownload.Macromedia.com/pub/flashplayer/latest/Help/Install_flash_player_ax.exe

    The Flash Player Distribution changes FAQ does not appear at this address. Either way, I think it's ridiculous to turn off the download of distribution pages just because they are spoofed.

    Hello

    This page is not be taken out of service. Only Adobe Flash Player Distribution. Adobe

    unset. However, we recommend that you sign up for distribution on Adobe Flash Player Distribution License. Adobe

    If you want that the link to the distribution page.

    You can also get the flash player at the bottom of the mentioned link:

    Adobe Flash Player install for all versions

    Thank you!

  • New to Flash, need help.

    I'm new in the world of Adobe Flash and who need help. I have a banner rotator fla file is an xml file to produce the content. My question: How can I rename the file "config.xml" in "BannerConfig.xml" xml and still have it work with the flv file?

    We need a code in the FLA somewhere that specifies the name of the file to edit.  The code must be on the time line of the (or a).  If you see a frame (or frames) in the calendar that has a lowercase 'a' in this document, select this image and open the Actions window to view the code.  It is always possible that the code inside a movieclip as well.  And if the file uses AS2, it could even be attached to a symbol on the stage, in which case you will need to select the symbol on the stage, while the Actions panel is open to see the code.

  • Three basic flash questions

    Hey guys,.

    I'm pretty new to Flash but I just get the hang of things. I am trying to create an interactive slideshow in flash that will not end on the web. Here are three quick questions, I currently have. Thanks for any help you can provide

    1 Let's say I have an icon of a person in my flash file, how can I make sure that when my movements over the person a thought bubble appears and when she comes out of the bubble disappears?

    2. If I have a small picture of a version of the page of a .pdf file in my flash file, how can I do so that when the page icon little .pdf is click on the .pdf file is launched?

    3. I understand how to create a square to the text button and the refectory with its parameters to the top/bottom/more/click, but I wonder how I can do something like change the color of the text when clicked or when the mouse is on it? Right now I don't know how to change the color of the square button.

    Thanks much for any help you can provide these fundamental questions.

    1. If you understand what you're saying, that you do in your 3rd question, create this icon as a button and have thought as part more bubble.

    2. you create the small image as a button or a movieclip so that you can assign the code to him.  The code you assign depends on which version of actionscript will use your file, that you did not mention.

    3. If you are working with a button symbol, you probably just spend more time to play with them to understand how you can use the four frameworks.  To change the color of the text on working capital, you would have a different colored text in plus.  If you want the text to change color and stay like that when you click the button, then you will need to create the button as a movieclip.  Button symbols can be controlled in this way (exception for AS3, but it is not simple).

    The key to answer most of your questions and to learn that Flash is to play with Flash and see what works and what doesn't.  Try different tutorials as well.

  • Using Skins Flash - questions?

    Just improved RoboInfo 5 to RoboHelp 7 (long)

    I am plans to use a skin in Flash, but I'm just curious to know if there are problems in doing this.

    Is it possible to add a new menu button if I use a Flash skin (I have experience in the use of Flash, but don't think that it is possible to change the source code so I could create a new menu button as I did previously with html).

    Is using a skin Flash slow performance at all? I use a Flash skin just to get some cool animations so I know that this slowdown in application and affects the user experience.

    With the help of a Flash skin that I should be aware any other question?

    Hi hughbetcha

    There is no editor of FlashHelp skins there is in WebHelp. So add a button is normally right out, unless you have some Flash skills. But you said that you don't actually have Flash skills. So, you will be interested in the Skins Development Kit. Don't worry, this isn't a separate thing, you need to buy. It's really a collection of documents and source files to use. You should find it at the following location:

    C:\Program Files\Adobe\Adobe RoboHelp 7\FlashHelp SDK

    See you soon... Rick

Maybe you are looking for