Events and Triggers
If I come up to the animation panel just here, okay? Any one of the objects I've just clicked on if we look at the panel I'm just gonna try and zoom in for you if I target this one here. Okay, hopefully the zooming works for you. This is where the event is actually fired from. It's on page load, that means when the page is ready, so it's almost like a performance on screen, okay? When the page starts loading into memory on a machine, this is true of all interactive media. And when the whole cast is assembled, or as much of the cast as the thing needs to run is assembled, then the performance begins. So that's what the page load sequence actually means. Okay, that everything is ready and assembled and so on it comes moving onto the stage. You've got several other things that you can trigger these by, and we can control triggers in a number of ways. What I'm going to do and I just need to zoom out again now, so if you're looking at this on your own machine, with the animation panel open,...
just get any object and apply an animation to it and look at this particular menu. Okay, so I'm just gonna use this polygon here at the bottom, and I'm gonna change the key event that actually starts this to on page click. Now, as you can probably imagine, that means that if I click on the page it will trigger that actual event. Okay, now here's the thing, there is one tiny little gotcha here I'm gonna zoom back in on that little panel. It doesn't override the on page load action because the assumption is I might actually need both. I might need it to run again. Something when it starts, and something at a later point. So you actually need to go back, and then just de-check on page load. You can actually see it shows you that there's two events there. All right, so I'm just gonna de-check that so now it's on page click. Let's get that back up in the EPUB interactivity preview here, okay? We have to play the layout by clicking the icon at the bottom. So what happens is the cube comes in, followed by the first polygon and you can see it just sits there now, waiting for something else to happen, like me clicking on the layout, there you go, and that plays and glides in. All right so that's how you can control that with a trigger. Let's add another element just for the fun of it. So I'm just gonna draw a text, I'm gonna draw one off to the side here just for a minute. Let's do a bit of vanity publishing. Let's do with Tony Harmer just there like so. Okay and I'm just gonna make that a bit bigger here so let me get to my character properties for this one. I'm actually overriding a style here, so let's dial that up a bit. I like clicking in here and using the arrow keys on my keyboard because then I can hold down shift and actually multiply that by ten which makes things a lot quicker, of course. That's way too big. I know it's vanity publishing (Tony laughs) but not quite that vain. There you go. So let's dial that back down. Let's go to about 64 point seems pretty good to me. I'm gonna hit enter to apply that. I'm also going to override the color here. I'm gonna go for paper, I'm kind of liking everything being slightly see-through, so I might just change the opacity of that in a minute when I've got it in place. So we'll bring that down. Let's change the width of that frame. Here, okay, and get that into place just there. That's good. Now I'm gonna change the opacity. I'm gonna go for the transparency field, just here, because this is quite a chunky resolution for small devices. I haven't quite got everything on the control strip at the top there. You might have it in a slightly different place so don't try and line up your eye there just have a look across for the transparency icon. Okay, so I'm gonna drop that down to 77% 'cause 1977 was a great year, that's the only reason for doing that. There you go and I'm just gonna nudge that into place over towards that margin just there. Okay, so with that selected, let's add an animation to that text. Come up to the animation here and I'm going to choose... Let's have fly in from the bottom just there, the InDesign butterfly again, clearing up any ambiguity about what that might actually mean. I think it means coming home so there you go. Perfect, right, so now we all understand each other. I'm gonna de-check on page load here, and I'm gonna give this a separate trigger. Now, this is something that we're gonna look into in another way a bit later on when we look at actually creating interactive buttons, but we can create element triggers by clicking on an actual element. So tiny bit of housekeeping first. What I'm gonna do is just pop across, we'll come back to the text in a moment, to the polygon behind. And I'm just gonna de-select that on page click here. I'm gonna turn that off, so there's no event now to trigger it. If you look at the panel I'm gonna change this to on page load, so this runs when the page load event is there, okay? Then I'm gonna come back to the text. So we're back to that just playing on its own. We'll come back to the text here and what we're gonna do this time, because there's no event triggering that here, is, can you see this tiny button over to the side here? Okay. This allows me to turn an element into a button trigger. So I click on that and then I get this target, or an element here, that I can just pull across and tick, there you go, and now I've turned that into a button, and the buttons and forms panel opens. Now, I'm just gonna call this poly target just there like so, okay, and the event that triggers it will be going into all of these things in just a minute, in a little bit more detail. I want you to see it working first. Okay, so we'll test that out. Let's just do the EPUB interactivity thing and play the layout. Okay, so that runs like so. Those things catch up just there. No name just yet because remember, I need to click the target, so I'm just gonna click here and there you go. That glides in like so. Again, this is all really simple, simple stuff. It's not very difficult at all. You should be able to get with this fairly easily. So here's the other thing about this particular target. I'm just gonna come away from this and click on the polygon here, and I'm gonna zoom in on that also just to show you there. You'll notice that the bounding box for this particular shape has changed. That's because the whole thing, including this area here, is a button because buttons have to be rectangular. It doesn't matter about the shape that's inside, they will be surrounded by a rectangle that turns them into an interactive element. I'm gonna demonstrate that to you by clearly clicking away from the polygon and clicking here on the letter N from online once it's in preview. So if I just run that layout again, okay? So there you are, it glides in those things just arrive like so. I'm over the letter N and, in fact, you can see that the cursor for this has changed. I've got like a pointy fist cursor there and if I click on that then that triggers, okay? And you can't override that. You can't change the shape of a button, that's just the thing page elements have to have rectangles around them if they're interactive. And that gives you some design considerations, as well when you're putting elements together. You can't put together like a bunch of circles that are all closely meshed together because you're going to get some of them where they overlap, and it'll be the one on top that actually triggers the event that you're looking for, if you see what I mean. So there's a whole bunch of things and they slightly van a little bit, you know? Whichever one of those is nearest to the viewer, if they click on that, that'll be the one that receives the event and the box for it might cut well into the other shape, as well. So I'll close the EPUB interactivity panel. Let's have another look at the buttons and forms panel. So that's just down here on this particular layout. You can hover over it, you can always call for it, as well, if you go to window menu, come to interactive and choose buttons and forms, then it will appear for you, if you're having trouble locating it. So if I zoom in just a shade here to make it easier for you to see, this is telling me things about the thing I currently have selected, okay? It's telling me that this is a button. It gives me its name, it's button 1, I thought I'd actually renamed that, but I'll just do that again. I might not have hit traget, I might not have actually hit apply for that to actually work. Now that's called PolyTarget here. Here's the event that triggers it, okay? Now, you've got a few different events here. You can ignore the two at the bottom because those are for interactive PDF, and to be honest, interactive PDF is creaking a bit now. It was 19 years ago, I think, that that actually first surfaced, although you can speak to some people and they think that they're at the top of the digital curve using interactive PDF, (laughs) They're not really. But it was a very different world, a desktop only world. Yeah, and of course now, we can stream content on different devices. We need something that's a bit more flexible than that. So you can ignore those two, those two events on focus. If you think about when you tap through a web form maybe and a field highlights, that's what an on focus event is. And an on blur event is when you leave it. But we're concerning ourselves with these. So on release or tap speaks for itself. On click is a very similar thing, but it's a specific event for a desktop, really. On roll over, again, is kind of a desktop-only event. You don't have roll overs on devices because you're not moving a cursor around. You're actually just tapping where your finger needs to. And on roll off is if you're over an interactive element and then you move the cursor away. So you may want to have those triggers for certain desktop things, but ideally, try to keep things to things that users can actually do. It then it tells me what it's gonna do underneath. So you can see, there's a bunch of different things here that I can add to this. It tells me it's gonna play an animation here in the actions thing. We'll be building other actions so you'll get to see all of these in more detail later on and what the options are for doing it. Okay, so the option here is to play it or do a few other things. And like I said a moment ago, when I actually dig into those in more detail, so this is sort of an overview part of the events and triggers. Then there is some appearance things here, as well if I just zoom out now because I need you to see the rest of the panel here, so how this actually looks. There are three states here. You can modify the state for all of those if you want to, if you want to include rollover events for desktop, and click events for desktop. And you can also hide an object until it is triggered, so that means it won't appear on the layout until what something else that triggers it. And again, we'll get into that later on. The PDF options at the bottom, I'm just actually gonna collapse those because we don't need those at all, and you can refer to my sermon on that just a moment or two ago about the suitability of purpose for interactive PDF.