;

PDA

Click to See Complete Forum and Search --> : [F9/AS3] HelloWorld project


walnoot
08-05-2006, 03:25 PM
Since there's no AS3 forum and I know a couple of guys around here are already progressing in AS3 I hope you don't bother me asking a total newbie question on this.

Here (http://livedocs.macromedia.com/labs/as3preview/docs/wwhelp/wwhimpl/js/html/wwhelp.htm) they give the really first start in AS3, the program that's always your first in every language:the HelloWorld application.

They tell you to make a Greeter.as

package
{
public class Greeter
{
public static function sayHello():String
{
var greeting:String = "Hello World!";
return greeting;
}
}
}

and a HelloWorld.fla

var myGreeter:Greeter = new Greeter("Bob");
mainText.text = myGreeter.greeting;

in the HelloWorld.fla you drag a textfield on the stage and give it the instancename:mainText

when I test the movie it says:

ArgumentError: Error #1063: Argument count mismatch on Greeter$iinit(). Expected 0, got 1.
at Timeline0_f9b48cb254eeb04dbca16453c75a97e/::frame1()


I really want to take the time to intensively study AS3 in the upcoming years but for now I really don't understand what I do wrong, I did this tut three times over to ensure myself I didn't make any typo's.

Thanks in advance,
Wouter

tonypa
08-05-2006, 03:47 PM
Try this:

var myGreeter:Greeter = new Greeter();
mainText.text = myGreeter.sayHello();

walnoot
08-05-2006, 03:56 PM
ReferenceError: Error #1069: Property sayHello not found on Greeter and there is no default value.
at Timeline0_b4855bc6ae8f844b9ab15137b14a1f7c/::frame1()


I can test a movie in flash as long as the .as-file is in the same folder am I?

tonypa
08-05-2006, 04:29 PM
Remove static:
public function sayHello():String
{
var greeting:String = "Hello World!";
return greeting;
}

walnoot
08-05-2006, 04:40 PM
Thank you, now I got something to start from. I must say that's a pretty buggy tutorial Macromedia presents us there. Thanks again.

PS. Do you know if there's talking about an AS3-forum here on flashkit? Or can't they because it's not yet a launched thing?

tonypa
08-06-2006, 04:02 AM
Do you know if there's talking about an AS3-forum here on flashkit? Or can't they because it's not yet a launched thing?

Yes, AS3+Flex+Flash9 forum has been proposed several times. Its not so much that Flash9 is not out yet since Flex is out and it uses AS3 too, but so far there has not been enough interested members and they dont want to create forum for only few people. Anyone thinking AS3/Flash9/Flex forum is needed, please post in the feedback section.

walnoot
08-06-2006, 05:43 AM
Ok, so maybe we all can reply in the following topic?
we want an AS3-forum! (http://board.flashkit.com/board/showthread.php?p=3685435#post3685435)

tonypa
08-08-2006, 06:59 AM
Moved to new AS3 forum.

I have sent comment at the page
http://livedocs.macromedia.com/labs/as3preview/docs/00000021.html
describing all the bugs involving the tutorial.

Not sure when it will apear there.

tonypa
08-08-2006, 03:55 PM
Ah, my comment has been approved into MM livedocs to page about writing code to greeter.as file. The comment describes 3 steps to fix the helloworld tutorial so it works with F9.

cancerinform
08-08-2006, 04:22 PM
Page does not exist :D
They don't like critique.

tonypa
08-09-2006, 03:43 AM
Page does not exist :D
They don't like critique.

This page?
http://livedocs.macromedia.com/labs/as3preview/docs/00000021.html

Works for me. Can you access other parts of AS3 docs?

Pugger
08-09-2006, 04:58 AM
That is a shocking tutorial. wow

cancerinform
08-09-2006, 08:28 AM
It is weird. When I pressed the link you first showed I got an error. Now when I press it again it is ok. Anyways, here is a very basic tutorial:

http://flashas3.flashscript.biz/AS3_tutorial/Introduction.html

walnoot
08-09-2006, 03:17 PM
It is weird. When I pressed the link you first showed I got an error. Now when I press it again it is ok. Anyways, here is a very basic tutorial:

http://flashas3.flashscript.biz/AS3_tutorial/Introduction.html

Very nice! That's yours? Thank you!