Rename an element across all frames of a timeline

February 27th, 2009 § 0 comments § permalink

I use a combination of timeline animation and scripting-based movement. All too often, I will create a timeline animation and only later realize that I need to give a MovieClip (or MovieClips) a name so I can refer to it from a script. Of course, this only happens after I’ve already created a zillion keyframes, and going through the entire animation to make sure that each MovieClip has its proper name in each keyframe is a real pain.

I finally got around to creating a simple JSFL script to automate this. It’s nothing special and it doesn’t do much error-checking or anything, but I thought I’d share it regardless in case it helps someone else :)

Copy and paste the following code into a file with the extension “.jsfl” (for example, “Multiframe renamer.jsfl”). Save the file in the appropriate folder, based on your platform:

  • Windows Vista™:
    boot drive\Users\username\Local Settings\Application Data\Adobe\Flash CS3\language\Configuration\Commands\
  • Windows® XP:
    boot drive\Documents and Settings\username\Local Settings\Application Data\Adobe\Flash CS3\language\Configuration\Commands\
  • Mac OS® X:
    Macintosh HD/Users/username/Library/Application Support/Adobe/Flash CS3/language/Configuration/Commands/

and restart Flash.

Then, in your document, select the element you want to be renamed across all frames. The go to the “Commands” menu and choose “Multiframe renamer”. You will be prompted to enter a name for the element (press “Cancel” to abort), and it will go and rename that element across all keyframes in that layer.

No warranty, use at your own risk, etc., but feel free to share and improve on it :)

/* multiframe renamer */
 
go();
 
 
function go()
{
    if ( ! fl.getDocumentDOM() || fl.getDocumentDOM().selection.length == 0) {
        alert("Please select an element");
        return false;
    }
    var element = fl.getDocumentDOM().selection[0];
    //  use the element's current name as the default
    var name = prompt("New name for elements on this layer?", element.name);
    if (name == null) {
        alert("Cancelled by user");
        return false;
    }
 
    var timeline = fl.getDocumentDOM().getTimeline();
 
    //  find the layer from the selection
    var layer = element.layer;
 
    //  all frames in this layer... rename first element to the name
    for (var i = 0; i < layer.frames.length; i++) {
        if (layer.frames[i].startFrame == i) {
            if (layer.frames[i].elements && layer.frames[i].elements.length > 0) {
                layer.frames[i].elements[0].name = name;
            }
        }
    }
 
    alert("Done!")
    return true;
}

Flash CS3 top-left redux

February 11th, 2009 § 0 comments § permalink

Last May, I complained about the change in the “Info” panel from Flash MX 2004 to Flash CS3. Since I needed the functionality, I whipped up a very simple (and crude) panel to let me see and edit the top-left of an element.

Download the compiled panel and the source code.

topLeft

As you can see, it’s very primitive. Select the element you want to operate on, and click “Get topLeft” to read the values of its top and left bounds. Click “Set topLeft” to move the selected element.

This comes in handy for changing a MovieClip’s registration point while leaving its visual position intact. Select a MovieClip instance, click “Get topLeft,” then edit the MovieClip and slide its contents around so that the registration point is where you want. Exit MovieClip editing, then click “Set topLeft” (without changing the values in the edit fields). The instance will go back to its original visual position.

JSFL feature request

July 17th, 2008 § 2 comments § permalink

Automating Flash with JSFL is very useful, but I sure wish there was a way to specify “save as Flash 8″ in fl.documentSave(). I guess I could run the script in Flash 8 instead… kind of a hassle though.

Tweaking gskinner’s compileProject script

February 21st, 2008 § 0 comments § permalink

Recently I had the need to rebuild a whole bunch of Flash movies, more than I wanted to do manually. Before writing my own JSFL script to automate the process, I did a quick Google search and found Grant Skinner’s FLA Batch Compiler script. It’s very flexible and very handy: exactly what I needed.

Grant’s script uses a text file to specify what files need to be built and where the resulting SWFs should be copied. However, the text file uses single tab characters (ASCII 9) to separate the fields, and I like to configure my text editors to insert spaces instead of the tab character.

I made a small modification to Grant’s script to allow any amount of whitespace (spaces or tab characters) in between each field in the schema file.

