Need help with this as3 code please
i got a book called
actionscript 3.0 adobe flash cs4 pro classroom in a book
well im on lesson 2 and i followed every step to the letter its supposed to let the user choose a language but when i play the movie the text i want to come up is scrambled for some reason?
so if some one could help thanks
i am using cs5 idk if that matters
http://www.mediafire.com/?memijczzo1y
In CS5, go to "Text"---->"Font Embedding...". ( Pic.1 )
Click on "All", ( Pic.2 )
Then click the "Add" button. ( Pic. 3 ) The font will appear below.
Then OK
Pic.1
Pic. 2
Pic. 3
Test your movie.
Should work now.
Similar Messages
-
New to Java and need help with this program..please!
I'd really appreciate any helpful comments about this program assignment that I have to turn in a week from Friday. I'm taking a class one night a week and completely new to Java. I'd ask my professor for help, but we can't call him during the week and he never answers e-mails. He didn't tell us how to call from other classes yet, and I just can't get the darn thing to do what I want it to do!
The assignment requirements are:
1. Change a card game application that draws two cards
and the higher card wins, to a Blackjack application
2. Include a new class called Hand
3. The Hand class should record the number of draws
4. The application should prompt for a number of draws
5. The game is played against the Dealer
6. The dealer always draws a card if the dealer's hand total is <= 17
7. Prompt the player after each hand if he wants to quit
8. Display the total games won by the dealer and total and the total games wond by the player after each hand
9. Display all of the dealer's and player's cards at the
end of each hand
10. Player has the option of drawing an additional card after the first two cards
11. The Ace can have a value of 11 or 1
(Even though it's not called for in the requirements, I would like to be able to let the Ace have a value of 1 or an 11)
The following is my code with some comments about a few things that are driving me nuts:
import java.util.*;
import javax.swing.*;
import java.text.*;
public class CardDeck
public CardDeck()
deck = new Card[52];
fill();
shuffle();
public void fill()
int i;
int j;
for (i = 1; i <= 13; i++)
for (j = 1; j <= 4; j++)
deck[4 * (i - 1) + j - 1] = new Card(i, j);
cards = 52;
public void shuffle()
int next;
for (next = 0; next < cards - 1; next++)
int rand = (int)(Math.random()*(next+1));
Card temp = deck[next];
deck[next] = deck[rand];
deck[rand] = temp;
public final Card draw()
if (cards == 0)
return null;
cards--;
return deck[cards];
public int changeValue()
int val = 0;
boolean ace = false;
int cds;
for (int i = 0; i < cards; i++)
if (cardValue > 10)
cardValue = 10;
if (cardValue ==1) {
ace = true;
val = val + cardValue;
if ( ace = true && val + 10 <= 21 )
val = val + 10;
return val;
public static void main(String[] args)
CardDeck d = new CardDeck();
int x = 3;
int i;
int wins = 1;
int playerTotal = 1;
do {
Card dealer = (d.draw());
/**I've tried everything I can think of to call the ChangeValue() method after I draw the card, but nothing is working for me.**/
System.out.println("Dealer draws: " + dealer);
do {
dealer = (d.draw());
System.out.println(" " + dealer);
}while (dealer.rank() <= 17);
Card mine = d.draw();
System.out.println("\t\t\t\t Player draws: "
+ mine);
mine = d.draw();
System.out.println("\t\t\t\t\t\t" + mine);
do{
String input = JOptionPane.showInputDialog
("Would you like a card? ");
if(input.equalsIgnoreCase("yes"))
mine = d.draw();
System.out.println("\t\t\t\t\t\t" + mine);
playerTotal++;
else if(input.equalsIgnoreCase("no"))
System.out.println("\t\t\t\t Player stands");
else
System.out.println("\t\tInvalid input.
Please try again.");
I don't know how to go about making and calling a method or class that will combine the total cards delt to the player and the total cards delt to the dealer. The rank() method only seems to give me the last cards drawn to compare with when I try to do the tests.**/
if ((dealer.rank() > mine.rank())
&& (dealer.rank() <= 21)
|| (mine.rank() > 21)
&& (dealer.rank() < 22)
|| ((dealer.rank() == 21)
&& (mine.rank() == 21))
|| ((mine.rank() > 21)
&& (dealer.rank() <= 21)))
System.out.println("Dealer wins");
wins++;
else
System.out.println("I win!");
break;
} while (playerTotal <= 1);
String stop = JOptionPane.showInputDialog
("Would you like to play again? ");
if (stop.equalsIgnoreCase("no"))
break;
if (rounds == 5)
System.out.println("Player wins " +
(CardDeck.rounds - wins) + "rounds");
} while (rounds <= 5);
private Card[] deck;
private int cards;
public static int rounds = 1;
public int cardValue;
/**When I try to compile this nested class, I get an error message saying I need a brace here and at the end of the program. I don't know if any of this code would work because I've tried adding braces and still can't compile it.**/
class Hand()
static int r = 1;
public Hand() { CardDeck.rounds = r; }
public int getRounds() { return r++; }
final class Card
public static final int ACE = 1;
public static final int JACK = 11;
public static final int QUEEN = 12;
public static final int KING = 13;
public static final int CLUBS = 1;
public static final int DIAMONDS = 2;
public static final int HEARTS = 3;
public static final int SPADES = 4;
public Card(int v, int s)
value = v;
suit = s;
public int getValue() { return value; }
public int getSuit() { return suit; }
public int rank()
if (value == 1)
return 4 * 13 + suit;
else
return 4 * (value - 1) + suit;
/**This works, but I'm confused. How is this method called? Does it call itself?**/
public String toString()
String v;
String s;
if (value == ACE)
v = "Ace";
else if (value == JACK)
v = "Jack";
else if (value == QUEEN)
v = "Queen";
else if (value == KING)
v = "King";
else
v = String.valueOf(value);
if (suit == DIAMONDS)
s = "Diamonds";
else if (suit == HEARTS)
s = "Hearts";
else if (suit == SPADES)
s = "Spades";
else
s = "Clubs";
return v + " of " + s;
private int value; //Value is an integer, so how can a
private int suit; //string be assigned to an integer?
}Thank you so much for offering to help me with this Jamie! When I tried to call change value using:
Card dealer = (d.changeValue());
I get an error message saying:
Incompatible types found: int
required: Card
I had my weekly class last night and the professor cleared up a few things for me, but I've not had time to make all of the necessary changes. I did find out how toString worked, so that's one question out of the way, and he gave us a lot of information for adding another class to generate random numbers.
Again, thank you so much. I really want to learn this but I'm feeling so stupid right now. Any help you can give me about the above error message would be appreciated. -
I need help with this crash log please
If anyone can help I would appreciate it. Garage Band keeps crashing since I upgraded yesterday. I'm enclosing the crash log.
Thanks
derek
Version: 2.0.2 (2.0.2 (50))
Build Version: 14
Project Name: GarageBand
Source Version: 850000
PID: 196
Thread: 0
Exception: EXCBADACCESS (0x0001)
Codes: KERNINVALIDADDRESS (0x0001) at 0xffffffbc
Thread 0 Crashed:
0 libSystem.B.dylib 0x9003e708 strlcpy + 136
1 ...apple.DfSearchEngineWrapper 0x6d076a78 std::vector<loop::SearchKey, std::allocator<loop::SearchKey> >::M_insert_aux(__gnu_cxx::__normaliterator<loop::SearchKey*, std::vector<loop::SearchKey, std::allocator<loop::SearchKey> > >, loop::SearchKey const&) + 300
2 ...apple.DfSearchEngineWrapper 0x6d065778 -[DfSearchEngineInnerWrapper doSearch] + 556
3 ...apple.DfSearchEngineWrapper 0x6d068310 -[DfSearchEngineWrapper doSearch] + 60
4 com.apple.garageband 0x000a0404 _code_start_ + 635380
5 com.apple.AppKit 0x936a4d2c -[NSApplication sendAction:to:from:] + 108
6 com.apple.garageband 0x000728f8 _code_start_ + 448232
7 com.apple.garageband 0x00072b54 _code_start_ + 448836
8 com.apple.garageband 0x000d232c _code_start_ + 839964
9 com.apple.garageband 0x0007308c _code_start_ + 450172
10 com.apple.garageband 0x000d1e28 _code_start_ + 838680
11 com.apple.AppKit 0x9365f9c8 -[NSWindow sendEvent:] + 4616
12 com.apple.AppKit 0x93608bfc -[NSApplication sendEvent:] + 4172
13 com.apple.garageband 0x000217c4 _code_start_ + 116148
14 com.apple.AppKit 0x93600090 -[NSApplication run] + 508
15 com.apple.AppKit 0x936f08bc NSApplicationMain + 452
16 com.apple.garageband 0x00027a08 _code_start_ + 141304
17 com.apple.garageband 0x00005410 _code_start_ + 512
18 com.apple.garageband 0x00005240 _code_start_ + 48
Thread 1:
0 libSystem.B.dylib 0x9002ca78 semaphorewait_signaltrap + 8
1 libSystem.B.dylib 0x9003125c pthreadcondwait + 508
2 com.apple.Foundation 0x9288a0a0 -[NSConditionLock lockWhenCondition:] + 68
3 com.apple.AppKit 0x936a07f8 -[NSUIHeartBeat _heartBeatThread:] + 324
4 com.apple.Foundation 0x92882f34 forkThreadForFunction + 108
5 libSystem.B.dylib 0x9002c3b4 pthreadbody + 96
Thread 2:
0 libSystem.B.dylib 0x9000a738 machmsgtrap + 8
1 libSystem.B.dylib 0x9000a67c mach_msg + 60
2 com.apple.CoreFoundation 0x9074b338 __CFRunLoopRun + 832
3 com.apple.CoreFoundation 0x9074ac3c CFRunLoopRunSpecific + 268
4 com.apple.audio.CoreAudio 0x913a61dc HALRunLoop::OwnThread(void*) + 264
5 com.apple.audio.CoreAudio 0x913a5f7c CAPThread::Entry(CAPThread*) + 96
6 libSystem.B.dylib 0x9002c3b4 pthreadbody + 96
Thread 3:
0 libSystem.B.dylib 0x90056418 semaphoretimedwait_signaltrap + 8
1 libSystem.B.dylib 0x900723b0 pthreadcond_timedwait_relativenp + 592
2 com.apple.audio.CoreAudio 0x913b6f80 CAGuard::WaitFor(unsigned long long) + 204
3 com.apple.audio.CoreAudio 0x913b6e90 CAGuard::WaitUntil(unsigned long long) + 304
4 com.apple.audio.CoreAudio 0x913b5100 HP_IOThread::WorkLoop() + 852
5 com.apple.audio.CoreAudio 0x913b4d98 HPIOThread::ThreadEntry(HPIOThread*) + 16
6 com.apple.audio.CoreAudio 0x913a5f7c CAPThread::Entry(CAPThread*) + 96
7 libSystem.B.dylib 0x9002c3b4 pthreadbody + 96
Thread 4:
0 libSystem.B.dylib 0x90056418 semaphoretimedwait_signaltrap + 8
1 libSystem.B.dylib 0x900723b0 pthreadcond_timedwait_relativenp + 592
2 ...ple.CoreServices.CarbonCore 0x90b6c728 TSWaitOnSemaphoreCommon + 176
3 ...ple.CoreServiI'm still suffering with this problem. I've tried many things but to no avail and would like to be able to use Garage band. I've renstalled Quicktime and reverted to an older version as well but nothing seems to help including logging in as a new user.
If anyone can help I would be very happy.
Thanks
Derek -
And your question is?
My comment so far is:
You need to be specific in your questions and use code tags.And your question is?
My comment so far is:
You need to be specific in your questions and use
code tags.My comment so far is:
Start coding... -
I need help with this while() statement please!
So I'm pretty new to Java programming and I cannot seem to understand why this is not looping if the user inputs a "n" at the end.
Here is my code:
* proj1nrh.java
* Created on September 28, 2007, 2:42 PM
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package proj1nrh;
* @author Nate
import java.util.Scanner;
public class proj1nrh {
/** Creates a new instance of proj1nrh */
public proj1nrh() {
public static void main(String[] args) {
String areYouFinished;
char repeat;
Scanner keyboard = new Scanner (System.in);
int numericResponse1,
numericResponse2,
numericResponse3,
numericResponse4,
numericResponse5,
numericResponse6,
numericResponse7;
System.out.println("Survey #1");
System.out.println("Please enther the numerical student responses (1-5) for each question:");
System.out.println("Q1. The instructor was available for consultation.");
numericResponse1 = keyboard.nextInt ();
System.out.println("Q2. Student responsibilities for this course were well defined.");
numericResponse2 = keyboard.nextInt ();
System.out.println("Q3. Class time well spent.");
numericResponse3 = keyboard.nextInt ();
System.out.println("Q4. I learned a lot from the intructor in this course.");
numericResponse4 = keyboard.nextInt ();
System.out.println("Q5. Course material contributed to my learning.");
numericResponse5 = keyboard.nextInt ();
System.out.println("Q6. I was challenged in this course.");
numericResponse6 = keyboard.nextInt ();
System.out.println("Q7. Coming into this course, I was motivated to learn this subject.");
numericResponse7 = keyboard.nextInt ();
//Consume new line
keyboard.nextLine();
System.out.println("Are you finished (y/n)?");
areYouFinished = keyboard.nextLine();
repeat = areYouFinished.charAt(0);
} while (repeat == 'n' || repeat == 'N');
Thanks for the help!Ight you guys have been great help.... but I'm having another problem
* proj1nrh.java
* Created on September 28, 2007, 2:42 PM
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package proj1nrh;
* @author Nate
import com.sun.xml.internal.bind.v2.schemagen.xmlschema.List;
import java.util.Scanner;
import java.util.ArrayList;
public class proj1nrh {
/** Creates a new instance of proj1nrh */
public proj1nrh() {
public static void main(String[] args) {
String areYouFinished;
char repeat;
int n = 0;
Scanner keyboard = new Scanner (System.in);
int numericResponse1, sumOfResponse1,
numericResponse2, sumOfResponse2,
numericResponse3, sumOfResponse3,
numericResponse4, sumOfResponse4,
numericResponse5, sumOfResponse5,
numericResponse6, sumOfResponse6,
numericResponse7, sumOfResponse7;
ArrayList storeValue1 = new ArrayList ();
ArrayList storeValue2 = new ArrayList ();
ArrayList storeValue3 = new ArrayList ();
ArrayList storeValue4 = new ArrayList ();
ArrayList storeValue5 = new ArrayList ();
ArrayList storeValue6 = new ArrayList ();
ArrayList storeValue7 = new ArrayList ();
do {
n = n + 1;
System.out.println("Survey #1");
System.out.println("Please enther the numerical student responses (1-5) for each question:");
System.out.println("Q1. The instructor was available for consultation.");
numericResponse1 = keyboard.nextInt ();
storeValue1.add(numericResponse1);
System.out.println("Q2. Student responsibilities for this course were well defined.");
numericResponse2 = keyboard.nextInt ();
storeValue2.add(numericResponse2);
System.out.println("Q3. Class time well spent.");
numericResponse3 = keyboard.nextInt ();
storeValue3.add(numericResponse3);
System.out.println("Q4. I learned a lot from the intructor in this course.");
numericResponse4 = keyboard.nextInt ();
storeValue4.add(numericResponse4);
System.out.println("Q5. Course material contributed to my learning.");
numericResponse5 = keyboard.nextInt ();
storeValue5.add(numericResponse5);
System.out.println("Q6. I was challenged in this course.");
numericResponse6 = keyboard.nextInt ();
storeValue6.add(numericResponse6);
System.out.println("Q7. Coming into this course, I was motivated to learn this subject.");
numericResponse7 = keyboard.nextInt ();
storeValue7.add(numericResponse7);
//Consume new line
keyboard.nextLine();
System.out.println("Are you finished (y/n)?");
areYouFinished = keyboard.nextLine();
repeat = areYouFinished.charAt(0);
} while (repeat == 'n' || repeat == 'N');
int sum = 0;
}I want to get the sum of each ArrayList 1-7 so I can divide this sum by "n" and display the average output.
Thanks! -
Another Videora Post- I just need help with this one problem, please!
I am guessing that the best way to convert your videos to an iPod compatible format is Videora. It works lovely, except for one glitch. I notice that the audio is noticeably off when I play the video. Any solution on how to fix this? I would really appreciate it if anyone helped me out on this
Windows XPIt is on both, I am thinking.. I tried it with a movie avi file, and it always comes out off.
-
Need help with a widget code please
Hello everyone and Happy Holidays
I have been trying to learn some simple codes for the widgets and here is one that does some of what I want but I cannot get the line that create the send to an email address work
<FORM ACTION="/cgi-bin/html/formdump.cgi"
METHOD="GET" ENCTYPE="application/x-www-form-urlencoded">
E-mail address: <INPUT TYPE="text" NAME="email" SIZE="20">
<INPUT TYPE="radio" NAME="abonnement" VALUE="s'abonner" CHECKED> s'abonner
<INPUT TYPE="radio" NAME="abonnement" VALUE="se désabonner"> se désabonner
<INPUT TYPE="submit" VALUE="Submit">
</FORM>
another line I would like to add is a size so the box is formatted properly but everytime I do that I mess up things more.
Thank you for your help
Mireillethank you Kirk,
You are correct in saying that I do not want to go there. Tough code is not for me
So how can I have a form where people choose subscribe or unsubscribe then when they submit I get an email?
Thanks
Mireille -
Please I really need help with this video problem.
Hi!
Please I need help with this app I am trying to make for an Android cellphone and I've been struggling with this for a couple of months.
I have a main flash file (video player.fla) that will load external swf files. This is the main screen.When I click the Sets Anteriores button I want to open another swf file called sets.swf.The app is freezing when I click Sets Anteriores button
Here is the code for this fla file.
import flash.events.MouseEvent;
preloaderBar.visible = false;
var loader:Loader = new Loader();
btHome.enabled = false;
var filme : String = "";
carregaFilme("home.swf");
function carregaFilme(filme : String ) :void
var reqMovie:URLRequest = new URLRequest(filme);
loader.load(reqMovie);
loader.contentLoaderInfo.addEventListener(Event.OPEN,comeco);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,progresso);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completo);
palco.addChild(loader);
function comeco(event:Event):void
preloaderBar.visible = true;
preloaderBar.barra.scaleX = 0;
function progresso(e:ProgressEvent):void
var perc:Number = e.bytesLoaded / e.bytesTotal;
preloaderBar.percent.text = Math.ceil(perc*100).toString();
preloaderBar.barra.scaleX = perc;
function completo(e:Event):void
preloaderBar.percent.text = '';
preloaderBar.visible = false;
btHome.addEventListener(MouseEvent.MOUSE_DOWN,onHomeDown);
btHome.addEventListener(MouseEvent.MOUSE_UP,onHomeUp);
btSets.addEventListener(MouseEvent.MOUSE_DOWN,onSetsDown);
btSets.addEventListener(MouseEvent.MOUSE_UP,onSetsUp);
btVivo.addEventListener(MouseEvent.MOUSE_DOWN,onVivoDown);
btVivo.addEventListener(MouseEvent.MOUSE_UP,onVivoUp);
btHome.addEventListener(MouseEvent.CLICK,onHomeClick);
btSets.addEventListener(MouseEvent.CLICK,onSetsClick);
function onSetsClick(Event : MouseEvent) : void
if (filme != "sets.swf")
filme = "sets.swf";
carregaFilme("sets.swf");
function onHomeClick(Event : MouseEvent) : void
if (filme != "home.swf")
filme = "home.swf";
carregaFilme("home.swf");
function onHomeDown(Event : MouseEvent) : void
btHome.y += 1;
function onHomeUp(Event : MouseEvent) : void
btHome.y -= 1;
function onSetsDown(Event : MouseEvent) : void
btSets.y += 1;
function onSetsUp(Event : MouseEvent) : void
btSets.y -= 1;
function onVivoDown(Event : MouseEvent) : void
btVivo.y += 1;
function onVivoUp(Event : MouseEvent) : void
btVivo.y -= 1;
Now this is the sets.fla file:
Here is the code for sets.fla
import flash.utils.Timer;
import flash.events.TimerEvent;
var video:Video;
var nc:NetConnection;
var ns:NetStream;
var t : Timer = new Timer(1000,0);
var meta:Object = new Object();
this.addEventListener(Event.ADDED_TO_STAGE,init);
function init(e:Event):void{
video= new Video(320, 240);
addChild(video);
video.x = 80;
video.y = 100;
nc= new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, onStatusEvent);
ns.bufferTime = 1;
ns.client = meta;
video.attachNetStream(ns);
ns.play("http://www.djchambinho.com/videos/segundaquinta.flv");
ns.pause();
t.addEventListener(TimerEvent.TIMER,timeHandler);
t.start();
function onStatusEvent(stat:Object):void
trace(stat.info.code);
meta.onMetaData = function(meta:Object)
trace(meta.duration);
function timeHandler(event : TimerEvent) : void
if (ns.bytesLoaded>0&&ns.bytesLoaded == ns.bytesTotal )
ns.resume();
t.removeEventListener(TimerEvent.TIMER,timeHandler);
t.stop();
The problem is when I test it on my computer it works but when I upload it to my phone it freezes when I click Sets Anteriores button.
Please help me with this problem I dont know what else to do.
thank youMy first guess is you're simply generating an error. You'll always want to load this on your device in quick debugging over USB so you can see any errors you're generating.
Outside that, if you plan on accessing anything inside the SWF you should be loading the SWF into the correct context. Relevant sample code:
var context:LoaderContext = new LoaderContext();
context.securityDomain = SecurityDomain.currentDomain;
context.applicationDomain = ApplicationDomain.currentDomain;
var urlReq:URLRequest = new URLRequest("http://www.[your_domain_here].com/library.swf");
var ldr:Loader = new Loader();
ldr.load(urlReq, context);
More information:
http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204-7de0.html
If you're doing this on iOS you'll need to stripped SWFs if you plan on using any coding (ABC) inside the files. You mentioned iOS so I won't get into that here, but just incase, here's info on stripping external SWFs:
http://blogs.adobe.com/airodynamics/2013/03/08/external-hosting-of-secondary-swfs-for-air- apps-on-ios/ -
I need help with this script please ASAP
So I need this to work properly, but when ran and the correct answer is chosen the app quits but when the wrong answer is chosen the app goes on to the next question. I need help with this ASAP, it is due tommorow. Thank you so much for the help if you can.
The script (Sorry if it's a bit long):
#------------Startup-------------
display dialog "Social Studies Exchange Trviva Game by Justin Parzik" buttons {"Take the Quiz", "Cyaaaa"} default button 1
set Lolz to (button returned of the result)
if Lolz is "Cyaaaa" then
killapp()
else if Lolz is "Take the Quiz" then
do shell script "say -v samantha Ok starting in 3…2…1…GO!"
#------------Question 1-----------
display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
set A1 to (button returned of the result)
if A1 is "Apprentices" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#----------Question 2--------
display dialog "Most children were taught
to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
set A2 to (button returned of the result)
if A2 is "Bible" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#------------Question 3---------
display dialog "In the 1730s and 1740s, a religious movement called the_______swept through the colonies." buttons {"Glorius Revolution", "Great Awakening", "The Enlightenment"}
set A3 to (button returned of the result)
if A3 is "Great Awakening" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#-----------Question 4--------
display dialog "_______ was
a famous American Enlightenment figure." buttons {"Ben Franklin", "George Washington", "Jesus"}
set A4 to (button returned of the result)
if A4 is "Ben Franklin" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#----------Question 5-------
display dialog "______ ownership gave colonists political rights as well as prosperity." buttons {"Land", "Dog", "Slave"}
set A5 to (button returned of the result)
if A5 is "Land" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#---------Question 6--------
display dialog "The first step toward guaranteeing these rights came in 1215. That
year, a group of English noblemen forced King John to accept the…" buttons {"Declaration of Independence", "Magna Carta", "Constitution"}
set A6 to (button returned of the result)
if A6 is "Magna Carta" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#----------Question 7--------
display dialog "England's cheif lawmaking body was" buttons {"the Senate", "Parliament", "King George"}
set A7 to (button returned of the result)
if A7 is "Parliament" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#--------Question 8-----
display dialog "Pariliament decided to overthrow _______ for not respecting their rights" buttons {"King James II", "King George", "King Elizabeth"}
set A8 to (button returned of the result)
if A8 is "King James II" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#--------Question 9------
display dialog "Parliament named ___ and ___ as England's new monarchs in something called ____." buttons {"William/Mary/Glorius Revolution", "Adam/Eve/Great Awakening", "Johhny/Mr.Laphalm/Burning of the hand ceremony"}
set A9 to (button returned of the result)
if A9 is "William/Mary/Glorius Revolution" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#---------Question 10-----
display dialog "After accepting the throne William and Mary agreed in 1689 to uphold the English Bill of _____." buttons {"Money", "Colonies", "Rights"}
set A10 to (button returned of the result)
if A10 is "Rights" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#---------Question 11------
display dialog "By the late 1600s French explorers had claimed the ___ River Valey" buttons {"Mississippi", "Ohio", "Hudson"}
set A11 to (button returned of the result)
if A11 is "Ohio" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#------Question 12---------
display dialog "______ was sent to ask the French to leave 'English Land'." buttons {"Johhny Tremain", "George Washington", "Paul Revere"}
set A12 to (button returned of the result)
if A12 is "George Washington" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#---------Question 13-------
display dialog "_____ proposed the Albany Plan of Union" buttons {"George Washingon", "Ben Franklin", "John Hancock"}
set A13 to (button returned of the result)
if A13 is "Ben Franklin" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#--------Question 14------
display dialog "The __________ declared that England owned all of North America east of the Mississippi" buttons {"Proclomation of England", "Treaty of Paris", "Pontiac Treaty"}
set A14 to (button returned of the result)
if A14 is "" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#-------Question 15-------
display dialog "Braddock was sent to New England so he could ______" buttons {"Command an attack against French", "Scalp the French", "Kill the colonists"}
set A15 to (button returned of the result)
if A15 is "Command an attack against French" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#------TheLolQuestion-----
display dialog "____ is the name of the teacher who runs this class." buttons {"Mr.White", "Mr.John", "Paul Revere"} default button 1
set LOOL to (button returned of the result)
if LOOL is "Mr.White" then
do shell script "say -v samantha Congratulations…you…have…common…sense"
else
do shell script "say -v alex Do…you…have…eyes?"
#------END------
display dialog "I hope you enjoyed the quiz!" buttons {"I did!", "It was horrible"}
set endmenu to (button returned of the result)
if endmenu is "I did!" then
do shell script "say -v samantha Your awesome"
else
do shell script "say -v alex Go outside and run a lap"
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end ifUse code such as:
display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
set A1 to (button returned of the result)
if A1 is "Apprentices" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
return
end if
#----------Question 2--------
display dialog "Most children were taught to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
set A2 to (button returned of the result)
if A2 is "Bible" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
return
end if
(90444) -
Please help! I am trying to change my Apple Id that used to be my mother to Mine- Every time i have it changed and i go and try and do an update it continues to ask for her old password. I really need help with this!
Phil0124 wrote:
Apps downloaded with an Apple ID are forever tied to that Apple ID and will always require it to update.
The only way around this is to delete the apps that require the other Apple ID and download them again with yours.
Or simply log out of iTunes & App stores then log in with updated AppleID. -
I need help with this code error "unreachable statement"
the error_
F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
int index;
^
F:\Java\Projects\Tools.java:71: missing return statement
}//end delete method
^
F:\Java\Projects\Tools.java:86: missing return statement
}//end getrecod
^
3 errors
import java.util.*;
import javax.swing.*;
import java.awt.*;
public class Tools//tool class
private int numberOfToolItems;
private ToolItems[] toolArray = new ToolItems[10];
public Tools()//array of tool
numberOfToolItems = 0;
for(int i = 0; i < toolArray.length; i++)//for loop to create the array tools
toolArray[i] = new ToolItems();
}//end for loop
}//end of array of tools
public int search(int id)//search mehtod
int index = 0;
while (index < numberOfToolItems)//while and if loop search
if(toolArray[index].getID() == id)
return index;
else
index ++;
}//en while and if loop
return -1;
}//end search method
public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
if(numberOfToolItems >= toolArray.length)
return 0;
int index;
index = search(id); <-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------HERE
if (index == -1)
toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
numberInStock ++;
return 1;
}//end if index
}//end if toolitem array
return -1;
}//end insert method
public int delete(/*int id*/)//delete method
}//end delete method
public void display()//display method
for(int i = 0; i < numberOfToolItems; i++)
//toolArray.display(g,y,x);
}//end display method
public String getRecord(int i)//get record method
// return toolArray[i].getName()+ "ID: "+toolArray[i].getID()
}//end getrecod
}//end class
Edited by: ladsoftware on Oct 9, 2009 6:08 AM
Edited by: ladsoftware on Oct 9, 2009 6:09 AM
Edited by: ladsoftware on Oct 9, 2009 6:10 AM
Edited by: ladsoftware on Oct 9, 2009 6:11 AMladsoftware wrote:
Subject: Re: I need help with this code error "unreachable statement"
F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
int index;
^
F:\Java\Projects\Tools.java:71: missing return statement
}//end delete method
^
F:\Java\Projects\Tools.java:86: missing return statement
}//end getrecod
^
3 errorsThe compiler is telling you exactly what the problems are:
public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
if(numberOfToolItems >= toolArray.length)
return 0; // <<== HERE you return, so everyting in the if block after this is unreachable
int index;
index = search(id); //< -----------------------------------------------------------------------------------------------------------------HERE
if (index == -1)
toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
numberInStock ++;
return 1;
}//end if index
}//end if toolitem array
return -1;
}//end insert method
public int delete(/*int id*/)//delete method
// <<== HERE where is the return statement?
}//end delete method
public String getRecord(int i)//get record method
// return toolArray.getName()+ "ID: "+toolArray[i].getID() <<== HERE you commented out the return statement
}//end getrecod
}//end class -
Please need help with this query
Hi !
Please need help with this query:
Needs to show (in cases of more than 1 loan offer) the latest create_date one time.
Meaning, In cases the USER_ID, LOAN_ID, CREATE_DATE are the same need to show only the latest, Thanks!!!
select distinct a.id,
create_date,
a.loanid,
a.rate,
a.pays,
a.gracetime,
a.emailtosend,
d.first_name,
d.last_name,
a.user_id
from CLAL_LOANCALC_DET a,
loan_Calculator b,
bv_user_profile c,
bv_mr_user_profile d
where b.loanid = a.loanid
and c.NET_USER_NO = a.resp_id
and d.user_id = c.user_id
and a.is_partner is null
and a.create_date between
TO_DATE('6/3/2008 01:00:00', 'DD/MM/YY HH24:MI:SS') and
TO_DATE('27/3/2008 23:59:00', 'DD/MM/YY HH24:MI:SS')
order by a.create_datePerhaps something like this...
select id, create_date, loanid, rate, pays, gracetime, emailtosend, first_name, last_name, user_id
from (
select distinct a.id,
create_date,
a.loanid,
a.rate,
a.pays,
a.gracetime,
a.emailtosend,
d.first_name,
d.last_name,
a.user_id,
max(create_date) over (partition by a.user_id, a.loadid) as max_create_date
from CLAL_LOANCALC_DET a,
loan_Calculator b,
bv_user_profile c,
bv_mr_user_profile d
where b.loanid = a.loanid
and c.NET_USER_NO = a.resp_id
and d.user_id = c.user_id
and a.is_partner is null
and a.create_date between
TO_DATE('6/3/2008 01:00:00', 'DD/MM/YY HH24:MI:SS') and
TO_DATE('27/3/2008 23:59:00', 'DD/MM/YY HH24:MI:SS')
where create_date = max_create_date
order by create_date -
Hi!!
I urgently need help with this:
When I compile this in Flex Builder 3 it says: The element type 'mx:Application' must be terminated by the matching end-tag '</mx:Application>'.
but I have this end tag in my file, but when I try to switch from source view to desgin view it says, that: >/mx:Script> expected to terminate element at line 71, this is right at the end of the .mxml file. I have actionscript(.as) file for scripting data.
This is the mxml code to terminate apllication tag which I did as you can see:
MXML code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#007200, #000200]" width="1024" height="768" applicationComplete="popolni_vse()">
<mx:HTTPService id="bazaMME" url="lokalnabaza/baza_MME_svn.xml" showBusyCursor="true" resultFormat="e4x"/>
<mx:Script source="dajzaj.as"/>
<mx:states>
<mx:State name="Galerije">
<mx:SetProperty target="{panel1}" name="title" value="Galerije MME"/>
<mx:SetProperty target="{panel2}" name="title" value="opis slik"/>
<mx:SetProperty target="{panel3}" name="title" value="Opis Galerije"/>
<mx:AddChild relativeTo="{panel1}" position="lastChild">
<mx:HorizontalList x="0" y="22" width="713.09863" height="157.39436" id="ListaslikGalerije"></mx:HorizontalList>
</mx:AddChild>
<mx:SetProperty target="{text1}" name="text" value="MME opisi galerij "/>
<mx:AddChild relativeTo="{panel1}" position="lastChild">
<mx:Label x="217" y="346" text="labela za test" id="izbr"/>
</mx:AddChild>
<mx:SetProperty target="{label1}" name="text" value="26. November 2009@08:06"/>
<mx:SetProperty target="{label1}" name="x" value="845"/>
<mx:SetProperty target="{label1}" name="width" value="169"/>
<mx:SetProperty target="{Gale}" name="text" value="plac za Galerije"/>
</mx:State>
<mx:State name="Projekti"/>
</mx:states>
<mx:MenuBar id="MMEMenu" labelField="@label" showRoot="true" fillAlphas="[1.0, 1.0]" fillColors="[#043D01, #000000]" color="#9EE499" x="8" y="24"
itemClick="dajVsebino(event)" width="1006.1268" height="21.90141">
<mx:XMLList id="MMEmenuModel">
<menuitem label="O nas">
<menuitem label="reference podjetja" name="refMME" type="check" groupName="one"/>
<menuitem label="reference direktor" name="refdir" type="check" groupName="one"/>
<menuitem label="Kontakt" name="podatMME" groupName="one" />
<menuitem label="Kje smo" name="lokaMME" type="check" groupName="one" />
</menuitem>
<menuitem type="separator"/>
<menuitem label="Galerija">
<menuitem label="Slovenija" name="galSvn" type="check" groupName="one"/>
<menuitem label="Nemčija" name="galDeu" type="check" groupName="one" />
</menuitem>
<menuitem type="separator"/>
<menuitem label="projekti">
<menuitem label="Slovenija" name="projSvn" type="check" groupName="one"/>
<menuitem label="Nemčija" name="projDeu" type="check" groupName="one" />
<menuitem label="Madžarska" name="projHun" type="check" groupName="one"/>
</menuitem>
</mx:XMLList>
</mx:MenuBar>
<mx:Label x="845" y="10" text="25. November 2009@08:21" color="#FFFFFF" width="169" height="18.02817" id="label1"/>
<mx:Label x="746" y="10" text="zadnja posodobitev:" color="#FFFFFF"/>
<mx:Panel x="9" y="57" width="743.02814" height="688.4507" layout="absolute" title="Plac za Vsebino" id="panel1">
<mx:Text x="0" y="-0.1" text="MME vsebina" width="722.95776" height="648.4507" id="Gale"/>
</mx:Panel>
<mx:Label x="197.25" y="748.45" color="#FFFFFF" text="Copyright © 2009 MME d.o.o." fontSize="12" width="228.73239" height="20"/>
<mx:Label x="463.35" y="748.45" text="izdelava spletnih strani: FACTUM d.o.o." color="#FBFDFD" fontSize="12" width="287.60565" height="20"/>
<mx:Panel x="759" y="53" width="250" height="705.07043" layout="absolute" title="Plac za hitre novice" id="panel3">
<mx:Text x="0" y="0" text="MME novice" width="230" height="665.07043" id="text1"/>
<mx:Panel x="-10" y="325.35" width="250" height="336.61972" layout="absolute" title="začasna panela" color="#000203" themeColor="#4BA247" cornerRadius="10" backgroundColor="#4B9539" id="panel2">
<mx:Label x="145" y="53" text="vrednost" id="spremmen"/>
<mx:Label x="125" y="78" text="Label"/>
<mx:Label x="125" y="103" text="Label"/>
<mx:Label x="0" y="53" text="spremenljivka iz Menuja:"/>
<mx:Label x="45" y="78" text="Label"/>
<mx:Label x="45" y="103" text="Label"/>
</mx:Panel>
</mx:Panel>
<mx:Label x="9.9" y="10" text="plac za naslov MME vsebine" id="MMEnaslov" color="#040000"/>
</mx:states></mx:Application>I know it's been a while but… did you fix this?
It looks to me like you are terminating the <mx:Application> tag at the top. The opening tag should end like this: resultFormat="e4x">, not resultFormat="e4x"/> (Remove the /).
Carlos -
I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio 2013?
For MS Visio (any version) only the appropriate version of Acrobat *PRO* provides PDFMaker for Visio.
For Visio 2013 specifically you must have Acrobat XI Pro (updated to at least 11.0.1).
See:
http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html
Be well... -
I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio 2013?
For MS Visio (any version) only the appropriate version of Acrobat *PRO* provides PDFMaker for Visio.
For Visio 2013 specifically you must have Acrobat XI Pro (updated to at least 11.0.1).
See:
http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html
Be well...
Maybe you are looking for
-
How do i download all my iTunes from the cloud to my new iMac?
Hi all, I have a new iMac (and very happy), i have opened it up and entered my icloud information and all my music stored in the cloud is there but greyed out. How do I download it onto the computer? I kept getting error=5099 Can any one help? I have
-
I get a little box asking me what sort of connection I want to get to the internet, but I am already connected to the web when this happens. This just started happening, and I haven't changed any settings. How do I get rid this box (it asks me if I w
-
Reg: 4.7 SR1 Runtime error
Hi All, We have installed 4.7SR1 on SunSolaries, the installation was finished successfully. When I execute the transaction SICK it thrown an error saying that OS release SunOS 5.10 Generic_137111-01 sun4v is not supported with this kernel (620) Plea
-
A problem about jsp:include
When I use <jsp:include page="list.jsp" > <jsp:param name="year" value="2002" /> </jsp:include> how can I get the value of the param year in the jsp list.jsp?
-
DS 6.2 database corruption
Hi, Last week we our directory database became corrupt. I managed to get things restored BUT i suspect that I'm in need of a patch. -bash-3.00$ /opt/SUNWdsee/ds6/bin/dsadm -V [dsadm] dsadm : 6.2 B2007.192.2248 [slapd