Revisiting Inheritance
Taking a breather before we actually add some actions to our code let take a peak at the Inheritance chart and process what we are about to do.
Video Transcript
00:00Okay, so we added an event to our button move.
00:05Now let's actually have it do something.
00:07And for it to do something, let's do what the name implies.
00:12Let's just move it randomly on the stage.
00:15To do that, I'm going to use a few things
00:17that we may, I don't think we've met yet.
00:20But if we did, it will be a little bit of rehearsal.
00:22We're gonna approach our button move.
00:25And just as we moved around our,
00:27just as we moved around our text field,
00:29we could move around our button move one
00:31because in the inheritance chain,
00:34they both inherit from the display object.
00:37Thus, things that we could do for the text field,
00:39we could also do for the simple button
00:41as long as they are related to the display object
00:44or related to the interactive object.
00:47So all these events that we're working on right now,
00:49they belong to the interactive object,
00:51which means we could have done the exact same thing
00:53to our text field as well.
00:54We're not doing anything specific to the button right now.
00:58All right, so back to our code.
01:01And in our code, we wanna just put our X
01:04to be a random position between zero
01:06and the width of our stage.
