Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




If() Results (most Confusing Thing I've Seen To Date)



Ok, this has me flat out stumped, it's completely illogical

I built this 2.0 class that builds a calendar on stage by pulling elements from the library. It works fine except for one thing. Every time I have it start a new row of weekdays, I have it attach a graphic of a grey bar that is the width of the calendar to act as a background for that week, which also works.

If todays date falls in that week, I want that bar graphic to gotoAndStop(2).

I know my if statement resolves correctly because I get the trace() I'm looking for but the graphics do not change.


Code:
//if current dayFrame is a date this month, assign its date number
if ((i>=currentFirst-1) && (calDayCounter<daysInMonth[builderDate.getMonth()])) {
if(daysInMonth[builderDate.getMonth()]!=calDayCounter+1){
var cb:MovieClip = this.header.attachMovie('calBar','calbar'+rowCount,rowCount);
cb._y = rowCount+41;
}
cT.dom.text = ++calDayCounter;
//if the day is todays date
if((calDayCounter == this.dayValue)&&(this.builderDate.getMonth()==this.currentDate.getMonth())&&(this.builderDate.getFullYear()==this.currentDate.getFullYear())){
cb.gotoAndStop(2);
trace(cb._currentframe);//this traces correctly, but cb does not reflect the change on stage.
cT.gotoAndStop(3);
}
//build an 8 digit full date for each dayFrame
cT.instDay = concatFullDate(calDayCounter, monthValue+1, yearValue);
//check for event on this date
checkForEvent(cT, cT.instDay);
}


How can something trace() correctly, but not update the graphics?



FlashKit > Flash Help > Flash ActionScript
Posted on: 03-14-2006, 06:29 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Confusing 'for' Loop Results
Hey guys,

I'm a graphic designer who's just dived headfirst into Flash, it's only been a week and a bit, so no doubt this is very obvious, and probably a case of trying to run before I can walk!

I'm trying to import XML data into an MC to populate a menu... Kinda like the Portfolio XML sample tutorial on this site, but with a menu of different companies to choose from before their respective thumbnails appear.

So... I've been determined to do this myself, but I have admitted defeat on the following. Here's my AS:


Code:
var description_lv = new LoadVars();
description_lv.onData = function(raw_text){
descriptionText.text = raw_text;
}

var xPos = 0;
var yPos = 0;


function CreatePortMenu(port_xml){
var portClients = port_xml.firstChild.childNodes;

for ( var p = 0; p < portClients.length; p++ )
{
var currentClient = portClients[p];

var xSpacing:Number = 90;
var ySpacing:Number = 35;

var portHold = portHolder_mc.attachMovie( "jobOption", "pb"+p, p, {_x:xPos, _y:yPos});

portHold.jobTitle.jobText.text = currentClient.attributes.title;

switch (p) {
case 0:
case 1:
case 2:
case 3:
yPos = ySpacing * p;
break;
case 4:
case 5:
case 6:
case 7:
xPos = xSpacing * 2;
yPos = ySpacing * (p - 4);
break;
case 8:
case 9:
case 10:
case 11:
xPos = xSpacing * 3;
yPos = ySpacing * (p - 8);
}

}

}


var port_xml = new XML();
port_xml.ignoreWhite = true;
port_xml.onLoad = function(success) {
if (success)
CreatePortMenu(this);
else trace("Error loading XML...");
}



//load the XML
port_xml.load("portfolio1.xml");
The main problem is that, altho the "pb" instances are all given the right number (ie, I currently have 6 clients listed in the XML, so I get "pb0" through to "pb5"), the positioning values (xPos, yPos) seem to be being multiplied by ("p" minus 1), eg - "pb1" has the xPos and yPos you'd expect of "pb0", and likewise "pb4" that of what "pb3" should be.

So, how come, if the right value of "p" is being assigned to the mc's, that it's not being used in the rest of the loop?

BTW - The 'switch' part is designed to list them in columns of 4 (there will never be more than 12), which seems a bit unwieldy, but I couldn't think of a more elegant solution as yet.

Thanks for your help,

Olly

Scaling Movie Clip Of Single Line Returns Confusing Results
Consider this simple code:

__vp_mc = attachMovie("vp_mc", "vp_mc",getNextHighestDepth());
__vp_mc._width = 100;
__vp_mc._height= 100;
__vp_mc._x = 50;
__vp_mc._y = 50;

Where vp_mc is a 1.0w x 1.0h square movie clip with single pixel line border, line scaling set to "none" with ref point in center.

I would expect the movieclip to nestle into the upperleft corner of the stage.

However, as the attachment shows, it is offset from the corner by about 25 pixels in both x and y.

The apparent reason is that the movieclip boundary is based on the line's scaled size, not its unscaled size. This result happens whether I use scale9grid or not (in fact the scaled boundary appears in the authoring environment when scale9grid is enabled).

See the attachment for details.

Why is this happening, and what can I do to create a hit test region that easily scales?

Your help would be much appreciated.

Date Results In Goto Frame
Is it possible to detect the month from system clock and then jump to a frame .

I am creating a calander however it defaults to january and I want to be able to go streight to the relevant month without having to use buttons

PHP Date Back To MySql (funny Results)
I have a record Insert Page, php date field
When I save and retrive the date it is not as I entered .

What do I need to do to send a date/time back to MySql in a valid format ?
Or a tutorial which can send me on the right path please!.

I have found the "display" formatting Date and ststotime, but could not find a send to MySql format example, if I input 07/07/2004 in the text box bound to field "date_submitted" , I get a strange date returned.

I could not find a "search" for in this forum.
I know this is a flash forum and I am working this part in dreamweaver!
But it is worth a try!

Thanks in advance

Need To Send ASP Results To Flash, Preferably Into Xml Results Packet?
I am creating a flash page that will pull images from a folder without specifying each image name. I have the script I need in ASP to get the image names from the folder but now I need to see this in flash. I have used the xml connector quite a bit and would be happy to just get the information back as an XML results packet. Of course if there is an easier way to do this I am open to suggestions.

Any help would be greatly appreciated.

Thanks,
Dave

Making A Thing Any Of Which Will Interact With Any Of Another Type Of Thing
Well i know that title was a bit vague but heres what im trying to do, ive been larning to use flash for the past couple weeks, I'm using flash MX, i am expeirienced in other programming languages. What id like to do is to make an object, in this case a turet, which has code in it and can be duplicated, i know how to do that part, but, i want to be able to make it and copy it, and also have an enemy i can copy, a zobie, and have any of the turrets shoot at any of the zombies that get close. They cant all be pre scripted with eachothers names because i want to be able to create either after the program starts.

Basically, the zombies come out all over during the program and the player clicks where he wants to put turrets and those turrets shoot at whichever zombie is closest to them. Im sure its not that hard, and probably would involve arrays, but since im still learning how flash works im not sure how it can be done. Any help is apriciated, thanks. While i wait for a reply I'm going to read some more on how arays work in flash since i think they may be the answer.

Thing Thing Arena Type Game.
I want to make a shooting game, but I had a question first. How can I make the hand follow the cursor constantly, but never leave a restricted area? I would like to know how, thanks.

Display Future Date (seven Days From Today's Current Date)
I understand how to display today's current date, but how would I display the date seven days from now? For example, if today's date is 4/29/2003, I want to display 5/5/2003.

Anyone done this before?

Thanks in advance.

Scott

Convert RSS2 Date Format To Flash Date() Object
How can I take an RFC 822 (RSS 2) formatted string, and read it into a Flash MX Date() object. Flash does'nt like the format.

I have a function that will break the string apart the long way but is there an easier way to accomplish this - I can't believe flash would'nt have it built in like .NET or ColdFusion.

Thanks!

Aaron

Date Specific Content/dynamic Text/Get Date
Hello,
I am trying to build a page where there is Date specific content, i.e. after a certain date the information becomes obsolete and will need to be replaced with new information.
Does anyone have any idea how I can go about doing this?
Thanks,
Kris

Comapreing A Datefield Selected Date To Current Date
i have a made a small swf which checks the seleted date on the datefield component is passed current date or not...

i have a function get the day associated with it...

stop();
function getDayName(num) {
switch (num) {
case 0 :
return "Sunday";
break;
case 1 :
return "Monday";
break;
case 2 :
return "Tuesday";
break;
case 3 :
return "Wednesday";
break;
case 4 :
return "Thursday";
break;
case 5 :
return "Friday";
break;
case 6 :
return "Saturday";
break;
}
}
today = new Date();
today = getDayName(today.getDay())+" "+today.getMonth()+" "+today.getDate()+" 00:00:00 GMT+06000 "+today.getFullYear();

on relese event of the button...

dateField is named - arr_date

on (release) {

_global.selday = _root.arr_date.selectedDate;


_global.selday2 = getDayName(_global.selday.getDay())+" "+_global.selday.getMonth()+" "+_global.selday.getDate()+" 00:00:00 GMT+06000 "+_global.selday.getFullYear();

res = (selday2<today);
_root.dis = res;
}

the thing is sometimes res says "TRUE" for future dates also.

download fla here
can anyone help on this.

Thanks

Display Date And Day With Computing Three Days From The Date With Certain Restriction
Hi

i have a code that display date and day from your local machine.
Here it is:
================================================== ===========
function howlong(arg) {
if (length(arg) == 1) {
arg = "0"+arg;
return arg;
} else {
arg = arg;
return arg;
}
}
myDate = new Date();
//hr = howlong(String(myDate.getHours()));
//mnt = howlong(String(myDate.getMinutes()));
daytext = myDate.getDay();
//daytext = daytext+3;
dd = myDate.getDate();
//dd = dd+3;
mm = myDate.getMonth();
//yyyy = myDate.getFullYear();
switch (daytext) {
case 0 :
daytext = "Sunday";
break;
case 1 :
daytext = "Monday";
break;
case 2 :
daytext = "Tuesday";
break;
case 3 :
daytext = "Wednesday";
break;
case 4 :
daytext = "Thursday";
break;
case 5 :
daytext = "Friday";
break;
case 6 :
daytext = "Saturday";
break;
}

switch (mm) {
case 0 :
mm = "Jan";
break;
case 1 :
mm = "Feb";
break;
case 2 :
mm = "Mar";
break;
case 3 :
mm = "Apr";
break;
case 4 :
mm = "May";
break;
case 5 :
mm = "Jun";
break;
case 6 :
mm = "Jul";
break;
case 7 :
mm = "Aug";
break;
case 8 :
mm = "Sep";
break;
case 9 :
mm = "Oct";
break;
case 10 :
mm = "Nov";
break;
case 11 :
mm = "Dec";
break;
}

textdate = (daytext+", "+mm+". "+dd+".");
================================================== ===========

Now problem is it should compute three days from that date with certain restrictions like (dont count Saturday and Sunday, Dec 25th, Nov, 22nd, Jan 1st)...

I have to display the date based on the above rules..

plz help

Thanks
maxarindam

Converting A Date Serial Number To A Real Date
I'm reading dates from Excel and I get this type of serial number : 37477. It's actually the number of days since 1-1-1900. Is there a function to convert that directly into a date in Flash ?
Thanks,

DATE() Reads Date From Server Or User?
2 questions about DATE() function:

1º The value is taken from the date setted on the server or the user machine?

2º How do i break apart the value to check each value? I mean, day, month, etc.

Im working on a quiz that has to display a different question every 15 days. Im loading them from a TXT. I´m missing that part of the code.

Thanks for any help.

Flash MX: Date To String And Back To Date
Greetings,

Im struggling to (a date which is converted to a string to format date as mm/dd/yyyy hh:mm:ss") transform the string textDate into a Date?

Im looking at mxateFormatter but I dont understand how it works
Any advice and guidance would be appreciated.

Cheers
Rob W



Code:
displaydate = new Date();
var day = displaydate.getDate()>9 ? displaydate.getDate() : "0"+displaydate.getDate();
var month = displaydate.getMonth()+1;
var years = displaydate.getFullYear();

if (month <9)
{
var month = "0"+month;
}

displaydate = (month + "/" + day + "/" + years);

timedisplay = new Date();
var hours = timedisplay.getHours()>9 ? timedisplay.getHours() : "0"+timedisplay.getHours();
var minutes = timedisplay.getMinutes()>9 ? timedisplay.getMinutes() : "0"+timedisplay.getMinutes();
var seconds = timedisplay.getSeconds()>9 ? timedisplay.getSeconds() : "0"+timedisplay.getSeconds();
timedisplay = (hours + ":" + minutes + ":" + seconds);

_root.textDate = (displaydate + " " + timedisplay)

Bad Data From Date.getDay() And Date.getMonth()
I am trying to utilize the Date class to retrieve the current date, and populate fields for each date part. However, the day and month returned from either the day/month properties or the getDay()/getMonth() methods are incorrect: today is 4/11/2008, yet I get back a month of 3 and a day of 5!

Here is the relevant code:

var curDate:Date=new Date();
NewProjectStartMonthField.text=String(curDate.getMonth());
NewProjectStartDayField.text=String(curDate.getDay());
NewProjectStartYearField.text=String(curDate.fullYear);

Figuring Out A Previous Date With Date Class
I have a need to allow people to choose a date range in my application. I can't figure out how to format a dat that is say 30 days prior to today.


For instance:

var Today_Date = new Date();
var Proior_Date = Toay_Date - newDate(30);

Comparing Current Date With Date String
Im loading in a date from a database and storing it in a string called dateToCheck. The dates I am loading in from my datebase could be anything so I want to check if its past, present or future but as its a string and not a date when I compare to the current date it doesn't seem to work.

Im storing the current date in actions script like this


var today_dateate = new Date();
var date_str:String = (today_date.getDate()+"/"+(today_date.getMonth()+1)+"/"+today_date.getFullYear());


Do I need to convert the value date value Im loading from my database into a proper date before I can check it agains the current date? If so is there any easy way of doing it.

Thanks

Confusing
i just got flash mx i have never had any other version of it and i cant do a damn thing on it tutorials i went through... maybe i should just go through them till i understand... go here http://www.seeminglyawake.net/kyle/td.html how do i even start to make something like that...

Really Confusing
Hi. I've attached a .fla, in MX version, and the problem I'm having with this is a really simple one, I'm sure. As it is at the moment, after clicking on the green button a menu appears. If you click on the Portfolio button, another menu appears below, from behind a sliding mask. All well and good. However, if I try to add the same function for another button (the code is in frame 3 of the main timeline, in the actions layer,) nothing happens.

If I close the function and create a second one, then neither button works, but if I put in a second IF function within the main function, then the Portfolio button works fine, but the other button won't.

I've returned the code to before I tried to add a second function. If anyone could examine what I've done and tell me how to change it I would really appreciate it. I know this is a simple problem ad it should be really obvious, but I just can't see how to do it. I am newbie to this level of actionscripting and I am just getting a bit confused with how things are working.

Many thanks.

Confusing, But Please Help...
hi,

I have a problem that I am sure there is a simple solution for, but I can't seem to get it to work. Here is my problem in point forms to make it a little easier to understand what is happening:

1) I have movie clip on my main scene called "original" that is a map.

2) The map is quite small and detailed so I added a magnifier that works by masking a copy of the map at 200% of its normal size.

3) The large map and the small map are the same symbol ("Magnified objects"), but the small map ("original" - instance name) is put directly on the main stage and the large map ("largeobjects" - instance name) is inside the "lens" clip.

