|
-
Senior Member
[F9/AS3] HelloWorld project
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 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
Code:
package
{
public class Greeter
{
public static function sayHello():String
{
var greeting:String = "Hello World!";
return greeting;
}
}
}
and a HelloWorld.fla
Code:
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:
Code:
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
-
Senior Member
Try this:
var myGreeter:Greeter = new Greeter();
mainText.text = myGreeter.sayHello();
-
Senior Member
Code:
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?
-
Senior Member
Remove static:
Code:
public function sayHello():String
{
var greeting:String = "Hello World!";
return greeting;
}
-
Senior Member
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?
Last edited by walnoot; 08-05-2006 at 03:44 PM.
-
Senior Member
 Originally Posted by walnoot
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.
-
Senior Member
Ok, so maybe we all can reply in the following topic?
we want an AS3-forum!
-
Senior Member
Moved to new AS3 forum.
I have sent comment at the page
http://livedocs.macromedia.com/labs/.../00000021.html
describing all the bugs involving the tutorial.
Not sure when it will apear there.
Last edited by tonypa; 08-08-2006 at 02:52 PM.
-
Senior Member
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.
-
Senior Member
Page does not exist 
They don't like critique.
- The right of the People to create Flash movies shall not be infringed. -
-
Senior Member
 Originally Posted by cancerinform
Page does not exist 
They don't like critique.
This page?
http://livedocs.macromedia.com/labs/.../00000021.html
Works for me. Can you access other parts of AS3 docs?
-
hmm
That is a shocking tutorial. wow
-
Senior Member
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_...roduction.html
- The right of the People to create Flash movies shall not be infringed. -
-
Senior Member
 Originally Posted by cancerinform
Very nice! That's yours? Thank you!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|