Simply put, when a frame is jumped to, it contains this code:
this.p_Image.children.image.src = "http://website.com/image.jpg";
My Movie Clip's instance name is "p_Image", it contains a placeholder bitmap within it and nothing else. It is a layout element which needs to display a specific image depending on which frame is currently displayed.
the console error I get is:
Cannot read property 'children' of undefined
What is not defined here? Shouldn't this be a very simple?
Any insight would be helpful, thanks!
When in doubt, always confirm your assumptions. Stick an alert(this.p_Image); in front of that code. Maybe an alert(this); too for good measure.
I don't know how helpful this alert is:
What is it supposed to do?
It's supposed to confirm that the object you're trying to access actually exists, of course.
This is confusing though, because your error message above clearly indicates that an attempt to access the "children" property of p_Image is failing because p_Image is undefined, yet apparently alert(this.p_Image) is not returning undefined.
It certainly does exist, so this should work, right?
But for some reason it doesn't.
This sums up the entirety of my experience with Animate CC nicely.
Does anyone know if there is a FLA file somewhere that shows this seemingly very common feature actually working?
I can't be the only one who would like to see that.
Have you ever been able to get this to work?
Okay, this is very important. When I asked you to insert alert(this.p_Image); preceding your image-setting code, did you place it immediately before it? There was nothing in between? Nothing that would change the value of this? Because what you're describing is exactly what would happen if someone messed up using an event handler to target an instance.
I'm stuck in the same place
My alert(mc); trow me there it is // [MovieClip (name=mc)]
but next to it the code
Trow me error :
this.stop(); alert(this.mc); this.mc.children.image.src="images/test.jpg";
Any help would be much apreciated