Actionscript 3: Errors
- Started
- Last post
- 15 Responses
- CyBrain
I'm not even close to asking what's wrong with my movie.
When I get this kind of error:
http://pastebin.com/f1a463ae5Is there an order of punches Flash is hitting me with? (in AS3 language: event flow)?
or is it just random spazzing?
I'd like to know which function out of the four listed to check first. I'm having a hard time getting my head around this one.
- jpea0
it's because you're trying to get the property of an object that either isn't there or doesn't have that property. If you want to still call that function though with or without that object or properties present without your whole thing crapping out, do this:
try {
myFunction();
catch (e:Error){
trace(e.message)
}
- acrossthesea0
I believe this is where the error occured:
at FeatureMC/load300x250image()Function at the top of that stack should be the one w/ issues. That error is basically saying something doesn't exist yet and you are trying to reference it.
- NONEIS0
Make sure you go into the publish settings and turn on debug, it's a check box on page 1 "permit debugging", this will give you the specific line number in the output window where the problem is taking place, it's a hell of a lot easier to track down twhat the problem is that way than just knowing what function caused the issue...
- Pupsipu0
something like var blah:MovieClip = new MovieClip() is missing. Or a blah.magicProperty is empty, has no new MovieClip(). And probably because you're trying to access those before everything is set up.
- NONEIS0
^^^ Also be sure to turn this OFF when you do your final publish, or anyone with the dev version of flash will see an error window if things go awry in the browser.
- CyBrain0
I got some interesting results from the line numbers output. It's going to be a while before I track down the killer though.
- akoni0
depends how you are loading your MC, are you creating the object before you click the FeatureBtn?
do an onAddedToStage event that builds first to make sure all of your properties, objects, etc. are available.
- I have that in place, but things have gotten too complex. I'm going to have to revert to an earlier version.CyBrain
- monNom0
When in doubt, google the error code (ie: "actionscript Error #1009") That should find you some better explanation about the likely cause of the error.
but as others have said, the script is running to soon and that object doesn't exist yet. Try hooking it up to an event listener which fires when the 'loaded' (or whatever) event is broadcast.
- I get that one most of the time. It's bascially Flash's version of duh?....CyBrain
- PonyBoy0
what acrossthesea said... FeatureMC/load300x250image() is trying fire but is referring to something that doesn't exit (therefor is 'null')...
... check the variables you're trying to call in that function - maybe everything looks alright and probably is as far as what you're trying to do... you may have just mislabeled the MC or variable you're calling... (I do this all the time)
- acrossthesea0
Post your code and we can help :)
- CyBrain0
It's gotten pretty ugly.
Document class: http://pastebin.com/f7c407fa9
FeatureMC: http://pastebin.com/m453f24a1
FeatureBtn: http://pastebin.com/f44309fd7Is there an equivalent to duplicateMovieClip that I could use to bypass the seemingly nonexistant new feature FeatureMC objects that I can clearly see on screen? <Trying not to be angry with AS3 again...>
Here is the site as is.
talesfromthehead.com/random/brok...The problem happens when you click on any of the thumbnails, and then click on the next button. The feature flies off like it should, but the next one is AWOL.
- Trying that link again:
http://talesfromtheh…CyBrain - Ok, I'm taking a look...acrossthesea
- Trying that link again:
- NONEIS0
So dude,
These lines were the problem, there are no references to these textfields in your code,
date_txt.text = featuresXML.FEATURE[(featuresXML... - pNo)].@DATE;
projectType_txt.text = featuresXML.FEATURE[(featuresXML... - pNo)].@PROJECTTYPE;
client_txt.text = featuresXML.FEATURE[(featuresXML... - pNo)].@CLIENT;
description_txt.text = featuresXML.FEATURE[(featuresXML... - pNo)].@DESCRIPTION;Essentially your path to those fields are wrong, you should probably store them as class level vars upfront, I can show you how if you need...
- CyBrain0
Thanks NONEIS, but I tried using public vars in the class level of FeatureMC.as, but ended up with the same results.
http://pastebin.com/f37704055You can open any feature from the thumbnails, but if you click Next Project, the old one goes away as intended, but the new one can't be created. I just can't get a new instance of FeatureMC on the stage.
- NONEIS0
I would start by running a trace on "date_txt" in your constructor, if it returns undefined or null, then it's not where you think it is in the hierarchy of your site. Like I said, send me a fla and I can nail it down for you, or, keep at it, this is most certainly the issue.
- err, rather trace it out in your createChildren function...NONEIS
- CyBrain0
I have been able to trace it correctly.
I'm working on a very simple prototype that simulates this and it's still way beyond my comprehension. I'll post that soon.