tag:blogger.com,1999:blog-88479482713978053622024-03-13T19:21:30.536-07:00Amy's Flex DiaryNotes of sights seen along the way as I explore technologies after Adobe Flex, primarily AngularJS.Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.comBlogger84125tag:blogger.com,1999:blog-8847948271397805362.post-12540222635684578672021-11-28T10:52:00.004-08:002021-11-28T10:52:58.611-08:00Extending JSDom's HTMLElement for Jest TestingIf you're unit testing your visual JavaScript/HTML components using jsdom for DOM rendering, sooner or later you will encounter the unimplemented parts of the library. If you're not sure if you're using jsdom, check your project's package.json for "jsdom" in "dependencies" or "devDependencies". Most projects set up to use jest also use jsdom if they're testing the rendering of html elements.I'm Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-38261231396296894482020-04-10T17:13:00.000-07:002020-04-10T17:13:49.305-07:00What I Learned by Being My Own Test EngineerThe company I work for shifted focus from producing features very quickly to getting our code quality very solid to allow us to add new features without regressions. This means that it's "all hands on deck" for putting necessary tests in place to catch as many regressions as possible before we switch back into building new features.
I previously thought that it might not be worthwhile to have UI Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-20626979681384006522017-03-15T15:13:00.003-07:002017-03-15T15:13:35.845-07:00AlaSQL to search your JSONWhen you're working in JavaScript, many times you'll have a data source that is one or more JSON or JSON-like objects. When those objects are stored in an Array, you can use filter() to find the element you need, but what happens when you start to get into nested Objects—where the JSON elements in your Array themselves contain Arrays or Objects? Then you wind up with filters within filters,Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-15529157908282999392017-01-23T15:50:00.001-08:002017-01-23T15:50:23.018-08:00Karma Like a BossFor a long time, I thought you couldn't set a break point in a Jasmine test running in Karma. Heck, I even said that in a blog post. I recently learned this wasn't true. Once you know how debugging in Karma works, it seems really obvious, but I think I'm probably not alone in missing this entire feature or understanding how to make best use of it.
So let's start out by looking at a browser Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-61137789288198061792016-10-31T11:51:00.000-07:002016-10-31T11:51:45.431-07:00Multiple SVGs and CSS in AngularJS (or why SVG has to be inlined)In my previous post, I discussed the steps to create a SVG for use in an AngularJS project, ending with a very simple interactive SVG in Angular. In that fiddle, the SVG was completely inlined. In the case where there is only one inline SVG, it really doesn't matter if all the CSS is internal or external unless you plan to switch style sheets at runtime.
However, once you have more than one SVG,Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-54290891048318077282016-10-18T15:58:00.000-07:002016-10-19T14:02:41.968-07:00Preparing SVG for use in AngularJSMost developers are not also designers, but we commonly have to take a static design we get and figure out how to make it interactive. Recently, I received a set of Illustrator files that depicted circuit diagrams that a user needed to interact with to say whether they thought the circuit would have enough power to light one or more light bulbs.
I could have tried to simply create graphics Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-30069985067582895062016-09-11T17:24:00.002-07:002016-09-12T21:56:43.364-07:00Spying on AngularJS Services That Are called Directly as FunctionsJasmine spies are great. But when testing AngularJS services, it can really be be hard to test that the correct calls are being made to services where you’re calling the service itself instead of an attached method, such as the $interval service. When you’re testing controllers, you can directly inject your own spy if you want to test that $interval was called with the correct arguments, Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-32865257698747236732016-04-23T18:14:00.000-07:002016-04-23T18:14:19.584-07:00Tips for Testing AngularJS SPA's with Karma and JasmineWhen I first started unit testing with AngularJS, Karma, and Jasmine, I read everything I could get my hands on about the subject. While there’s a lot of good material out there, I wouldn’t want to write tests, let alone ask my team to do so based on the material I originally found. This post is the one I wish I’d found when I first started writing tests, less of a “Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com1tag:blogger.com,1999:blog-8847948271397805362.post-25179568108011624392014-10-20T06:00:00.000-07:002014-10-20T10:47:41.919-07:00How I learned to stop hating the command line (so much) I'm old. So I still remember when every computer screen looked like what we now call "the command line." Screens were black and text was green or amber. Anything you needed to do on the computer took forever and depended on your ability to remember lots of commands and type them correctly. This made computing seem difficult and unapproachable. So when the first MacIntosh computers showed up in Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-5953858745104045102014-10-19T17:59:00.000-07:002014-10-19T17:59:37.026-07:00Deja vu all over againWhen I started this blog in 2007, I had been developing in a technology called Authorware that Adobe was in the process of killing off. So I decided to concentrate on teaching myself Flex, sharing what I was learning with others who were also making that transition.
I still work in Actionscript a lot, primarily in Flash, but unfortunately I've had to come to the decision that it's not the best Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com2tag:blogger.com,1999:blog-8847948271397805362.post-27769304346831780252013-05-27T15:05:00.000-07:002013-05-28T07:30:36.356-07:00ActionScript, E4X, and White SpaceI've been reading XML into ActionScript 3 for many years, and I still haven't solved all the issues with it. Given that my searches for solutions to these issues turn up so little, I decided to share the solutions I have found, especially when it comes to white space.
I think at least part of the reason that these problems are so hard to solve is that the XML documentation for many of the Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-83142468288802720982013-05-08T18:26:00.000-07:002013-05-08T18:26:31.677-07:00Batch Import Images into Flash SymbolsWhen I find a workflow I like, I sometimes assume that everyone has already discovered that workflow, and I'm late to the party. One of the nice things about participating in user forums is that sometimes that helps me realize that a favorite workflow isn't known to everyone. This is great, because then I have something to blog about!
Today, I want to talk about what is probably one of my Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com1tag:blogger.com,1999:blog-8847948271397805362.post-3260492729522483732013-05-05T10:01:00.002-07:002013-05-05T10:01:56.010-07:00FlashTips #6: Debug refresh issues in your swfMost of us know that Flash Builder makes it easy to debug a swf on a server by creating a custom debug configuration. Recently, I had a problem where I needed to be able to debug issues that happened when the browser window was refreshed.
Jeffry Houser, the brains behind Flextras.com, apparently had this very same problem, and resolved it by starting a new debugger session that points to about:Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-84475176181053100552013-03-02T14:21:00.000-08:002013-03-02T14:22:28.164-08:00Reusing a Flash Builder WorkspaceI use Flash Builder and Flash Pro together, and over time I have learned to just bow to how Flash Builder wants me to do things. What this means is that each "family" of Flash files has to have its own Workspace, because Flash Builder expects the Flash file to be in a subdirectory of the workspace in a directory that's the named the same thing as the Flash file. If that's not where it is, you Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-25426430831933176402013-01-07T14:52:00.000-08:002013-03-03T07:07:42.677-08:00My favorite Flash Builder Code TemplatesI hate typing the same code over and over, and DRY can only take you so far. I also hate making the same changes over and over. So I've "tweaked" some of the templates that came with Flash Builder and I've added many to automate the tasks I do frequently. I've made them available for download. You'll need to unzip the file and import the template file into your ActionScript code templates, or youAmy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com3tag:blogger.com,1999:blog-8847948271397805362.post-34575173215575385062012-10-11T18:49:00.000-07:002012-10-11T18:49:39.437-07:00Excel is Excellent!Lately it seems that, more often than not, I am working with at least two spreadsheets open. Don't tell Steve Howard, but I think I've fallen in love with Excel. It seems to make me orders of magnitude more efficient. Not just for crunching numbers, but a wide variety of tasks.
Planning
I first started using Excel for planning when I was in business for myself. The best way I've ever found is Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-73128829232720244072012-07-18T18:38:00.000-07:002012-07-18T18:38:12.081-07:00FlashTips #5: Copy Variables in Flash BuilderHave you ever wanted to copy all the values of the member variables of a Class instance you were debugging in Flash Builder? If the data types of those variables are simple, you can do this pretty easily by right-clicking on the variable name in the variables panel and selecting "Copy variables." This will copy the name of each member property and its value to the clipboard. Values that are Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-65202616642273511492012-07-09T06:00:00.000-07:002012-07-09T06:00:02.734-07:00FlashTips #4 Turn off AutoSave on reference projectsWhen a Flash Pro project is not set up to save automatically, it will prompt you to enable autosave when it has unsaved changes. I usually say yes, because I don't like to lose work. However, Flash considers a file to be "changed" even if you've just popped open a MovieClip to see where that button is so you can duplicate its position elsewhere.
This can make it inconvenient to have a Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com3tag:blogger.com,1999:blog-8847948271397805362.post-19478549686754877342012-07-02T06:00:00.000-07:002012-07-02T09:21:41.146-07:00When Good (Flash Builder/Flash Pro) Projects go badI love Flash Builder—especially the refactoring help—so it broke my heart when I found that many of my favorite features, such as renaming variables and classes on the fly, didn't work. I was also getting all sorts of weird other problems, such as getting two copies of warning and error messages. I also couldn't edit files when I spotted problems in debug mode, because I'd get a weird error Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-18712523383468578142012-06-29T18:39:00.000-07:002012-06-29T19:47:14.892-07:00FlashTip #3: What color is that thing in PhotoshopIf you've ever searched on "Photoshop for Developers," you've probably noticed that most results are either really shallow or should more aptly be titled Photoshop for people who can't read the help and figure it out. So, I thought I'd post every once in a while when I find something that helps me with my real workflow as a working developer. It will probably still be shallow, but at least I knowAmy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-51643792815446832262012-06-11T05:00:00.000-07:002012-06-11T05:00:07.476-07:00Endless Scrolling BathroomIt often seems that I'm drawn to questions on Stack Overflow that have to do with manipulating pixels directly. This week, I fielded a question from someone who wasn't happy with the solution he was using where he was using the graphics object and filling it with the bitmap he was trying to scroll.
I gave him syntax to do it with copyPixels, but what I gave him didn't completely solve his problemAmy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com2tag:blogger.com,1999:blog-8847948271397805362.post-82572595909982819362012-06-04T14:31:00.001-07:002012-06-04T14:31:53.417-07:00FlashTip #2: Changing the view on audio foldersI deal with audio files nearly every day. These files are ones that have been recorded by our voice talent, so all the track information that is wonderful when you've downloaded a music file or ripped it from CD isn't useful.
What is useful is knowing how big the file is and when it was last modified. You know, like you can easily see in directories that do not contain audio files.
Not long ago,Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-6852053537481380372012-06-03T10:00:00.000-07:002012-06-03T16:30:23.698-07:00FlashTip #1: Center on StageOne of the things I find most frustrating about Flash CS5.5 is that checking the "Align to Stage" check box in the Align panel seems to yeild results that are not even remotely what I was expecting. For example, if I want to center an object on the stage horizontally and I have this box checked, the center of the object will align with the left edge of the window.
A quick fix I've found for Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com1tag:blogger.com,1999:blog-8847948271397805362.post-84299654278465051002012-06-03T09:51:00.001-07:002012-06-03T09:54:05.830-07:00Change of DirectionI haven't said much lately on this blog. Mostly that's because I am not doing Flex very much, and haven't been for a while. I did a short stint with Captivate, but now most of my work is in Flash. And, actually, I am doing more these days in AS2 than AS3. Hopefully that will change, since I am rewriting our codebase to a consistent AS3 framework.
I've decided to shift the focus of this blog awayAmy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0tag:blogger.com,1999:blog-8847948271397805362.post-39630095836959702572011-05-19T18:28:00.000-07:002011-05-19T18:37:11.870-07:00What's new in Flash Builder 4.5 for Test Driven DevelopmentI love Test Driven Development (TDD), but there are some parts of it that I've found pretty painful in the released versions of Flash/Flex Builder. Given the benefits of TDD, I've chosen to grit my teeth and just bear with it. Last month I went to 360Flex, which showcased some of the productivity enhancements in Flash Builder 4.5, and I am thrilled to see that Adobe has addressed these pain Amy Bhttp://www.blogger.com/profile/10902594300072091444noreply@blogger.com0