Flash

I have lost my flash file, how do I get it back? What is a decompiler? How do I turn .swf files into .fla files?

Rothe Blog Design Flash Sothink Decompiler
Now, Chris and I differ on our opinions about this.

For $79.99, you can but this program called Sothink Decompiler. You can download a Flash movie off the internet, put it in this program, and it will make it into a Flash file for you to view the work of any developer around the world, including their script.

Now, for me, having no training in Flash on my own, I have to learn everything on my own. I do no know anyone to talk to Flash about, and so my experience with moving Graphics is one I have to gain on my own. Then, there is the problem that no matter how hard I try, and the fact that I don’t do it day in and day out and probably never will, I can’t seem to just sit down and write really complex programs.

For me, this program lets me see how it is done. I am not taking graphics out of the files, and more than likely, I will rewrite a script to fit my needs, using the original for a basis of what I need. So this is a great tool to learn. I actually used it for a project where there were these burning spark effects, and I wasn’t sure how it was being done. So I took a look at the file where I viewed it, and then was able to see how they did it, and created from scratch my own interpretation for my needs.

But it’s a double edged sword that is up to the individual to use wisely. There are many downsides to using it, becoming creatively lazy, alienation from the design world for what they view as “stealing”, and possible even problems at a job if you judiciously copy another piece of work from somewhere that comes back to reflect badly on your company.

So, it is one of those things, “Just because you can, doesn’t mean you should”. It is a good learning tool to be a passive observer, but can be a terrible tool in the hands of an unscrupulous person.


How do I validate my .html for xhtml when it has Flash in it? What is the Satay method?

I had read about how to validate any .html files with Flash included in an article by A List Apart a couple of months back. Now as we are nearing the end of the project development, I am needing to go through and finalize the details in browser compliance and also in XHTML validation.

The Satay method was created by A List Apart, and it is a way to get around the non standards compliant, <embed> tag. If you are having problems validating your flash integrated documents, you can read the article on the Satay Method at A List Apart’s website.

This is what I found.

The article doesn’t go into too much depth. If you read, you will notice that you will be loading the actual movie into a blank movie container. The article doesn’t specify, however, how big that container should be in relation to the actual movie. It only say that it should be small so that it can load quickly, hopefully less than 4k.

What I found worked for me, was to set the container to the same dimensions as the actual movie I was loading. In this case, the movie I was loading was 740 x 100, so I made a container of the same size.

The second thing that I did different is in how I loaded the movie. The article says to pass a variable through the get string to the Flash movie container similar in fashion to this;

c.swf?path=movie.swf

In this example, I actually stripped off everything after the question mark (?), and changed the actual actionscript information in the container movie.

His method suggests you enter this into the first frame of your container’s timeline;

_root.loadMovie(_root.path,0);

I changed mine so that the path to the movie was actually in the container. In this case, the end result looked like this;

_root.loadMovie(’/main_banner.swf’,0);

The final thing that I learned was actually about child elements in using the <object> tag. Basically, you can nest additional html information inside of the <object> tag in case the users browser does not understand. It is kind of like an alternative. In this case, we are going to use an image inside of the <object> tag that will display when it fails, or in this case, when the user does not have any version of Flash installed. Which is very rare, with something like 96% rate of use of at least Flash version 5.0

So now I have a valid XHTML compliant document that loads and contains Flash. Pay attention to the final code that is suggested for insertion. The main reason that it works is because it uses both the “data” attribute for the <object> tag, and the <param> tag with the attribute set of name and src to load the movie, which works for loading in both IE and Netscape type browsers.


How to I change a variable to a Boolean Value? What is a Boolean Value?

A Boolean is a value that is either True or False.

Translate True and False into numbers and you get False = 0, and True = 1.

Flash had a built in Method that will change a variable to a Boolean. Here is some sample code on how to implement that;

var myVariable:Boolean = Boolean(myValue);

This converts the value of “myValue” into a Boolean and stores it as a Boolean value in a variable called myVariable.

