1
00:00:01,780 --> 00:00:07,810
OK, so we've got our ad function, but now we need to change each of these to their own function,

2
00:00:07,820 --> 00:00:13,690
so subtract will be subtract, multiply will be multiply.

3
00:00:15,590 --> 00:00:16,820
And lower case.

4
00:00:19,040 --> 00:00:21,110
And divide will be divide.

5
00:00:22,230 --> 00:00:30,420
Now, we could just come up here and let's copy this, and we want one for subtract, multiply and divide,

6
00:00:30,420 --> 00:00:33,960
and so let's just come through here and change this to subtract.

7
00:00:35,190 --> 00:00:38,550
And this will be subtraction function.

8
00:00:39,240 --> 00:00:50,420
This will be multiply, multiply and spell that right and see, let's call this our multiplication function

9
00:00:51,150 --> 00:00:58,860
and here will be divide and this will be our division function.

10
00:00:59,200 --> 00:01:02,190
OK, so we've got our functions created.

11
00:01:02,200 --> 00:01:03,900
Now let's create some frames.

12
00:01:04,380 --> 00:01:08,760
Let's create math frames.

13
00:01:09,510 --> 00:01:16,650
So the first one will be an add frame and that's going to equal a frame and it's going to be in root.

14
00:01:17,130 --> 00:01:23,790
And we want the width to be four hundred and the height to be four hundred as well.

15
00:01:24,010 --> 00:01:25,650
And let's just call this background.

16
00:01:25,650 --> 00:01:27,450
Color equals blue.

17
00:01:28,080 --> 00:01:29,220
We're not going to keep it like this.

18
00:01:29,220 --> 00:01:34,890
We just need something to show, you know, a differentiation between all the different frames, the

19
00:01:34,890 --> 00:01:36,840
abstract multiplying divide frame.

20
00:01:36,960 --> 00:01:39,360
And we'll change it just as soon as we know this works.

21
00:01:39,600 --> 00:01:42,200
So, OK, we need for these.

22
00:01:42,210 --> 00:01:50,610
So instead of an add frame, let's call the subtract frame and let's call this multiply frame.

23
00:01:50,610 --> 00:01:53,340
And this one will be, of course, divide.

24
00:01:54,640 --> 00:02:02,290
And let's change these colors to red, I don't know, yellow and how about green?

25
00:02:07,820 --> 00:02:08,570
Yeah, that looks good.

26
00:02:08,600 --> 00:02:17,720
So now in each of these functions, let's pack in our frame, so let's call the ad frame and pack and

27
00:02:17,720 --> 00:02:19,150
then what are we going to do with this?

28
00:02:19,160 --> 00:02:27,320
We want to fill both horizontally and vertically to the whole 400 by 400.

29
00:02:27,470 --> 00:02:31,550
And we want to expand it to equal one as long as it's over zero.

30
00:02:31,670 --> 00:02:32,840
It will expand.

31
00:02:32,840 --> 00:02:34,580
And that's pretty much all we need.

32
00:02:34,610 --> 00:02:39,620
So let's copy this and paste it here and start to add frame.

33
00:02:39,620 --> 00:02:41,300
This is the subtract.

34
00:02:42,490 --> 00:02:49,630
Frame and here is the multiply frame, boom, boom, boom, multiply.

35
00:02:50,500 --> 00:02:54,710
And here is the what we call this one divide frame.

36
00:02:55,210 --> 00:03:05,470
OK, so also we need a hyd frame function because whenever we click on one of these, we want if we've

37
00:03:05,470 --> 00:03:07,200
already clicked on another one of them.

38
00:03:07,210 --> 00:03:11,830
So if we have the add one open and then we click on subtract, we need to hide that, add one before

39
00:03:11,830 --> 00:03:15,150
we can show the subtract one so we can we can do that.

40
00:03:15,160 --> 00:03:22,730
So let's call this I don't know what hyd menu frames or something like that.

41
00:03:23,830 --> 00:03:30,850
And then here we can just call each of these things and then we have one.

42
00:03:32,370 --> 00:03:36,070
Two, three, four year period for each one.

43
00:03:36,630 --> 00:03:45,150
So we packed these onto the screen here and each function, so we need to hack, underscore, forget,

44
00:03:45,610 --> 00:03:47,700
remember we looked at grid, forget.

45
00:03:48,860 --> 00:03:53,160
Way back when we looked at hiding things, but Pack Forget works as well.

46
00:03:53,420 --> 00:03:56,420
Same thing, just we use it for pack, OK?

47
00:03:56,420 --> 00:04:02,900
And now we just need to call this function at the top of each of our math functions here.

48
00:04:02,900 --> 00:04:06,080
So subtract, multiply and divide.

49
00:04:06,110 --> 00:04:07,460
OK, so let's save this and run.

50
00:04:07,460 --> 00:04:11,120
It almost certainly made some typos or something.

51
00:04:11,130 --> 00:04:12,680
So let's see what I did wrong here.

52
00:04:12,680 --> 00:04:16,310
Add works, subtract it, look at that up.

53
00:04:16,310 --> 00:04:17,870
Multiply and divide.

54
00:04:17,870 --> 00:04:18,470
Don't work.

55
00:04:18,480 --> 00:04:19,570
So what's going on here.

56
00:04:19,580 --> 00:04:20,000
Let's.

57
00:04:21,310 --> 00:04:23,440
See what we did here, did we get an error?

58
00:04:24,100 --> 00:04:24,940
No, we did not.

59
00:04:25,360 --> 00:04:25,650
Uh.

60
00:04:26,530 --> 00:04:29,950
So I forgot to change each of these, to subtract.

61
00:04:32,680 --> 00:04:34,030
Multiply.

62
00:04:35,470 --> 00:04:39,730
I misspoke, that mole to fly.

63
00:04:39,760 --> 00:04:40,230
There we go.

64
00:04:41,550 --> 00:04:43,290
It's Monday morning divide.

65
00:04:43,540 --> 00:04:47,370
OK, so now that should work, give this a run and see.

66
00:04:48,760 --> 00:04:49,750
Fingers crossed.

67
00:04:52,030 --> 00:04:57,820
All right, so add, subtract, multiply, divide.

68
00:05:02,240 --> 00:05:07,340
So we are coming right along, so obviously we are going to want to get rid of these colors, we don't

69
00:05:07,340 --> 00:05:12,740
want it to be yellow any time, you know, we click the divide one or whatever color that is multiply,

70
00:05:12,740 --> 00:05:13,190
I guess.

71
00:05:14,380 --> 00:05:19,360
We're just using these colors to make sure this functionality works at this point, and we can pretty

72
00:05:19,360 --> 00:05:20,560
much get rid of that now.

73
00:05:20,830 --> 00:05:22,470
In fact, we'll do that in just a second.

74
00:05:23,200 --> 00:05:25,890
So, OK, I think we're pretty much ready to go here.

75
00:05:26,170 --> 00:05:32,500
We can now start to work on the functionality of each of these, actually create the math flashcard

76
00:05:32,920 --> 00:05:33,940
functionality.

77
00:05:34,150 --> 00:05:35,830
And we'll look at that in the next video.