I changed this (around line 49 in compileProject.jsfl):

    var l = schema.length;
    for (var i=0;i<l ;i++) {
        var row = schema[i].split(String.fromCharCode(9));

to

    var l = schema.length;
    var regExpDelimiter = new RegExp("[ \t]+");
    for (var i=0;i<l ;i++) {
        var row = schema[i].split(regExpDelimiter);

And that was that!

(I originally tried using the literal RegExp notation [e.g. scheme[i].split(/[ \t]+/)], but it didn't seem to want to compile that way.)

JSFL in Flash CS3

May 9th, 2007 § 2 comments § permalink

I still don’t have Flash CS3, but I was wondering what was changed in JSFL in the new release. The info is on livedocs. Alas, as far as I can tell, there is no event or anything sent when the selection changes, which would be a great help. Oh well. Maybe in the next version? :P

My first custom Flash panel

January 16th, 2007 § 0 comments § permalink

I ended up using a different approach to my panel, so I didn’t investigate the problem I was having in my previous post. I’m not running into the issue now, so perhaps it was just something weird with my code.

hierarchical animation panelHere’s what my panel looks like at the moment. The interface is very rough and I’m sure it would make no sense to anyone but myself. It’s a bit of a pain to use, too.

My panel does not monitor the current selection. I tried the test that I linked to in my previous post, and in Flash 8 (at least for me) it causes the IDE to go all wonky: the mouse pointer flickers and changes, and double-clicking on things on the stage doesn’t always work. The symptoms continue even after closing the panel, sometimes! How strange.

Instead, the user has to select the element and then click on the “Get” button. This loads the selection’s information into the panel. “Set” puts the information back into the currently selected element. It’s all rather awkward.

The following two buttons require some explanation. “Memorize Children Pos” takes a snapshot of the positions and orientations of all of the selected element’s “children.” The element’s children are listed in the text area above. Clicking on “Make Children Follow” repositions all of the children of the selected element so that they maintain the same relative positions and orientations as they did when “Memorize” was clicked. Yes, hierarchies of any arbitrary depth are supported, so the children of children (etc) are also moved accordingly.

I am going to continue to use this panel, and perhaps release it, and the source code, at some point. It’s all pretty rough, though, so I am a little hesitant to do so.

JSFL: persistent data not being saved with FLA document?

January 15th, 2007 § 0 comments § permalink

Now I’m having trouble with persistent data (set with element.setPersistentData()) being consistently saved when the FLA file is saved. It seems to save correctly with some elements, and not others. It could well be a problem with my code–and for all I know it’s being saved, but it’s not being retrieved properly. I’ll have to try to reduce this down to a reproducible case to see if it really is a Flash bug. Argh.

My first steps with JSFL

January 15th, 2007 § 2 comments § permalink

I’ve started playing with JSFL, which is JavaScript for the FLash IDE. More specifically, I’m creating a custom panel that I hope will make hierarchical animation easier to do on the timeline (at least the way I do it).

Unfortunately, it doesn’t really seem possible to make a panel that updates itself when the selection in the IDE changes (the way the built-in panels do), at least not elegantly or reliably. I suppose it is possible, by having the panel constantly poll the state of the selection, but that seems like a waste of resources, and at least one person out there seems to be having problems with that technique, although I haven’t tried it myself in Flash 8 (looks like the bug still existed in 7.2). I may try it that way anyway…

What I really want are events that my panel can respond to: selection changes, elements being moved, etc.

Another issue I’ve run into: when setting an element’s transformation matrix, the element moves as expected, but the transformation point doesn’t move with it! This leads to some really strange tweening unless you manually reset the transformation point (I just double-click on it with the Free Transform Tool). This will make my panel a real pain to use.

Hmmm… doing some snooping around, it looks like it is possible to change the transformation point using the document.setTransformationPoint() method. However, it only affects the selected elements, which means my code will have to select each element in order to fix it up. Rather messy, but if it works…

Where Am I?

You are currently browsing the JSFL category at bunnyhero dev.

generic viagra india
cialis versus levitra
where to puchase cialis online
viagra urethral
cialis for sale
viagra cialis levitra buy viagra
natural viagra
half price viagra
levitra canada
cialis 10 mg
viagra dosing
cialis side effect
generic cialis soft from india
shelf life of viagra
cialis en ligne de pharmacie
levitra alcohol
formula for viagra
100 dollars cialis
levitra lawyers
viagra
apcalis levitra vs
order discount viagra
levitra young people
viagra vs levitra
viagra oral sex
cialis response
viagra side effect
ladies viagra
levitra users
best generic viagra prices
cheap cialis find
bought viagra fuerteventura
viagra candy
viagra side affects
cialis headache
avandia
effects of viagra on women
viagra next day shipment
viagra extacy ashanti
what is cialis soft
viagra logo
viagra works
over the counter viagra
diabetes and viagra
viagra ocular side effects
viagra wholesale
cialis no perscription
buying viagra in new zealand
cialis allergic lesions
pharmacy online viagra
viagra for sale online
viagra gel
cialis generic
viagra joke
viagra what to expect
directions for taking viagra
lowest cost for cialis 20mm tablets
purchasing viagra
cialis next day delivery
cialis prices
geniune cialis no prescription
viagra pay by e-check
side effects from viagra
levitra consumer information
cialises
viagra sideffects
viagra from usa
viagra uterine thickness
viagra blood pressure
cheapest viagra
cialis achalasia
cialis and levitra
generico viagra
cialis generic india
achat viagra
substitute for viagra
viagra pills cod
levitra sale
viagra availability at boots
cialis pill
viagra and women
buy viagra online in uk
what is the best herbal viagra
levitra medication
purchase cialis
health net viagra non-formulary cost
death by viagra
discount viagra online
roomid 71 cialis
viagra pic
on line prescriptions for cialis
cialis soft tab
viagra soft
viagra purchase
viagra discussion
viagra sheet off leg
what is better viagra or levitra
viagra s
viagra rx
viagra reviews
viagra women forum
viagra levitra cialis
cialis generic rx
viagra time
cialis lawyer ohio
order pfizer viagra with mastercard
drug impotence levitra
buy cialis online viagra
purchase generic viagra
viagra sildenafil citrate
cheap viagra new zealand
generic viagra overnight delivery
cialis australia
cialis overnight
gay men viagra vs cialis
prices cialis
money order viagra
lowest viagra prices
does viagra work for woman
viagra sildenafil
cialis and violent sex
is viagra for women
buy sublingual viagra online
buy viagra
on line viagra
cialis bph
levitra headache
where to buy viagra on line
20mg cialis
generic viagra
cialis super viagra
tadalafil generic cialis
viagra use of
viagra otc
purchase viagra
viagra dosage for women
viagra shelf life
canadian pharmacy viagra
viagra and cocaine
cialis murah klang
info on viagra
cialis dosage
pic viagra woman
discounted viagra
cheapest viagra prices
cheapest generic viagra
cialis user forum
wikipedia viagra
viagra sales uk
cialis viagra sampler
info on cialis
ship free viagra sample
buy cialis online uk
viagra or cealis
cialis women libido
searchstring cialis type all
buying cialis
cost levitra
cialis levitra viagra
viagra 6 free samples
ending viagra use
cialis no prescription
rosacea viagra
viagra adverse events
cialis drug information
viagra for under $2
buy cialis online now
advantages of viagra
c-ring viagra
male enhancement cialis
viagra rss feed
what is better levitra viagra cialis
viagra sample
cheapest price for viagra
headaches levitra
viagra for sale in the uk
viagra cialis levitra buy viagra
recreational viagra
viagra viagra
prescription for viagra
chineese viagra
cialis order form in uk
natural herbal viagra
cost of cialis
double dose of cialis
viagra versus cialis
canada cialis levitra
cialis softabs
can viagra be used by women
india generic cialis
buy viagra alternative
cialis erection problems
generic cialis from india
buying viagra buying viagra
bad side effects of viagra
levitra tabs
viagra inventor
buy cialis online
cheap viagra discount
buy viagra meds online
no prescription cialis
what is better viagra or levitra
que sabes del viagra
cialis canada
buying generic cialis
best buy viagra
online viagra store
natural viagra products
levitra vs cialis
women using viagra
generic viagra buy
buy cialis generic
women viagra
cialis without a prescription
videos viagra
viagra use and abuse
ingredients viagra
cialis cheap
us viagra
cialis vs levitra
what is levitra
side effects viagra
viagra women
what happens when you take viagra
cialis sample
overnight cialis
approval cialis fda
viagra no prescription
bayer and levitra
india cialis
new drug cialis
levitra website
side effects cialis
viagra and jokes
cialis vs levitra
lowest priced viagra in britain
generic viagra online
viagra generico
cialis or viagra
viagra for men
viagra vs cialis
viagra cialis levitra
viagra lawyer ohio
buy online viagra
uk pharmacies cheap viagra
german viagra substitutes
viagra boots
songs about viagra
levitra doses
levitra dose
natural substitute for viagra
cheapest generic levitra
generic levitra 32
women who take levitra
best price for generic viagra
cialis opposite effec
purchase cialis online
viagra online pharmacy
bayer levitra samples
heather viagra grow
cialis multiple attempts
buy viagra in amsterdam
viagra by mail
cialis levia and viagra
viagra uk 32
buy viagra on the internet
cheap cialis sale online
viagra pay pal
viagra discount store
genric viagra
cat 1 keyword viagra
order cialis uk
viagra cialis levitra
cialis overnight shipping
viagra usage
viagra free trials
viagra herbal substitute
negative effects of viagra
woman taking viagra
viagra ad
order cheap viagra
cialis new viagra
buy soma online
buy viagra online 35008
viagra alternative research
u 19835 cialis
cheapest price viagra
viagra free samples
viagra dosage
brand viagra without prescription
ebm diabetes viagra
liquid cialis
discount viagra canada
generic viagra from india
levitra for women
cialis alcohol
buy viagra in canada
women and viagra
cheapest place to buy viagra
40 grams of cialis
viagra info
cialis alternative
cialis naion
viagra experiences
no prescription order viagra online
make your own viagra
levitra vs viagra
pharmacy viagra
women who take viagra
lowest price generic viagra
cheapest place to buy viagra online
buy cialis by check
cialis new viagra
viagra soft tabs
levitra women
levitra pills
viagra and altace
viagra use
levitra vardenafil
buy viagra in mexico
generic viagra lowest prices
buy viagra in bangkok
viagra best way to use
best natural viagra
viagra retarded ejaculation
cialis mexico
generic low price viagra
buy viagra online without prescription
does levitra work
viagra cialis store
dosage of viagra
discount levitra online
viagra ads funny
cialis britain
viagra generique
cialis soft tab india
viagra faq
viagra from canada
levitra eye problems
cialis testimonial
viagra pennis enlargement
suppliers of viagra in uk
what is cialis
cialis trial pack $38
cialis pictures descriptions
cialis canada online pharmacy viagra
lowest prices for cialis
lowest prices viagra
cialis information
viagra australia
viagra india
uk cialis supplier
viagra natural
exercising after taking cialis
cheap viagra
cialis duration of effectiveness
cvs viagra
viagra on-line
cialis versus levitra
sample cialis
u id password cialis
generic for viagra
viagra not working
levitra medicine
natural cialis
cialis wholesale online
cialis samples
cialis viagra levitra
herbal viagra replacements
women use viagra
buy viagra online
viagra online no prescription
multiple acts viagra
viagra forum
viagra online asap
viagra in the water
generic viagra mexico
viagra cialis store
cialis interactions
generic brands of viagra online
soma
cialis pictures results
viagra without a prescription
viagra patent
viagra tiajuana
alchohol and cialis
cialis purchase
cialis and viagra together
overnight viagra
gernic viagra
cialis user reviews
levitra and marijana
viagra buy
viagra directions
rapid tabs viagra
viagra suppositories ivf
wild horses viva viagra
viagra beneficial side effects
canada cialis levitra
viagra cialis
cheap cialis
10 mg cialis
viagra for sale
viagra and jet lag
buy discount paxil
cialis oral
viagra side effects
get viagra over the counter
herbal viagra 32
viagra london
viagra and blood pressure
levitra men video
viagra online
womens viagra
sample of viagra
womens viagra
viagra professional
generic viagra cheap
efficacy levitra
viagra erection time
viagra stories
us pharmacy cialis
viagra cream
mexican viagra
discount generic viagra
viagra low cost
levitra side effects
hair growth with viagra
levitra cialis viagra
buy viagra usa
ed cialis
adverse side effects of viagra
side effects of cialis
viagra uk sales
uprima cialis viagra
apcalis vs viagra
viagra england
buy cheap viagra online uk
buy viagra in uk
guaranteed cheapest viagra
low cost viagra
levitra prescribing
cost of viagra
cialis drug prescription
cialis soft tab description
viagra supplier
viagra pictures
cialis viagra levitra
viagra prices
20mg levitra