PDA

View Full Version : Complete Newbie!


knjduarte
11-19-2008, 07:30 PM
I'm taking college courses this semester to learn Flash and am just completely not understanding ActionScripting at all. My current assignment will probably sound incredibly elementary to everyone, but to me it has been a roadblock for the past 2 months! Here's what I need to do:

"Create a Flash movie that displays the current date in a text field. The date will be the numerical value of the day. For example 1 – 31. You should use the String() method to convert the date value from a number to a string before putting the value in the text field. (This is left out of the book)."

The best I could come up with was:
"var myDate:Date= new Date();
myTextField_txt.text = myDate.getDate();"

which not only didn't do anything, but doesn't have any string methods X_X I don't understand what I'm suppose to be doing here. I don't just want the answer, I actually want to understand the answer. lol. The second part is just as confusing to me:

"Add ActionScript to the file “changeCircle.fla” found in the Supporting Material menu on the class web site. Your ActionScript should use two lines of code to move the circle movie clip to the following coordinates: x=500, y=200. Hint, use the x and y properties of the circle movie clip." I can't get the FLA file to upload, but basically it's just a big blue circle in the wrong darn spot.

The only thing I could think of was:
"circle.x=500
circle.y=200"
But this did nothing. I just don't understand and feel incredibly stupid! Thank you to anyone who can help me!!

Brucebannor
11-19-2008, 08:56 PM
Date inherits the .toString Method as many do.. the code is close just check your instance names, which is probably your problem for the circle as well.


var myDate:Date = new Date();

nameOfTextField.text = myDate.getDate().toString(); // Gives you # of day of month


As for your 2nd problem you have the correct code. In your flash file check your instance name its probably not "circle".

knjduarte
11-20-2008, 12:43 AM
Oh my goodness! THANK YOU SO MUCH!!! I finally got it. I can't believe that was the only part I was missing X_X. And on the circle one.... I had the code right all along. I just needed to test the movie. I feel like such a noob. sigh. Thanks again!!!! ^_^