4) The map itself is a movie clip that will include the map content depending
on what the user wants to see, the first frame of the map clip is the map itself, each frame in that clip will
contain the content.

5) For this to happen the small map instance ("original") and the large map
instance ("largeobject") need to advance to the correct frame at the same
time. Controlling the small map instance isn't a problem really, I can put a onClipEvent action on the object itself when it enters the frame, its the
large map instance that is giving me problems as it is buried in the "lens"
clip.

hope that isn't too confusing.

Thanks,

pjustice

It's All Too Confusing
Hey, is anyone else out there apsolutely gob-smacked with the amount of plugins and add-ons for flash? Just take one look at www.flashkit.com , there are enough banners on there to make you drown in your own druel and give you a of a whopper headache at the same time. I guess I am trying to say; are all these cool looking plugins and add-ons really necessary? Are you missing out if you do not own them? Which are the better ones to look into? And how is one supposed to keep up with such things?

Confusing
Okay I am doing this site that uses backend pages off another site i.e.search engines for a area. Basically I have created a flash menu but because the sites cannot be changed I have seperated the menu from everything else on the page. I have applied a behaviour to the buttons saying:

on (release) {
//Goto Webpage Behavior
getURL("http://agentslive.net/aitc/contactus.asp ","_self");
//End Behavior
}

