8 Replies - 769 Views - Last Post: 01 August 2009 - 12:34 AM

#1 1a11ous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 10-July 09

New to ActionScript

Posted 30 July 2009 - 01:17 PM

Hello all,

I am getting 3 compile errors when I try the following:

package {
	import flash.text.*;
	import flash.display.*;
	
	public class HelloWorld3 extends MovieClip 
	{
	public function HelloWorld3()
	{
	var myText:TextField = new TextField(); //syntax error here
	myText.text = “Hello World!”;
	addChild(myText);
	}
	}
}//syntax error here



I am using Flash CS3 and AS 3.0

Thanks for the help

Is This A Good Question/Topic? 0
  • +

Replies To: New to ActionScript

#2 brandon_v  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 62
  • Joined: 29-May 08

Re: New to ActionScript

Posted 30 July 2009 - 04:53 PM

If you can tell us perhaps what the compile errors are, then we may be better able to help you.
Was This Post Helpful? 0
  • +
  • -

#3 1a11ous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 10-July 09

Re: New to ActionScript

Posted 31 July 2009 - 04:15 AM

Attached File  Desktop.zip (4.82K)
Number of downloads: 371093: Syntax error. -> myText.text = “Hello World!”;
1084: Syntax error: expecting rightbrace before World. -> myText.text = “Hello World!”;
1093: Syntax error. -> myText.text = “Hello World!”;

Location for all 3 errors: HelloWorld3.as, Line 10

This post has been edited by 1a11ous: 31 July 2009 - 04:50 AM

Was This Post Helpful? 0
  • +
  • -

#4 ayman_mastermind  Icon User is offline

  • human.setType("geek");
  • member icon

Reputation: 126
  • View blog
  • Posts: 1,860
  • Joined: 12-December 08

Re: New to ActionScript

Posted 31 July 2009 - 05:29 AM

@lallous, i tested your code and it works okay, it prints out Hello World 3 without outputting any errors. I am using CS4 maybe the code you are trying to execute works on CS4 and not on CS3. Anyways welcome to the community! It is good to see Lebanese people around here other than me :)
Was This Post Helpful? 0
  • +
  • -

#5 1a11ous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 10-July 09

Re: New to ActionScript

Posted 31 July 2009 - 06:38 AM

View Postayman_mastermind, on 31 Jul, 2009 - 04:29 AM, said:

@lallous, i tested your code and it works okay, it prints out Hello World 3 without outputting any errors. I am using CS4 maybe the code you are trying to execute works on CS4 and not on CS3. Anyways welcome to the community! It is good to see Lebanese people around here other than me :)

Thank you :)
It is indeed very weird that it is compiling.

All I am doing is creating an .AS script and paste the code into it.
Create a new Flash movie and add in the Document Class the name of the script and try to compile.
Was This Post Helpful? 0
  • +
  • -

#6 ayman_mastermind  Icon User is offline

  • human.setType("geek");
  • member icon

Reputation: 126
  • View blog
  • Posts: 1,860
  • Joined: 12-December 08

Re: New to ActionScript

Posted 31 July 2009 - 06:48 AM

Quote

Thank you
It is indeed very weird that it is compiling.

All I am doing is creating an .AS script and paste the code into it.
Create a new Flash movie and add in the Document Class the name of the script and try to compile.

Are you getting this code from a tutorial? Make sure you check which version this tutorial is targeted to...
Was This Post Helpful? 0
  • +
  • -

#7 1a11ous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 10-July 09

Re: New to ActionScript

Posted 31 July 2009 - 07:20 AM

Weirdly enough, the book I am using is called:
"ActionScript 3.0 Game Programming University"
Was This Post Helpful? 0
  • +
  • -

#8 1a11ous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 10-July 09

Re: New to ActionScript

Posted 31 July 2009 - 10:50 PM

I solved it.
I had saved the .as file twice by mistake so it was conflicting.
Thanks
Was This Post Helpful? 0
  • +
  • -

#9 ayman_mastermind  Icon User is offline

  • human.setType("geek");
  • member icon

Reputation: 126
  • View blog
  • Posts: 1,860
  • Joined: 12-December 08

Re: New to ActionScript

Posted 01 August 2009 - 12:34 AM

Quote

I solved it.
I had saved the .as file twice by mistake so it was conflicting.
Thanks

Oh, that is good to hear. Anyways your welcome. Hope to see you around :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1