Now, what if the value of the variable “myValue” is a string? Well that will store “NaN” in myVariable. NaN translates into “Not a Number”. A string value can’t be change into a Boolean value.

Here are a couple more examples;

var mySample:Boolean = Boolean(123);

var mySample:Boolean = Boolean(0);

The first value evaluates to “True” because any number greater than one will evaluate to “True”. The second value will evaluate to False.

You may notice when I am defining these variables, the format looks like this - var mySample:Boolean. But you don’t know why you are adding a “:Boolean” after the name of the variable. This is data typing. You are defining the type of variable data that can be stored in this variable.

I hope to explain this in a little more depth in the near future.


What is a pin script in Flash MX 2004?

That is what I also did not know until today. A pin script really is nothing more than a marker to come back to.

When you are writing actionscript, you may want to come back to a certain frame during development. All you need to do is;

1. Click in the frame.

2. Open your actionscript panel. Window > Actions.

3. Click the pushpin icon at the bottom.

You will notice an additional tab appear at the bottom of the actionscript development window. You can click on any one of these tabs at any time and jump back to that frame that you want to work on again. In case you forget where that pin script is located, the tag will display the name of the layer, and the frame number like the following;

Layer 1:1.

So in summary, pin scripts are like markers during your actionscript development between frames so that you can keep your place. Tune in for more this week on things I have read specifically about Actionscript 2.0 and Flash MX 2004.


How do I prevent a pause in my preloader as a result of scripted sounds from the library?

For the longest time I had problems in Flash when I was using sounds. Like I discussed in an earlier topic here on the blog, I prefer to dynamically call all sounds from the library because that gives me the most control in timing in my movies. If you don’t know how to make a sound available to be called, check out this article from August.

The problem with calling those sounds is how they are loaded. When you go into the library, right click a sound instance and choose “Linkage” > “Export for Actionscript” by default, the dialog box also checks the “Export in first frame” option. So what this means is when you are writing your preloading script that is returning all of the byte information when it gets loaded, there will a long delay and then it will show up on screen with a good portion of the movie loaded. The desired effect would be for the user to see the preloader load from the beginning, from 1% loaded as it were.

Rothe Blog Export for Actionscript

Because we are checking this “Export in first frame” option, the sound actually loads before the first frame, and loads before anything else can happen. This is true with any object, from images to other symbols, that are set up for actionscript. That can potentially be a ton of information that needs to load before you can start “loading” the rest of the movie.

Well, this is how you prevent that.

Usually the preloaders that I create are movie clips that tell the main timeline to stop playing, and this movie clip is located on frame 1 of the timeline.

Rothe Blog Timeline

When the whole movie has loaded, I then tell the preloader “gotoAndPlay(”start”)” which usually also happens to be frame “2″ where the movie starts. If we want to use linkage on sounds, but don’t want to check the “Export in first frame” option, the sound has to be on the timline somewhere. This can become confusing when it comes to movie clips if you are going to drag them off of the viewable area, but with sounds it is really easy.

Look at the image above. I actually have a layer called Sound. You will also notice there is a music note looking thing in the second frame. If I extended that empty keyframe out farther you would be able to see that this is the sound I want to use located directly on the timeline.

“But the sound will start playing when the playhead rolls over it” you say. Not if you set the “sync event” to “none”. In order to do this;

Rothe Blog Sync Sound

1. Click the sound on the timeline.

2. Look down in your property inspector for the sync drop down box.

3. Set the sync box to stop.

4. At any time call on your sound in the movie and it will work just like you had exported it in the first frame.

The beauty of this is that when you are using your preloader, the sound size will be included in the total movie size since it is on the stage, even though it is set to “stop” and will be loaded with the rest of the movie.

I hope this fixes any problems you may have with delays in the start of your preloaders, and the preloaders starting up half way through the process. Use my contact page if you have any additional questions.


Color glow fade-in transitions using Flash MX