and this opens up an entirely new html page without the menu.
How can I have my flash menu at the top and then the information in a seperate frame...Is this even possible,...If you dont understand I can possibly help make it more understandable.

AS3 Confusing
I found that to use (what was orignally attachMovie) I had to create a linked mc in the library, then write a class for it.. which I've done.

The only problem, is that the linked mc that I have created, has to interact with a function on the main timeline. I've never created my own classes before and this is just confusing me all to h-e double hockey sticks...

How do I get a linked mc to do ANYTHING with functions on the main timeline?

Really Confusing ?
Hello ians !!

The problem is with this page....

http://www.2xceed.net/post_process.php?post_id=f2_1

Please visit this link. If u get topic does no exist error , try visiing the home page and www.2xceed.net and the recent posts category select "Read This First !!!" topic.

In this topic the third big post is giving a prob.

The options such as quote post , post reply is not visible..

I don know why this is hapenning ?/

Can anyone reply??

LoadVariables Confusing Me
I've been rackin my brain with this one. I'm no flash genius so i've just been working from the actionscript dictionary, online examples and previous coding experience.

I'm working on a text-data driven flash movie for a website, using loadVariables to load info from a .txt file [yes i give it the full url etc]. I'm using buttons to change the value of one variable that controls WHICH text file loadVariables accesses [e.g., paging back and forth through a series of text messages]. The strange thing is that the variable changes correctly, but the file it actually displays corresponds to the PREVIOUS value.

