I desire is quick/easy to solve, but I'm stuck AS problem 3
I thought I would teach my 10th grade class programming Action Script 3.0. We already crossed SmallBasic and they include conditional logic, loop etc... you give a little background so I thought we we Landa it in OBJECT-oriented programming language.
I have not touched A.S. Since back in 2.0 and I think I'm missing something. I used this tutorial as a foundation and updated to reflect the AS3.0 for my lecture notes.
That said, when you do their quiz, (a quiz 2 simple question that counts the score at the end of the quiz) I get an error of logic. Everything works without problems using the controls, I get variables back properly to the part of the interpreter, but the logical evaluation end returns a glitch where it counts against my last value clicked and uses two times to evaluate the truth. Probably I'm missing something simple and it'll take someone who knows Flash well about 3 seconds to ID my problem.
Thanks in advance.
FLA file you wish to browse:
SWF file if you want to display only:
If you don't want to dload files so here AS code at 3 locations (q1, q2, quizEnd)
Code block 1 to frame 1:
Initialize main timeline variables
Then create variables to store user responses:
var q1Answer; The user in question 1 answer
var q2Answer; User for question 2's answer
Then, create a variable to track the number of questions answered correctly:
var totalCorrect = 0; Number of counts of correct answers
Finally, stop the movie at the first question:
Stop();
choice1_btn.addEventListener (MouseEvent.CLICK, answer1);
function answer1(event_object:MouseEvent) {}
q1Answer = 1;
gotoAndStop ("q2");
trace (q1Answer);
}
choice2_btn.addEventListener (MouseEvent.CLICK, answer2);
function answer2(event_object:MouseEvent) {}
q1Answer = 2;
gotoAndStop ("q2");
trace (q1Answer);
}
choice3_btn.addEventListener (MouseEvent.CLICK, answer3);
function answer3(event_object:MouseEvent) {}
q1Answer = 3;
gotoAndStop ("q2");
trace (q1Answer);
}
Code 2 block to frame 10
choice1_btn.addEventListener (MouseEvent.CLICK, answer21);
function answer21(event_object:MouseEvent) {}
q2Answer = 1;
gotoAndStop ("quizEnd");
trace (q2Answer);
}
choice2_btn.addEventListener (MouseEvent.Click, answer22);
function answer22(event_object:MouseEvent) {}
q2Answer = 2;
gotoAndStop ("quizEnd");
trace (q2Answer);
}
choice3_btn.addEventListener (MouseEvent.Click, answer23);
function answer23(event_object:MouseEvent) {}
q2Answer = 3;
gotoAndStop ("quizEnd");
trace (q2Answer);
}
Code Block 3 to 20 frame
If (q1Answer == 3) {}
totalCorrect = totalCorrect + 1;
trace ("value of Q1 is 1 point");
} else {}
trace ("Wrong answer #1" + q1Answer);
}
If (q2Answer == 3) {}
totalCorrect ++; Simply adds to the previous value of the totalCorrect 1.
trace ("value of Q2 is 1 point");
} else {}
trace ("Wrong answer #2" + q2Answer);
}
final score displayed on interpreter
trace ("your total is" + totalCorrect + "/ 2 points");
Displays the response on the stage
var txtFld:TextField = new TextField();
addChild (txtFld);
txtFld.text = ("your total is" + totalCorrect);
txtFld.appendText (' / 2 points ");
extra bits to comment out text is included
txtFld.wordWrap = true;
txtFld.textColor = 0xFF00FF
txtFld.width = 150
txtFld.height = 60
Oh I see the problem.
you use the same names of button for q1 and q2 and you delete not all listeners. You must fix this.
Tags: Adobe Animate
Similar Questions
-
When I try to run Microsoft Fix it automated troubleshooting services, I get - "we're sorry, but we met an unexpected problem and cannot complete this diagnostic solution." I ran before with great success, but it did work for awhile now. I can't understand how uninstall/reinstall, or how to solve why it does not work for me any more. I run Vista Home Premium. This problem has happened to others?
original title: Microsoft Fix it does not workHello
Are your logged as administrator?
What I wanted was otherwise, what issues are having you? Why do you need to run a Fixit? This could
It does not lead to why the FixIt.Run DiskCleanup - start - all programs - Accessories - System Tools - Disk Cleanup
I would also like to launch SFC and Chkdsk to ensure that corruption is disabled.
Start - type this in the search box-> find COMMAND at the top and RIGHT CLICK – RUN AS ADMIN
Enter this at the command prompt - sfc/scannow
How to analyze the log file entries that the Microsoft Windows Resource Checker (SFC.exe) program
generates in Windows Vista cbs.log
http://support.Microsoft.com/kb/928228Run checkdisk - schedule it to run at the next startup, then apply OK then restart your way.
How to run the check disk at startup in Vista
http://www.Vistax64.com/tutorials/67612-check-disk-Chkdsk.html-----------------------------------------------------
Perhaps an installation problem.Spotlight utility Windows Installer CleanUp Utility
http://TechNet.Microsoft.com/en-us/magazine/2008.08.UtilitySpotlight.aspxDescription of the Windows Installer CleanUp utility
http://support.Microsoft.com/kb/290301Windows install 4.5 Redistributable
http://www.Microsoft.com/downloads/details.aspx?FamilyId=5A58B56F-60B6-4412-95B9-54D056D6F9F4&displaylang=enHope these helps.
Rob - bicycle - Mark Twain said it is good. -
I just bought first 13 items and I downloaded the installation file and spoke to install, but it is stuck at 2% on installation.
It then comes up with the error screen but I click on details, and he said: there is no Web page, I have restarted my computer, removed other Adobe products, I don't know what to do d:
I tried lot D:
He's going to tell me what IS the error that I have for it either... so I can check to fix D: said that there is no Web page...
alexas
Thanks for the reply.
You just solved your problem. If not all, basically everything. You need 64-bit installation files for your 64-bit computer.
You need two installation files - for extracting .exe and .7z the program itself. These two files have 64 in the name of the file if each is to be used in a 64-bit system.
If you have purchased serial number...
a. you can go after the series of 64-bit installation files where you are
or
b. downloading 64-bit from the following location and insert your serial number purchased by them during the installation.
http://prodesigntools.com/Photoshop-elements-13-direct-download-links-premiere.html
Important... carefully perform the ' Note: very important "on this web site in order to avoid the access denied Message. Don't forget: you are using the trip to Adobe mentioned must be authenticated, you use the web site for the 1 (.exe) file links and file 2 (7z).
or
Try download from c.
http://www.Adobe.com/downloads/other-downloads.html
Please let us know if your observation was the key to the solution.
Thank you.
RTA
-
As a newbie it is very basic, I imported my address book apparently ok, but I'm having a problem trying to address an e-mail to the address book in the address field, I'm a right click, left click, but no list of addresses appearing or contact component which I should be able to see all the entries in my address book. What am I doing wrong please?
Open a window of writing and press F9 to activate the touch pane.
-
My USB to ethernet adapter works only if plugged into my MacBook Pro.
I tried to use to start an expander USB (power strip), but this has not--a problem when you have only TWO USB ports ports!
Any suggestions?
Juice what 'expander' did you use?
What model of MacBook Pro?
This is the Office Mac Pro forum. I asked that your post be moved to the MacBook Pro laptop forum.
-
Hello
I have a hp RTL8723E laptop. It works perfectly fine. but there is only one problem in it. When I'm online I want to listen to background music, he doesn't play songs such that she should songs begin to freeze, but when im offline songs play correctly
my laptop spec.
1.40 ghz processor 4 GB ramHello
HP RTL8723E laptop
You have posted a number of wireless card in the printer section.
Maybe try again in notebooks with a model number?
-
I had a windows update error 800736B 3... and I've done sfc scan I got error WFP resourse found corrupt files but unable to fix some problem... so please me cum on this problem
If the SFC does not a repair installation should work.
http://www.Vistax64.com/tutorials/88236-repair-install-Vista.HTML?filter> -
Original title: cannot run Microsoft Fix It to Program_Install_and_Uninstall
When I run Microsoft Fix It for Program_Install_and_Uninstall, I get "we're sorry, but we encountered an unexpected problem, one or several upload components and cannot run the troubleshooter now...» »
Hello
Why you try to run the fix it tool?
Post to fix any problem with Microsoft tool in Microsoft Fix it Center forums.
http://social.Microsoft.com/forums/en-us/category/msftsupporttools -
I saw the problem with Windows Live Mail gel but I have the same problem with Windows Mail.
I saw the problem posted on Windows Live Mail gel but I have the same problem with Windows Mail. Sometimes, while mouse refuses I can scroll vertically with the keyboard, but not always... I changed to another wireless mouse, and this has not changed. I run Vista and can't find the update, that you reference. The reopening and closing program usually fixes it, but it's annoying. It happened for about 6 weeks or so.
Can anyone help?
I run Vista and can't find the update, that you reference.
What update WHO refers to?
Try to compact and repair the database.
WMUtil
http://www.oehelp.com/WMUtil/default.aspxAnd search for malware with the free version of this tool.
Malwarebytes Anti-Malware
http://www.Malwarebytes.org/MBAM.php -
Original title: MTU settings
I know the process to change the MTU setting, but I'm stuck when I try to implement because it says that I am not the administrator.
I am running windows 7 home premium, service pack 1.
I am the administrator in windows but not when I go to the C; \users\XXX > told me to click with the right button on command prompt and select run as administrator, but this option never comes.
Hello
Thank you for visiting Microsoft Community.
I suggest you to post your query on our Forums TechNet social as this question should be better there.
Please refer to the reference to the link below to send your request:
https://social.technet.Microsoft.com/forums/Windows/en-us/home?Forum=w7itpronetworking
Hope this information helps.
Thank you.
Sincerely,
Ankit Rajput
-
I train for adobe flash, but it gets stuck in the Middle download saying "close idvault. Cannot find where to close the application.
Click Start, type: Internet Options
Press enter
Select the "Advanced" tab
Under reset Internet Explorer settings, click "reset".
This should restore the Internet Explorer default settings.
Then reinstall Flash Player
http://get.Adobe.com/flashplayer/
----------
Flash Player
Troubleshoot installation of Flash Player for Windows
http://kb2.Adobe.com/CPS/191/tn_19166.html
Troubleshooting player stability and performance
http://blogs.Adobe.com/JD/2010/02/troubleshooting_player_stabili.html
Uninstaller
http://kb2.Adobe.com/CPS/141/tn_14157.html
Flash Player Support Forum
-
Windows 8 does not read DVD but CD runs without any problem
Original title - I habe upgrade to windows 8 way back but my DVD player does not read DVD but CD runs without any problem
DVD stalk does not read DVDs but reading the CD with no problems. Even in my computer drive shows as CD drive type.
Hi Rohan,
I suggest you try the steps suggested by AtishayMSFT dated dated March 6, 2012 at the following link:
Note: this section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article: back up the registry in Windows 7
-
It is a cc to indesign, the payment of one month, I bought yesterday, but my computer got the problem, I can instill in on another hard drive
Yes, your subscription can be activated on both computers at the same time for your non-simultaneous use, and you can disable an existing installation when installing on another machine.
-
I tried to download photoshop but its never stuck on the white screen with the loading squares. (MAC)
WHITE cloud screen http://forums.adobe.com/message/5484303 can help
- and http://helpx.adobe.com/creative-cloud/kb/blank-white-screen-ccp.html
- and step by step http://forums.adobe.com/thread/1440508?tstart=0
Mac https://forums.adobe.com/message/5470608 spinning wheel
-
whenever I open the creative cloud, it says I'm missing something, and I need to download again. But it says the same problem when I open the new download. Help!
Please uninstall creative cloud:
Uninstall or remove Adobe Creative Cloud applications
Reinstall it:
Download Adobe Creative cloud apps | Free trial of Adobe CC
I hope this helps.
Concerning
Megha Rawat
Maybe you are looking for
-
uogradee iOS 10.0.2. The new 6SPlus. Cannot use "share contact" w. "Share contact" text works only E-mail w. Any suggestions on how to get "share contact" "I work text msg w? Worked before detected to 10.0.2 last week great.
-
Script on web pages and email error
I looked at your solutions and they do not seem to work for me so I'll tell my story. I have a model HP Photosmart Premium 309 a print-scan-copy-fax works with Windows 7 and IE9. My cartridge black Hp stopped working and I replaced all the with the n
-
This ii detected but not added so can not print it collects in Quebec City
Last day that it was connected through the wizrd sent by hp support but once again the printer disconnects or shows etc in offline mode, so I not UNHOOKED REINSTALLED AND the driver, even in this case failed to connect. This problem is commin after I
-
My desktop DVD stopped everything by making the disks 'recover' - must #4 and the opening of the tray started and closing by itself. Tried to download the new driver, but nothing helped. Been "Regedit" but don't see any "FILTERS superiors or INFERIO
-
Windows Sidebar has stopped working
So a week ago I had a virus, it was picked up by AVG and it has been deleted. I always spent in SafeMode however, and proceeded to scan of my computer with AVG, Malwarebytes, Microsoft essentials, Spybot - Search and destroy, TDSSKILLER and SUPERAnt