When I do research into what is hot in Flash Design, I have always seen one staple for image transitions. When and image would fade in it was almost as if the intensity and brightness of that image would be at it’s max before it changed into the regular image.

I knew tweening, and I knew how to set the Alpha to fade an image in, but for whatever reason, it didn’t seem like a simple fade in was quite the same as I had seen, and I knew it didn’t have the same visual impact.

But accident really I stumbled onto it the other day after having kind of forgot about trying to figure this technique out. I was working with a template from Monstertemplates that one of our clients needed customizing and I saw the effect reproduced. Here is an example of what I am talking about.

This is how you achieve this effect.

1. Open up Flash MX

2. Import a file to the stage. Any image file will do.

3. Click on that image then go Insert > Convert to Symbol. For this example I chose a Movie Clip and gave it a name of “rich transition”.

4. In the timeline, move the play head to frame 10 and press F6 or go up to Insert > Keyframe

5. Move the playhead back to frame 1 and click on the image on the stage.

6. In the properties inspector choose Color > Advanced and click on the “Settings” button.

7. These are what the setting should be to create this effect in the resulting dialog box. Red, Green, Blue and Alpha should all be set to 100%. To the right of these settings there are also the letters R, G, B, A for the categories with the names I mentioned previously. These are basically settings to color the intensity of the each of the colors vs. the full spelled out categories set the opacity of certain colors. This is what your settings should look like.

Rothe Blog Flash Tutorial 1

8. Right click in between frame 1 and 10 on the timeline and choose “Create Motion Tween”.

9. You’re done. You can copy the frames and place them at the end of the first set, right click and choose “Reverse Frames” to get the image to fade back to the starting position.

Either way, this color intense transition is a professional looking technique. You may ask, why can’t I just choose Color > Tint and set the “White” to 100%. You can, the transition just won’t look the same. You won’t see the yellows, reds, and blue intensify somewhere in the middle of the transition like it is a rich gold glow. It really is just a matter of preference.


The best possible image quality in Flash MX

Working with Photos in Flash can be a tricky proposition.

I have had problems before when importing photos for use in a Flash presentation. Many times photo quality can seriously decrease disproportionately to the quality level that is set in the publish settings.

Today, I read a post regarding image quality on Macromedia forums saying that “You cannot scale photos in Flash”. Having problems with a Flash file that contained photos, I tried out this theory.

I had imported three photos into a flash file, scaled them down approximately 20% and I had set my publish settings to a reasonable 92%. The images looked jagged and all text used in the images was illegible. Even when the publish settings were set to 100% quality, the text still looked jagged.

By resizing this images to the exact size needed in Fireworks and then re-importing them into Flash, all text was legible, and images were crisp. I was even able to reduce my export quality back down to 94% and have the images and text look presentable. Also, surprisingly, I reduced the overall movie size by 200-300K.

This would be my advice to all of you out there.

If working with photos in Flash and you can’t figure out why they look so bad, use the tips above to troubleshoot.

I would always advocate that any and every webpage is first laid out in Fireworks. That way no image adjustments will be made in Flash. All image size decisions will have already been made in the layout.

If there is an instance where layout decisions are being made in Flash and you are scaling an image multiple times to try to make a layout work, when the final size is chosen, the image should then be sized correctly in Fireworks and re-imported into Flash.


Response to my question about character limits in Flash URL link field.

Well, when I had this problem three days ago I posted on the Macromedia Flash forums. I did get one reply that said that there is a character limit for the URL address in Internet Explorer upwards of 2000 characters. But he didn’t think there was any managing of that in Flash.

I think he may have misunderstood me though, and said I should use a quotes in my getURL calls. Well, I am just using a plain text link, but to fix the problem until a later date, I added an invisible button.


Question: Does anyone out there know if there is a character limit for the URL Link?

I have this encoded URL link that I am using to get a specific address entered when someone clicks a link to Mapquest. However, it seems to truncate the link after a certain amount of characters, and I am having a hard time finding answers on the internet and in Flash forums. If anyone knows they can email me here jrothe@rothecreations.com.