i.e., you're on entry 6, click "previous", the variable changes to 5, but it still displays file 6. click "previous" again, the variable changes to 4, but it displays file 5. click "latest", the variable changes to, say, 8, but it displays file 4. so it's trailing behind.

I don't actually know if it's my loadVariables scripts that are bad, or something else. the way i have it set up is this:

movie loads, determines number of files there are, sets "entryNumber" to that value. it is then sent through frame actions that tell it to load the variables in the corresponding file, then another frame that actually writes those values to dynamic text boxes. the buttons then modify the value of "entryNumber" and send it back to the frame that tells it to load the corresponding file, then come back and write the values to the text boxes.

Anyone willing to help me figure this out?

thanks in advance
Vood

Simple But Confusing...please Help
I'm trying to create a website where basically you hit a button, and animated doors close over the present screen(which is a movie clip), and when the doors open again there is a new movie clip underneath...there is a series of these. I just can't seem to get the movie clip on the bottom to stay present when the doors shut to reveal the next. Please help.

Please Help Me Out Here... It Is Simple, Yet Confusing To Me.
Ok, it doesn't seem that hard - yet I am having alot of problems with it.


In a frame, there is a mess of codes, this code will give out 2 numbers and divide them by each other and then post them into a text field.

For example. Something happens, then it will take 8 and divide it by 3.

