
David Stiller
Contributor
David Stiller
Contributor
Activity
‎May 07, 2019
03:57 PM
You bet, frenom2398. It's kind of wild some of my waaaaaay old answers are still helping.
... View more
‎May 07, 2019
03:56 PM
1 Upvote
Glad to help! I was surprised the system alerted me to your reply after ten years, but it did. Glad to hear you're unstuck.
... View more
‎Sep 22, 2017
08:36 AM
Thanks for your attention, Nancy and Colin! I don't feel like my issue has been resolved in any genuine sense, but I understand that marking a question as answered helps move things along. I still feel that my chat transcripts might be helpful to someone involved in the area of Adobe support, so to any staffers ... please feel free to get in touch!
... View more
‎Sep 21, 2017
06:54 PM
Nancy, thanks again for helping out! I appreciate your effort ... and hey, with any luck, maybe the forum leader will indeed weigh in.
... View more
‎Sep 21, 2017
06:53 PM
Colin, good to hear from you! Gosh, we're told-timers. Good call on the visit to Archive.org; I hadn't considered that. You're right, the images are still there ... but the file isn't. Ah, well. Interestingly, the current version of the article points to a ZIP followed by a space and then "(6)", whereas the archived version points merely to the ZIP. No doubt, your surmisal is correct in regard to lack of urgent attention. For all I know, Grant may have already tried to have the link updated. In any case, I've been following CreateJS and am thankful it continues to get support. There are other frameworks too, like PixiJS, that seem promising—but clearly, nothing is as close-to-the-source as CreateJS is. Glad you hear from Rich from time to time. I often miss the old gang, but am pleased that most seem to have diversified and continue to keep the creative juices flowing, even if along different paths.
... View more
‎Sep 21, 2017
05:47 PM
Nancy, thanks for the reply. I appreciate your moving this question from the previous forum to this one. Certainly, it didn't feel right to add it there, but then ... I didn't know where else to put it. (To be honest, it doesn't really seem to fit in this forum either, as it pertains to a devnet article.) Where does one bring up issues with articles, nowadays? So that you know where I'm coming from, I've written Developer Center content myself and am an Apress and O'Reilly author for Adobe products. I realize Flash CS6 isn't the latest version of Animate—not by a long shot—but plenty of people still use it! I certainly do. It's the only choice for those who aren't interested in the subscription approach, other than open source alternatives such as OpenFlash. Given the existence of Toolkit for CreateJS, as referenced in Grant's article and still available for download, the article in question still has value. Part of my reason for bringing this to the forums is because both chat reps asked me to, and to help improve Adobe's support UX. To that end, I'm still in the dark. In summary: * I discovered an issue on Adobe's website, in a tutorial article that may still be of use to people (albeit a fringe niche) * I wanted to bring this to Adobe's attention * My only choice, as far as I could see, was to wade through Customer Care * Two reps pointed me to the forums, but weren't able to tell me which particular forum to use * I found a solution and would like to share it with an appropriate contact Your point is well taken in regard to Grant getting in touch with his own Adobe contact, but shouldn't it be easier for someone like me—just anyone, really; any diligent customer—to bring not only an issue, but also a solution, to Adobe's attention via whatever contact is relevant?
... View more
‎Sep 21, 2017
03:29 PM
I'm a long-time Adobe fan and developer/user. It's been several years since I've needed to contact support, but today I discovered an issue with a particular devnet article and wanted to bring it to Adobe's attention. (Of course, I also wanted to enjoy full use of the article!) I went straight to support.adobe.com and was immediately frustrated by the labyrinthine tree structure that connects someone like me with an Adobe rep. Look, I get it: most inquiries are about software, but in this case, none of the choices was relevant. I saw no catch-all avenue, but poked around anyway. By trial and error, I found that if I pretended to have an issue with my Flash CS6 serial number, the system would connect with me a live chat window. From there, I began explaining my issue to the help desk rep. In short, I was reading this article here ... Getting started with the Flash Professional Toolkit for CreateJS ... which contains a faulty hyperlink under the "Sample files" header. Specifically, the referenced platypusgame.zip isn't there; clicking the link leads to a 404 error. I was hoping the rep would be able to provide me this file, and if not, to open a ticket with someone who maintains devnet articles, so the link would be flagged for correction. The rep kept asking for my serial number. I understand why, but explained it wasn't necessary in this case, because this wasn't a product issue. Somehow, this seemed very confusing to the rep. Our chat went on for quite some time, somewhat repetitively. In the end, the rep was unable to help me, and apparently had his hands tied in regard to putting me in touch with someone on the devnet side. I told the rep I'd try contacting the article's author myself and would follow up if the author still had the file. Turns out, the author is none other than the awesome Grant Skinner, who immediately provided me a URL to the ZIP in question, which he said he'll leave on his server for a few weeks. So part of my issue was resolved: I had the sample files I wanted! The other part of my issue remained open, however: I wanted to help Adobe fix its broken article, for the benefit of anyone else who may show in interest in the same tutorial. Thus, I ventured into chat session #2, which was equally confusing, perhaps as much for the rep (a different person this time) as for myself. Both reps kept pointing me to the forums—even though I didn't see it likely anyone would have the file I needed, much less be able to update the article's link. For what it's worth, here I am! I have the missing ZIP archive, from Grant Skinner himself, and am happy to forward the URL he shared with me. I also have transcripts of both chat sessions, which might be helpful in improving support UX.
... View more
‎Apr 16, 2009
02:54 PM
1 Upvote
Gotcha. Yeah ... sometimes coding is just tedious. That said, you could break up your code in different ways, and sometimes that helps consolidate things a bit. Here are a couple quick examples. NOTE: Neither of these is especially useful in this particular case, but they might help you brainstorm different ways of approaching what you've done. The first thing that occurs to me, for example, is the repetition involved with all the _visible settings. In all cases, you're turning most of the movie clips off, except for one. It might be worth writing a quick function that turns them all off ... then override the exception. Again, in this case it doesn't really reduce the overall line count by much. I assume you're running this routine inside a Key.onKeyDown event handler. So the first think you could do is call your custom hideParts() function, then use your if() statements to turn the relevant clip back on: function hideParts(mc:MovieClip):Void { with (robot_mc) { skullplate_mc._visible = false; faceplate_mc._visible = false; leftface_mc._visible = false; rightface_mc._visible = false; } }; hideParts(); if (Key.isDown(Key.UP)) { robot_mc._y -= bit + speed; robot_mc.gotoAndStop("frame2"); robot_mc.skullplate_mc._visible = true; } if (Key.isDown(Key.DOWN)) { robot_mc._y += bit + speed; robot_mc.gotoAndStop("frame1"); robot_mc.faceplate_mc._visible = true; } if (Key.isDown(Key.LEFT)) { robot_mc._x -= bit + speed; robot_mc.gotoAndStop("frame4"); robot_mc.leftface_mc._visible = true; } if (Key.isDown(Key.RIGHT)) { robot_mc._x += bit + speed; robot_mc.gotoAndStop("frame3"); robot_mc.rightface_mc._visible = true; } I also notice repetition in the line that sends robot_mc's playhead to a certain frame. You could take advantage of your frame labeling (the fact that each uses a number) and wrap the rest of the repetition up in yet another function. For grins, I'm using a switch() statement as an alternative to if()s: if (Key.isDown(Key.UP)) { updateRobot(2); } if (Key.isDown(Key.DOWN)) { updateRobot(1); } if (Key.isDown(Key.LEFT)) { updateRobot(4); } if (Key.isDown(Key.RIGHT)) { updateRobot(3); } function updateRobot(num:Number):Void { hideParts(); switch(num) { case 1: robot_mc._y += bit + speed; robot_mc.faceplate_mc._visible = true; break; case 2: robot_mc._y -= bit + speed; robot_mc.skullplate_mc._visible = true; break; case 3: robot_mc._x += bit + speed; robot_mc.rightface_mc._visible = true; break; case 4: robot_mc._x -= bit + speed; robot_mc.leftface_mc._visible = true; break; } robot_mc.gotoAndStop("frame" + num); }; function hideParts(mc:MovieClip):Void { with (robot_mc) { skullplate_mc._visible = false; faceplate_mc._visible = false; leftface_mc._visible = false; rightface_mc._visible = false; } }; As before, this new function, updateRobo(), calls on hideParts() right off the bat. The last line inside updateRobot() contatenates the string "frame" with the relevant number to avoid repeating that gotoAndStop() line more often than necessary. If you had considerably more body parts than these four, one of these other approaches might help. It's really just the same approach you were taking, except instead of abbreviating individual expressions, you're looking for whole blocks of repeated code that be accounted for in a different way. The cool thing is, ActionScript is flexible enough to handle any of the above (or, probably, half a dozen other approaces), so use the one that makes the most sense to you. David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 16, 2009
01:13 PM
shintashi, If you want, you can show that paragraph of code. For all we now, it might be something that can be written more efficiently. David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 16, 2009
09:39 AM
fastpicker89, Ah, I see that. Yup, that'll do it. The extra steps I mentioned are necessary if you want to deal with event handling, such as turning the loaded content into a clickable button. Positioning alone of your holder clip doesn't need what I mentioned. David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 16, 2009
09:07 AM
shintashi, Your abbreviations are a common and potentially useful workflow, and you can certainly accomplish what you're after here -- if I understand your question correctly -- but it's important you realize that these aren't actually abbrevations; not in the common sense of the word. What you're doing is declaring a variable to hold a value. That value is either true or false, just like the longer expression that evaluates to the same thing. So, as you've already discovered, it can be convenient to refer to something shorter (quicker/easier to type), like yellow, than a full expression such as Key.KeyisDown(Key.RIGHT);. That's a bit different from what I think you're asking about here ... robot_mc.skullplate_mc._visible = false; $skull = String(robot_mc.skullplate_mc._visible = false); When I see that, it looks to me like you're hoping to encode a whole expression as a string. That's the part that confuses me (just not sure what you're aiming for) ... so I'm wondering if you could do something more along the lines of this: var skull = robot_mc.skullplate_mc; That way, you can simply refer to the "abbreviated" robot_mc.skullplate_mc reference in order to turn that inner movie clip's visibility on or off: skull._visible = true; skull._visible = false; Let me know if I'm way off base. David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 16, 2009
08:51 AM
fastpicker89, The trick is to wait until the SWF has fully loaded. At that point (and not before), you can reference the loaded SWF and treat it the same as any movie clip instance (that is, an instance of the MovieClip class) -- because SWFs actually are movie clips. The MovieClip.loadMovie() method, which is what you're using, is fine ... you can definitely use it, but it's a slightly older method, one that takes a bit more effort to test against. You might want to replace your loadMovie() approach with the MovieClipLoader class, which dispatches an event -- an event you can listen for and respond to -- when its content loads. Here's a brief article on all of the above: http://www.quip.net/blog/2006/flash/how-to-tell-when-external-swf-loaded So once your content is loaded, you reference it and set its MovieClip._x property to whatever value looks right. If you still have questions, don't hesitate to post again. David Stiller Contributor, How to Cheat in Adobe Flash CS4 http://tinyurl.com/dpsCheatFlashCS4 "Luck is the residue of good design."
... View more
‎Apr 13, 2009
07:48 AM
Dannydoolittle1, > You're saying that I need to make an instance of the movie clip > first for this to work correctly. Not sure how to do that, although > I'm sure it's fairly simple to make an instance of it. In order to "speak to" a specific object, ActionScript needs to be able to make a reference to that object. So, not only do you need an instance, but your instance needs to be referenceable. If you're creating objects entirely with ActionScript, that reference is usually just a variable. Consider, for example: var myDate:Date = new Date(); var myString:String = ""; In those two cases, the variables myDate and myString point to instances of the Date and String classes, respectively. The variable myDate has all the rights and priviledges (that is, all the functionality) of the Date class, because it is an instance of that class. For objects that are created "by hand" (e.g., movie clip symbols, button symbols, etc.) you'll need to give your object an instance name. The very presence of the symbol on the stage -- on the keyframe in which it appears -- is enough to give you the instance. But the instance isn't easy to get to without an identifying label, of sorts. That's where instance names come in. Select your movie clip (by its white circle, if need be) in frame 91 of the main timeline. When you do, take a look at the Property inspector, and you'll see an input field labeled Instance Name. That's where you can assign a unique identifier for this movie clip symbol. Given your code, that identifier -- that instance name -- should be mymc. Let me know if that helps. If not, I'll try to word it in another way. David Stiller Co-author, Foundation Flash CS4 for Designers http://tinyurl.com/dpsFoundationFlashCS4 "Luck is the residue of good design."
... View more
‎Apr 13, 2009
06:53 AM
Dannydoolittle1, For the sort of coding you're talking about, AS3 isn't much different at all from AS2 or AS1, so that should be encouraging. In fact, in the realm of stop(), gotoAndPlay(), and basic timeline navigation, you'll find that AS3 is 99% the same. That said, I'm not quite sure yet that I understand you're description. > I have a simple MC with a stop label on frame 1, which I placed on > my stage on say, keyframe 91. To be crystal clear, do you mean you have a stop() action in frame 1 of your movie clip? And you've place your movie clip on frame 91 of the main timeline? > I don't want it to play until the the play head gets to frame 91 so I made > an action on frame 91 - mymc.gotoAndPlay(2) but for some reason it > doesn't work. If this movie clip is on frame 91, then it won't be visible until frame 91 anyway. Even without any code, the movie clip would start playing -- from frame 1 of its own timeline -- when the main timeline's playhead hits frame 91. But there are plenty reasons you might want to halt the main timeline, then instruct a movie clip symbol to play for a bit before resuming the main timeline. If that's your angle, you may want to put a stop() action in frame 91 of the main timeline, then proceed with the code you already have. stop(); mymc.gotoAndPlay(2); // or 5, or 10, or whatever frame The trick here is to make sure that the reference mymc actually means something. In order to "talk to" a movie clip symbol like this, ActionScript needs an instance name. Is "mymc" an instance name, or is that the name you gave this movie clip in the library? David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 10, 2009
12:26 PM
thejam82, Well ... you've made a complete overhaul of the functionality here, so that potentially changes everything I'd said until now. So much has been altered, I'm not really sure which code pertains what object anymore. It looks to me like main is now what used to be called first. If that's so (and I'm really not sure!) then I'm assuming your URL-related buttons (the logos) now have instance names button1, button2, and so on. If that's true, then the mouse-related event handlers you've assigned to those inner symbols (their onPress handlers) are being obscured, or "blocked" by the mouse-related handlers associated with the main movie clip. We encountered this phenomenon earlier -- both with dot notation and the original on() function -- and it was for this reason that I suggested using the MovieClip.hitTest() method to determine which logo had the mouse positioned over it. In ActionScript 2.0, mouse-related events didn't "pass through" parent symbols that also have mouse-related event handlers. The technical term for this is bubbling, and it isn't formally supported in ActionScript until 3.0. So you'll probably have to use the same hitTest() workaround. That means you'll use an onPress or onRelease event handler associated with main that uses hitTest() in a series of if() statements to determine which logo currently "owns" the mouse. The reason this works again -- at least partly -- when you remove main's onRollOver and onRollOut handlers is because, once those are gone, main no longer has any mouse-related event handlers, so the inner mouse-related event handlers are allowed through. Off the top of my head, I'm thinking it may be possible to re-write this so that it omits the goRight and goLeft variables (grabbed might still be necessary), but from a pragmatic standpoint, the fact that it works is the most important part. I'm not sure why you reverted to unnamed functions; that is ... // this main.onRollOver = function() { grabbed = true; } // instead of this main.onRollOver = rollOverHandler; function rollOverHandler() { grabbed = true; } ... but no harm done, either way. There are definitely times when named functions are the better way to go. For example, when you want to assign the same event handler with more than one object, you can simply define your function once, then refer to it as often as you like by name. It also comes in handy when you want to programmatically assign and unassign event handlers, such as my earlier example where one function did this: this.onMouseMove = moveHandler; and another function did this ... this.onMouseMove = null; ... but again, the mechanics are ultimately up to you. Your series of if() statements, with hitTest(), should probably look something like this: main.onRelease = function() { if (this.button1.hitTest(_xmouse, _ymouse)) { getURL("http://www.google.com", "_blank"); } if (this.button2.hitTest(_xmouse, _ymouse)) { getURL("http://www.bbc.co.uk", "_blank"); } // etc. } David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 10, 2009
05:45 AM
thejam82, That's taken care of inside the second if() statement in the objectMover() function. The _x property is usually changing, because of the nearly constant addition of 2 to its value, right? Because the first clip starts way to the left, its value is lower than zero. That second if() statement checks when the value of _x gets higher than zero, then sends it back to where it started. You'll probably want to play with the numbers a bit to get as smooth a loop as possible. (For example, you might when to check when the value is higher than 10, 20, or some other number -- or maybe higher than -10, -20, or some other negative number.) David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 09, 2009
04:47 PM
4 Upvotes
crosinski421, > I am using a motion tween. I had forgotten, off the top of my head, if a motion tween was going to behave differently -- in this specific context -- from a classic tween, but they behave the same way, so it doesn't matter which you use. Again, that only applies to the example about about to discuss (generally speaking motion tweens and classic tweens are very different beasts!). In order to answer your next question ... > So how would I know which type to make? ... I'm going to step you though a quick experiment, and that should make everything clear. If not, we can just keep the conversation going until you get it. So, for the sake of discussion, try the following: Create a new FLA file. Use the Rectangle tool to draw a small rectangle on the stage. Select that rectangle and use Modify > Convert to Symbol to convert the rectangle into a symbol. Give it a name, and choose Graphic as the type of symbol. You'll notice the symbol appear in the library when you do this. Now that the rectangle is converted, select it again on the stage and use Modify > Convert to Symbol a second time. Once again, choose Graphic. At this point on the stage (and in the library), you have a graphic symbol that contains another graphic symbol. Double click the symbol on the stage to enter its timeline. At this point, you're inside the outer graphic symbol. The first symbol (the converted rectangle) is on the stage in front of you. Apply a motion tween to that first symbol. In the last frame of this tween, use the Free Transform tool to increase the size of the symbol. For the sake of dicussion, let's say this tween is 24 frames long. If you scrub the timeline you're currently in -- that is, the timeline of the outer symbol, which you're currently inside -- you'll see the motion tween perform its animation. Now return to the main timeline. You can do this by Edit > Edit Document. Now you're looking at the outer symbols, which only takes up a single frame of the main timeline. Apply a motion tween to this outer symbol. This second tween should be the same number of frames as the other way (e.g., 24 frames). In the last frame of this tween, drag the symbol sideways. At this point (if I understand your description), we've replicated the technique you're using in your own file: the outer movie clip moves from side to side, and if you scrub the main timeline, you'll see it do just that. Because this is a outer symbol is a graphic symbol, you'll also see the animation of the inner symbol (the increase in size) as you scrub the main timeline. This is one of the facets of graphic symbols, and why animators like them so much. Test your movie (Control > Test Movie), and you'll see that the published SWF behaves just like when you scrub the main timeline. Now ... scrub the main timeline back to frame 1. Select the outer symbol and use the Propery inspector to change it from a Graphic to a Movie Clip. It'll still be a graphic symbol in the library, but that doesn't matter. Scrub the main timeline again, and this time you'll only see the movement of the outer symbol from side to side. You will not see the increase-in-size animation of the inner symbol's timeline. Why? Because the outer symbol is a movie clip. That's how movie clips behave in the authoring tool. Text your movie again, and you'll see both animations again; that is, you'll see the side to side movement and you'll see the increase in size. Right-click on the tween span of the outer symbol in the main timeline. Remove its tween. Select frames 2 through 24 -- leaving frame 1 unselected -- then right-click and select Remove Frames. Now the outer symbol only occupies a single frame again on the main timeline. Test your movie. The side-to-side animation is gone, of course, because you removed that second tween. But the increase-in-size animation is still there. Why? Because the outer symbol is now a movie clip, and movie clips timelines run independently of the timeline they're in. Finally, select the outer symbol and use the Propery inspector again to change it from a Movie Clip to a Graphic. Test your movie one last time. This time, you don't see any animation in the SWF. Why? Because the outer symbol is now a graphic symbol, and graphic symbol timelines are locked in-step with the timeline they're in. Because the main timeline only has one frame at this point, only one frame of the graphic symbol's timeline plays. In a nutshell, that's the main difference between movie clips and graphic symbols. At least, that's the main difference that animators care about. There are certainly other differences, and those may (or may not) matter to you. Movie clips support filters, such as drop shadows, blurs, glows, and the like. Graphic symbols do not. Movie clips support instance names, which allow ActionScript to "speak" to them with programming. Graphic symbols do not. I could go on, but that should give you the basics. In your particular case, I'm thinking you might want to use a graphic symbol to house your tentacle animation. You don't have to, but if you do, you'll be able to scrub a parent timeline and still see the animation. David Stiller Contributor, How to Cheat in Adobe Flash CS4 http://tinyurl.com/dpsCheatFlashCS4 "Luck is the residue of good design."
... View more
‎Apr 09, 2009
01:11 PM
1 Upvote
crosinski421, Nah, you're cool. You can preview your animation from the main timeline -- it's just that your animation symbol needs to be a graphic symbol, rather than a movie clip symbol. You can change that by right-clicking the symbol in the library and choosing Properties, and then make sure to change its status on the timeline as well. To do that, select it on the stage and use the Propery inspector to turn it into a graphic symbol. Again, graphic symbols synch up their own timelines with the timelines they're sitting in. In this case, the parent timeline seems to be the main timeline. That's cool. Then you'll be animating a graphic symbol along a straight line, using a tween. So far, so good. Now, since this is CS4, you might be using a motion tween, or you might be using a classic tween. Which if those are you using for this tentacle animation? David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 09, 2009
12:27 PM
5 Upvotes
crosinski421, It sounds like the tentacle animation occurs inside a movie clip symbol, when you might want to do it inside a graphic symbol instead. Ultimately, it's up to you, but there's a big difference in the way these two symbols operate. Both have timelines, but movie clip timelines run independently of the timeline the'yre in. In the authoring tool, you won't see a movie clip's inner timeline play out until you publish the SWF (as you've seen) or enter that symbol's timeline. In contrast, graphic symbol timelines are locked in-step with the timeline they're in. For this reason, you need to give a graphic symbol enough room in its parent timeline to play out its animation. For example, if the tentacle-waving takes 100 frames, and if you make that symbol a graphic symbol, you'd need to give that symbol 100 frames on the main timeline to fully play through its animation. The upside is that if you do, you can then scrub the main timeline and actually see the animation from the main timeline, even while in the authoring tool. Let me know if that makes sense. I can try to explain it in different terms if that doesn't seem clear. David Stiller Co-author, Foundation Flash CS4 for Designers http://tinyurl.com/dpsFoundationFlashCS4 "Luck is the residue of good design."
... View more
‎Apr 09, 2009
07:56 AM
thejam82, Looks like I referenced the wrong instance name myself. Heh, the devil is in the details! The logo says Airlink, and that was the instance name I gave it (airlink), but I typed "airlift" in the code sample. David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 09, 2009
06:50 AM
Ayathas, Dynamic text fields have certain properties, and the one I described is simply a fact of life. If you want to mask dynamic text (or rotate it, or flip it, etc.), its font outlines must be embedded. True, embedding font outlines increases the file size. Generally speaking, the more complex the font, the more the SWF weighs. I'm not familiar with Asian fonts, so things might well be different, but in Latin fonts (English, many European languages, etc.), it's possible to embed only numerals, or only uppercase/lowercase, or only punctuation -- in other words, a subset of the full font -- which greatly reduces the potential file size increase. Again, I'm not sure how feasible this is for Asian fonts, but it's worth a try! David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 09, 2009
06:18 AM
Ayathas, Masking a text field is no different from masking a graphic symbol, move clip, or anything else -- but there's one thing to keep in mind: if your text field is dynamic, you'll have to embed font outlines for that text field in order to properly see the effect. The embed button is located in the Property inspector when a dynamic text field is selected. Depending of the version of Flash, this button will be labeled "Embed" or "Character Embedding". David Stiller Co-author, Foundation Flash CS3 for Designers http://tinyurl.com/dpsFoundationFlashCS3 "Luck is the residue of good design."
... View more
‎Apr 09, 2009
06:06 AM
thejam82, > David - many thanks for your expert help and work on the > file. Impressive. Glad to help! > The only trouble is that, when you click and drag the logos > left to right to move to further along the list, everytime you > do this, it opens up the url, which you probably will not want > to do until you get to the one you want to I was wondering about that, but didn't say anything because I wasn't sure if that's the behavior you wanted. From a logic perspective, it makes sense that the dragging/URL behavior happens, because the getURL() function is triggered any time the mouse releases over the first movie clip (the clip that contains all those logos). From a hypothetical standpoint, if AS2 had allowed what you were originally hoping for (that is, the on(release) code attached to each logo), then you would have run into the same issue: one of the logos' URLs would have been launched, because -- as is the case here -- you would have been releasing the mouse over a given logo. So at this point, it becomes a logic problem. How can you detect if the mouse has been moving just prior to being released? If it was moving before the release, the user was probably dragging the first movie clip. If it was not moving, the user was probably just clicking. It's this latter case only when you want the appropriate URL to launch. Off the top of my head, the MovieClip.onMouseMove event seems like a good tool for the job. This is an event that is triggered whenever the mouse moves over the object in question. Let's associate this event with a function in response to an onPress event. This function will set an arbitrary isDragging variable to true. This will only happen when the user presses and moves the mouse (that is, drags). If the user presses and simply releases without moving, the isDragging variable will remain in its default value, false. In the onRelease event handler, we'll check if isDragging is true. If it's true, we'll ignore the instructions to launch a URL. If it's false, it means the user wasn't just dragging -- the user simply pressed and released -- so we'll launch the appropriate URL. In any case, the onRelease handler will set isDragging back to false and remove the onMouseMove handler. Here's the revised code, and I've highlighted the changes in bold: var isDragging:Boolean = false; first.goRight = true; first.onRollOut = rollOutHandler; first.onRollOver = rollOverHandler; first.onPress = pressHandler; first.onRelease = releaseHandler; first.onEnterFrame = objectMover; function rollOutHandler():Void { this.goRight = true; }; function rollOverHandler():Void { this.goRight = false; }; function pressHandler():Void { this.startDrag(false, -7648, 0, 70, 0); this.onMouseMove = moveHandler; }; function moveHandler():Void { isDragging = true; }; function releaseHandler() { this.stopDrag(); this.goRight = true; if (!isDragging) { if (this.airlift.hitTest(_xmouse, _ymouse)) { getURL("http://www.airlift.co.uk/"); } if (this.airparks.hitTest(_xmouse, _ymouse)) { getURL("http://www.airparks.co.uk/"); } if (this.aph.hitTest(_xmouse, _ymouse)) { getURL("http://www.aph.co.uk/"); } // etc. with remaining instance names } this.onMouseMove = null; isDragging = false; }; function objectMover():Void { if (this.goRight) { this._x += 5; } if (this._x > 0) { this._x = -1952; } }; Keep your chin up. There's usually a way to accomplish whatever you like in Flash, provided Flash Player supports the functionality. David Stiller Co-author, Foundation Flash CS4 for Designers http://tinyurl.com/dpsFoundationFlashCS4 "Luck is the residue of good design."
... View more
‎Apr 08, 2009
01:46 PM
wongasta, Glad to hear the Flash part works! Sounds like you still have some effort to work through with the CMS, but at least you know the Flash aspect is working as expected. This sort of approach, were you pare things down and try to narrow the possibilities -- in other words, troubleshooting -- is a good practice to learn. If you keep at it, you'll find that it helps you all over the place. David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 08, 2009
11:47 AM
Ren, For some reason, that download link isn't working for me (might just be heavy traffic at the moment). In any case, I generally encourage people to work through their questions with words, even though it takes more effort. More often than not, that effort pays off. I remember this file, too. It has tons going on, which may well make it hard to dig through. My first thought is, do you have a "Green_CommCent" label in the parent timeline of the button in question? (Has your luck improved with compiling this file in Flash 8? I hope so!) David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 08, 2009
11:31 AM
fastpicker89, Do you want that text to be selectable? You might, for example, use the Property inspector to turn off the "Selectable" option for these text fields. If you do want the text selectable (so users can select, copy and paste, if they like), then my next question is, what sort of text fields are these (static, dynamic)? If dynamic, what programming (if any) do you have associated with them? David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 08, 2009
11:27 AM
wongasta, And does it work as expected when you test in a standard, non-CMS HTML document? David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 08, 2009
10:28 AM
wongasta, Whenever I try the SWF at the URLs you've posted, they always seem to work for me -- though, granted, they always open the content in a new window. Have you tried my suggestion to try to reproduce this issue in a new, simplified FLA file? Without a baseline, working proof of concept, it may be impossible to drill down to whatever is causing this. In the very least, you should try embedding this SWF in a simple, non-CMS HTML file and uploaded it to your own server to ensure that the SWF works on its own. It's not out of the question, for example, that something in the CMS (some global JavaScript function?) causes links to always open in a new browser. At the moment, there are too many variables/unknowns, so it'll help if you can gather a bit more information. Yuo said the buttons work in the authoring too, so that's an encouragement. I assume this means the trace() statement put your message in the Output panel? If so, then it's clear that the button works. At this point, I suggest you take that file and embed it in a "normal" HTML page, and let's see what becomes of that. David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 08, 2009
09:25 AM
Hrm. Amazingly, these forums don't support FLA or ZIP attachments (at least, not yet). Wow. Here's your file: http://www.quip.net/cb-sponsors_animation_rev.zip (I'll keep it there for a few weeks, but it'll eventually disappear). David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more
‎Apr 08, 2009
09:21 AM
thejam82, Aha. Well, now I can see why you're confused by my previous reply. It all comes down to communication. You said you had numerous URLs for numerous buttons/clips, but you didn't mention that all of those were collected inside a single movie clip (the one you gave the instance name first). This isn't a problem -- and in fact, you can still use the named functions I suggested -- but you'll only be assocating the first movie clip with the functions (there is no second, third, and so on; I thought those might be the instance names of each of the symbols inside first). I'm guessing now that you were attaching your on(release) code to the inside symbols, which makes a bit more sense over all. The problem is, the code on those inner symbols was getting blocked, because the parent of those symbols -- first -- was "catching" all your mouse-related code. Flash didn't "see" the your inner on(release) code, because the outer onRelease code was effectively blocking it. In ActionScript 3.0, there's something called bubbling that allows you to listen for the events of nested assets, but that's a different story. In this case, you'll need instance names on each of your inner symbols (the logos), and you can keep the same instance name (first) on the movie clip that contains all of those inner symbols. Instead of assigning an onRelease function to each of the inner symbols -- because they'd be blocked, remember -- you can use the MovieClip.hitTest() method to see if the mouse is within the bounds of each given logo when the mouse releases its click on the outer movie clip. My code suggestion is very nearly the same. Here's the code (for the benefit if anyone else reading this post), and I'll intersperse with a bit of explanation. first.goRight = true; first.onRollOut = rollOutHandler; first.onRollOver = rollOverHandler; first.onPress = pressHandler; first.onRelease = releaseHandler; first.onEnterFrame = objectMover; So far, nothing has changed. You're simply referencing the first movie clip by its instance name and associating functions with various MovieClip events. function rollOutHandler():Void { this.goRight = true; }; function rollOverHandler():Void { this.goRight = false; }; function pressHandler():Void { this.startDrag(false, -7648, 0, 70, 0); }; These are the first three functions. Nothing has changed. The releaseHandler() function, however, will drop its switch() statement and, instead, see if the mouse is within the bounds of any of first's nested movie clip symbols, each of which has its own intance name, such as airlift, airparks, aph, and so on. function releaseHandler() { this.stopDrag(); this.goRight = true; if (this.airlift.hitTest(_xmouse, _ymouse)) { getURL("http://www.airlift.co.uk/"); } if (this.airparks.hitTest(_xmouse, _ymouse)) { getURL("http://www.airparks.co.uk/"); } if (this.aph.hitTest(_xmouse, _ymouse)) { getURL("http://www.aph.co.uk/"); } // etc. with remaining instance names }; See the difference? You're using an if() statement for each logo, and each statement does the same thing. If the mouse is within this logo, you've as good as clicked on it, so when the mouse releases over first, the appropriate URL is opened. I'm including a revision of your FLA file, but I only added instance names to the first few (that is, the right-side) inner symbols. You'll have to add relevant instance names to the remainder. function objectMover():Void { if (this.goRight) { this._x += 5; } if (this._x > 0) { this._x = -1952; } }; Here in objectMover(), I figured you'll want the scrolling logos to eventually loop. Without the new lines at the end, your scrolling logos would eventually move off the right side of the banner, never to return. They _x value of first starts way to the left (approx -1952), so you'll want to play with that number a bit for better accuracy, or if you add (or remove) logos from the first movie clip. You may also want to change the values in the startDrag() method to better reflect the draggable boundaries of the movie clip. David Stiller Adobe Community Expert Dev blog, http://www.quip.net/blog/ "Luck is the residue of good design."
... View more