Welcome to Mediasparkles

News : Flash

What would you ask a Flash goddess?

Flashgoddess.com has contacted me about the April spotlight. I want to get the community involved, so here is my question to you: If you could ask a Flash goddess any question, what would it be? Please let me know. I cannot guarantee that your question will make it into the final interview, but all questions will be considered.

 posted by Vera (2/23/2004 07:40:00 AM);




If you're coming to Flash Forward say ya-hay!

I really don't want to steal MXDU's thunder, but Flash Forward in San Francisco is less than two weeks away, and I am starting to get really excited. Last year's Flash Forward was so much fun, and I suspect this year's is going to be even better. If you will be there, please drop me an email or comment so that I can look forward to meeting you.

I will definitely be at Kristin Henry's session titled Visualizing Science with Flash on Day 2 from 4 to 5pm, and I will also be at her Q&A the next morning. Here are some more sessions I will most likely attend:

Dov Jacobson: Flash and XML (he is the guy whose book first taught me about XML, so how could I miss it?)
Grant Skinner: Applying ActionScript 2.0
Guy Watson: Extending Flash MX 2004
Ben Forta: Web Services
Branden Hall/Joshua Davis: ActionScript For Everything Else

And just to show you what you can look forward to, here is a picture of San Francisco I took tonight. You can see downtown on the left and the Golden Gate Bridge to the right.

 posted by Vera (2/21/2004 06:14:00 PM);




JSFL #include hacks

Recently I have really wanted an #include function in the JSAPI. There were some global variables and functions that I knew I was going to change frequently and that were being used by many different scripts. So instead of having to edit each script every time I change the variable, I wanted to just #include that variable in all of my scripts. The closest you can get to an #include is the runScript() function. It's not perfect but here is what you can do with it.


fl.runScript( fileURI [, funcName [, arg]] );


fileURI is the full path to the external JSFL script to be "#included". If you leave the last two parameters blank, everything in your external script that is outside of functions will be executed. If you specify funcName or funcName and arg, the function 'funcName' will be executed and everything that is outside of functions.

In my case, I didn't really want to execute anything with runScript(), I just wanted to make some variables and functions from the external script available in another script. This is where the hacks come in. In order to make variables available in another script, you have to declare them without the var.

Say you are working in currentScript.jsfl. From within currentScript.jsfl, you make a runScript() call to externalScript.jsfl.


// externalScript.jsfl
var varWithVar = "yo";
varWithoutVar = "no";

// currentScript.jsfl
fl.runScript("file:///C|/somefolder/externalScript.jsfl");
// this will output "no":
fl.trace(varWithoutVar);
// this will cause the error message "Reference Error: varWithVar is not defined."
fl.trace(varWithVar);


Functions declared in externalScript.jsfl are not automatically available in currentScript.jsfl. If externalScript.jsfl declares a function called sayHi and you try to call that function from currentScript.jsfl, you will get an error message saying that sayHi is not defined. The way around that is to assign the function to yet another variable, like so:


// externalScript.jsfl
function sayHi(who) {
fl.trace("Hi " + who + "!");
}
pleaseSayHi = sayHi;


You can now call the function like this:

// currentScript.jsfl
fl.runScript("file:///C|/somefolder/externalScript.jsfl");
// this will output "Hi Pink Bunny!"
pleaseSayHi("Pink Bunny");


Having to create an additional reference to the function certainly isn't an elegant solution, but it works great if you really, really want to keep that function in a single external script and #include it in multiple scripts.

Update: Steve Ogden figured out that if you reverse the order in which the function is declared, you will no longer need to refer another variable to it.


// externalScript.jsfl
sayHi = function(who) {
fl.trace("Hi " + who + "!");
}


The function will now be available in the other script.


 posted by Vera (2/19/2004 06:06:00 PM);




My face in Flash

Even though I am not one of the speakers at MXDU, I still get to have one of the same benefits: A Flash caricature of myself! Steve from Nectarine emailed me today, and here it is:







I have always been so jealous of the MXDU speakers for their "Flash faces," and now I have my own. Thanks again, Steve! Special thanks also go out to Kai König for persuading the Nectarine guys to do this.

Update: With Burak's URL Action Editor, it is possible to hide layers in a .swf. Since I don't wear glasses anymore, Burak sent me a new version with the glasses layer hidden. Cool!







 posted by Vera (2/17/2004 07:17:00 PM);




Come to Flash in the Can!

Flash in the Can is in Toronto, Canada, April 3 - 5. Two of those days are on a weekend, which is nice because it means we don't have to miss too much work.

There will be a lot of outstanding speakers there - just check out the presenters list and you'll know what I mean. There also seem to be more female speakers than at other conferences, which I can appreciate. I am by no means one of the outstanding speakers I mentioned above, but I will be speaking myself. My presentation is about web services in Flash. I will also most likely participate in a Q&A session about server side technologies.

Come check it out! So far I know of two ways to get a 10% discount: Through We're here or through Colin Moock.

Update: You can now also get a Mediasparkles 10% discount when you buy tickets. The code is sparkle889.

 posted by Vera (2/12/2004 07:48:00 AM);




Don't need WebServicesClasses to use them

Here is something I didn't know: You don't need to have an instance of WebServiceClasses in your library in order to use the WebService API. The WebServiceConnector will do as well. This makes sense, but I don't think it has been mentioned before. No more trips to Window > Other Panels > Common Libraries > Classes for me! Dragging in the WebServiceConnector is just a little bit quicker. There is a slight difference in file size though: The WebServiceConnector adds 39K whereas WebServiceClasses only adds 23K.

 posted by Vera (2/06/2004 05:51:00 PM);




RWS

It just so happens that I had to go on a field trip to the Macromedia office in Redwood Shores this week. That's where the Dreamweaver, Contribute and Fireworks teams do their thing.

Naturally, I took some pictures:





My next post will not contain any pictures of any Macromedia buildings though, I promise. No, really.

 posted by Vera (2/05/2004 09:22:00 PM);