Ofcourse this number is going to be a nasty decimal number:

2.6666666666666666666666666666667

Then, the script will put it into a dynamic text feild. The problem is, I don't want the user to see that mess. I just want him/her to see the first 4 digits.

HELP PLEASE

Confusing...preloader
I am having a problem with my preloader. It is a preloader that oldnewbie taught me how to make. You see, I made my first movie with that preloader and it worked just fine, but on my second movie, the one that I am working on now, it doesnt seem to work. It screws up...

In the first movie, my preloader is on the first and second frames of the movie. I have four layers, loadText, loadBar, border, and actions. I have a movieclip called loadBar, and a dynamic text box called loadText...anyways...the code on the first frame is:

bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}

And the code on the second frame is:

this.gotoAndPlay(1);

The third frame is where the movie starts.

Now in my newest movie, my preloader doesnt appear at the first 2 frames, but later on in the movie after a little intro, frames 169, 170, to be exact. So the line in the first frame:

this.gotoAndPlay(3);
becomes this.gotoAndPlay(171);

And the line in the second frame:

this.gotoAndPlay(1);
becomes this.gotoAndPlay(169);

Frame 171 has the code stop(); and it has a Start button to stop the movie. The only problem is, once the preloader has loaded, insteaf of going to frame 171, it goes to some other part of the intro...

Im sure it would be easier to attach the file, but its too big...if u dont understand just tell me...

Thx

:: Very Confusing Issue ::
i have recently rebuilt my website Callumations. i have used a Tsunami list in one section of my site, which is used for loading a chosen animation.
upon testing my site, the list only wants to open a selected fwe of the animations. even though all of the scripts applied to each button only differ in the URL. this is very confusing so if some one could have a look at it possibly?

here is an example code that is applied to the 'run' button...

on (release) {
getURL("javascript:window.open('http://www.callumations.com/anims/run.swf','run','width=782,height=403,top=100,scree ny=100,left=100,screenx=100,toolbar=no,scrollbars= no, resizable=no,menubar=no,status=no,directories=no,l ocation=no'); void(0);");
}


you can see the list at www.callumations.com --> anims --> ....

if anyone could get back to me with a possible answer why only a few of them load i'd be most grateful.

P.S.. i noticed it was the single-word buttons that opened, if that is any help to anyone??

cheers cal

Confusing Parameters ...
I'm embedding my flash file into my HTML doc and for the <object> tag there are some parameters I'm unaware of.

<param name="_cx" value="">
<param name="_cy" value="">

Anyone familiar with these parameters and their function?

-B

Confusing Flash
i have decided to use flash in order to make a learning tool for children. for example to teach them maths english science... is this a good idea?? if so what features should i include? please help me with this.. thinking of doing it as a university project.... plzzzz thank u

Help Confusing With Geturl
Hi there.

this bit of actionscript causes my buttons to stop working. can someone tell me what's wrong with it? it's kinda urgent.

thanks for any help!!

on (release) {
getURL("c270327.1.html" class="menu");
}

steve

[MX04] Very Confusing
Hi,
I'm having a problem with a game that I am trying to make. I'll put the code on and explain what I'm trying to do.


Code:
onEnterFrame = function () {
if (beta == 0 && this.headup._currentframe == 1) {
this.headup.play();
}
};


when the frame that has this code appears, the frame that the playhead was just at tells "beta" to equal 0 and the currentframe of my "headup" movieclip is automatically 1 (with a stop() action in it), since this is the first frame that it is in the game. One of the things that confuses me so much is that when I put a trace function on it, it comes up with the message like it should, but when it's just left like the above code, it doesn't play. The same thing for when I put gotoAndPlay(2), nothing happens.
I do not want to put this.headup.play() without the "if" because inside the clip actions I put that it should only play when I press the UP key.
I've been at this problem for too long, for what seems to be something that should have an obvious answer. I even tried (just to test if it worked) moving the _y position of the "headup" clip, and it moved to the right spot.
I would really appreciate if someone could help me with this, sorry I took so long explaining...
Mavrisa

Please Help AddChild Is Confusing
Hey all,

I am newers to as3 but used as1/2 lots.

In as3 I have successfully attached movieclips to the screen doing somethign like this :


Code:
addChild(new Ball);
But that requires I've made my own Ball class. How do I attach an object from my library that doesn't have a class file (ie. ball.as).

For example, I have a banner I want at the top of my screen. There is no code required at all for the banner. I just want the image to appear on the screen. In the FLA, I went into the Linkage settings for the banner and gave it a class name of "Banner".

I then tried to do this :


Code:
addChild(Banner);
and it compained it didn't know what Banner was. I then added


Code:
public var FloatingGoldText:MovieClip = new MovieClip();
to the code. it didn't complain about any errors.... but nothing was displayed.

What am I missing?

Thanks so much for any help you can give!!

Ryan

I Just Don't Get AddChild. Why Is It So Confusing To Me :(
I'm goign crazy over here. I've been programming in flash for years... but something so simple has me lost.

I created a simplebutton in my library. In this button I added a dynamic text field. I gave it an instance name of "score". I gave the button a linkage class name of "UpgradeButton".

I created a "UpgradeButton.as" file and put the standard event handlers in it for dealing with onpress and such.

Then I tried to create a new instance of the button... I did :


Code:
var myUpgradeButton = new UpgradeButton();
var test:* = myInterface.addChild(myUpgradeButton);
Ok, now all I want to do is change the dynamic text field on this button. I've tried :


Code:
myUpgradeButton.score.text = "1000";
and


Code:
test.score.text = "1000";
and I've tried adding the code inside the UpgradeButton.as in the contructor such as :


Code:
this.score.text = "1000";
or


Code:
score.text = "1000";
no matter what i try it says :


Code:
ReferenceError: Error #1069: Property score not found on UpgradeButton and there is no default value.
Please help me. I obviously am not undertstanding the way as3 puts grpahic elements on the screen.

Thanks so much!

Ryan

[CS3] IF Statements Confusing Me, Please Help
Hi there, I'm new to ActionScript and I have read over all of the "Multiple If Stement" and some "Switch" threads on the board, but I am confused and somewhat overwhelmed by the options.

I have an RFID reader hooked up to Flash which reads RFID tags. I had it working for 1 tag but when I duplicated the code for the first tag and changed the ID # it all fell apart. In reading the other threads here on Multiple IF statements and investigating possibly using Switch instead...I broke it more and more and just got confused. I'm thinking this is not a difficult issue and I'm just not getting it. If someone could please help me I would be greatly appreciative.

I am trying to identify each unique tag and if reflect whether the tag has already been logged in. Thus the use of a counter. This seems like far too much code for such a simple task, I just need some assistance. Thank you for your time!

//**RFID LOGIN/LOGOUT**
if (data == 104852495365665569705113){
trace(counter);
if (counter == 0){
trace("Logged in");
loggedField.text = "In";
nameField.text = "Name 1";
imagebox._alpha = 100;
counter = 1;
}
if (data == 104852495365665465667013){
trace(counter);
if (counter == 0){
trace("Logged in");
loggedField.text = "In";
nameField.text = "Name 2";
imagebox._alpha = 100;
counter = 1;
}
if (data == 104852495365665553485713){
trace(counter);
if (counter == 0){
trace("Logged in");
loggedField.text = "In";
nameField.text = "Name 3";
imagebox._alpha = 100;
counter = 1;
}
else if (counter == 1){
trace("Logged out");
loggedField.text = "Out";
imagebox._alpha = 0;
counter = 0;
}
};

[F8] Confusing Problem Please Help
i'm making this gallery of items and it snaps to the start of the scenes when i click on a button.
i'll show you what i mean:

http://moize.shah.googlepages.com/Flasher.swf <-- heres the SWF file
(click on the left arrow and then try clicking on a picture. The button is set to a different scene but why does it snap to the start)

Heres the FLA version, see if you can identify the problem:
http://moize.shah.googlepages.com/Flasher.fla

I really need this finished today. I would appreciate it if some one could help me out.
Thanks

[CS3] Confusing Error. Please Help
I am using Fuse on a project and suddenly I am getting this error and I can not find the fault.

ActionScript 2.0 class scripts may only define class or interface constructs.

This Tutorial Is Too Confusing
I pretty much SUCK at action script and uh I dont get the 1st tutorial.
No laughing. Cause in the second one you didn't have to type string or anything.
Actually i dont get the third part of the first one

Vector: Confusing
Hi there!

This new Flash Player class makes me confused..

It says you can specify size in first parameter, like:

ActionScript Code:
var _items:Vector.<String> = new Vector.<String>( 2 );
// attempt to set up value of 4th item:
_items[3] = "bla"; // throws range-error: The index 3 is out of range 2
.. which is cool. I like low memory usage. But when you do something like:

ActionScript Code:
var _items:Vector.<String> = new Vector.<String>( 2 );
    _items.push( "some crap" );
    _items[3] = "bla"; // works well..

trace( _items ); // traces: null,null,some crap,bla
trace(_items.length); // 4

Is this really supposed to be working this way or am i just not getting something? :-) I mean should push really override the length of fixed-length Vector? Actually when i think of it, it probably should, but if i could choose, i would prefer it to be just a buffer. if push is called, just shift the last value [garbage bin :]

EDIT: aaa how could i be so hasty! the second parameter takes care of the error-reporting problem [lol]

ActionScript Code:
// cant push() now!
var _items:Vector.<String> = new Vector.<String>( 2, true ); // fixed == true
    _items.push( "some crap" ); // triggers ERROR: Cannot change the length of a fixed Vector
/and that buffer is another implementation completely, might give it a try/

Confusing Preloader Here
Can anyone tell me what does this SIMPLE PRELOADER means ???



// [Action in Frame 1]
FrameLoad = int(100 / _totalframes * _framesloded);
tellTarget("/loader")
{
gotoAndStop(/:FrameLoad)
} // end of tellTarget

ifFrameLoaded(137)
{
gotoAndPlay(3);
} // End of ifFrameLoad

// [Action in Frame 2]
gotoAndPlay(1);

.as Files Confusing
If you have a #include "c19.as" in a keyframe in your flash movie, does the .swf file look for the .as in the same folder as the .swf or does the .fla complie it into the .swf as actionscript?????

:: Very Confusing Issue ::
i have recently rebuilt my website Callumations. i have used a Tsunami list in one section of my site, which is used for loading a chosen animation.
upon testing my site, the list only wants to open a selected fwe of the animations. even though all of the scripts applied to each button only differ in the URL. this is very confusing so if some one could have a look at it possibly?

here is an example code that is applied to the 'run' button...

on (release) {
getURL("java script:window.open('http://www.callumations.com/anims/run. swf','run','width=782,height=403,top=100,screeny=1
00,left=100,screenx=100,toolbar=no,scrollbars=no, resizable=no,menubar=no,status=no,directories=no,l
ocation=no'); void(0);");
}


you can see the list at www.callumations.com --> anims --> ....

if anyone could get back to me with a possible answer why only a few of them load i'd be most grateful.

P.S.. i noticed it was the single-word buttons that opened, if that is any help to anyone??

cheers
cal

GetBounds() Really Confusing
Hey, I've tried looking through the flash help, through several books, tutorials, and posts but I still don't understand how I use getBounds. It's really frustrating. I need to use it to detect collision on all four sides of a wall and based upon where my movie clip (_root.char) hits it, and have it stop moving in that direction.

Please help explain this simply...thanks in advance.

SetInterval Confusing Mii Please
Goog day peps

am gona make this quik and simple

the situation is i have a main MC that runs at 40fps and i have imported another standalone MC that's when played on its own runs at 80fps twise the speed of the main MC and i have read and belive the SetInterval code was suppose to overide the framerate of the main MC which i have set to 40fps

So when i run/test my main MC with the 80fps MC also running inside the main MC everything runs at the same speed of the main MC which i set to 40fps and i Thought that SetInterval was a code that can make MCs inside a main MCs run faster than that of the main MC please i hope you understand

also sorry am a lite AS user but i know what i want too this is the code i was watching
fastFrames = function(){ myMovie_mc.nextFrame();
updateAfterEvent();
} speedyID = setInterval(fastFrames, 40); and i got it from here at kirupa the second line of example codes http://www.kirupa.com/developer/acti...tinterval2.htm

please help out i know theres a legend out there who understands

k,s inc

A Confusing Question :S
I know that it's possible to load text from an external file, but is it possible to take a part of a php file and load it onto a flash movie?

For instance, I took a part of a php file:

Code:
<tr>
<td height="17">Name:
<font color="#000066"> Hellogoodbye [<a href=index.php>View other members</a>] </font></font></td>
<td valign="top">Location: <font color="#000066"> Asia</font></td>
</tr>
and I'd like to show my name and location on my flash movie from that source so when that updates, it will also be updated in my flash movie. Can anyone help?

Flash Is Confusing...
Hi...
Ok, so this is what is required... I need to make a thing about Jaws in flash. Just some navigation here and there... A school assignment? yes it is... but i'm in serious need of help here... I just wanna throw something together... and i kinda know the components i need, but not sure how to put it all together...

http://www.requiemforadream.com/

this was the site they gave us for an example... i guess what i'm asking is... when i search for each bit... i.e buttons and navigation n stuff... what do you suggest?


Quote:




The interface must be based on elements from the movie we don’t want buttons.
The interface can be metaphor based but the metaphor must fit in with the elements of the movie.
Look at www.requiemforadream.com as an example.
All screens must be presented in the storyboards.

No individual section may be bigger than 100k




any help would greatly be appreciated...

what i would like, is when you hover over a button, a little thingy pops up as an explanaiton... and then when it's clicked on, the background does something crazy... like it wipes away like a magna-doodle or something... and yeah...

Thanks

Bo5ton

Help I Got Some Confusing AS Problems
Last edited by carrera : 2002-08-24 at 04:14.
























1. In AS, can we say that objects with prototypes are classes and others not?
2. Can class A's instance, say B, itself be a class?
3. Is every class in AS inherited from the Object class?
4.
Code:
trace(Object.__proto__ == Function.prototype);//true
trace(Object instanceof Function);//true
trace(Function.__proto__ == Object.prototype);//false
trace(Function instanceof Object);//true
What's up?

Now I got confused

Copyright © 2005-08 www.BigResource.com, All rights reserved