[Extendflash] Updating components without getting the "Resolve
Library Conflict"dialogue
John Deans
John.Deans at theboardworks.co.uk
Wed Aug 24 16:02:21 PDT 2005
Hi,
I did something similar a while back, although in my case it was
slightly more straightforward, because a) the two components had
different names and b) the new component got palced in the same place
oin the movie each time - all I had to copy across were the parameters.
I didn't get any unexpected crashes - (I did get errors, but they were
to do with the not entirely universal assumptions I was making about my
flas).
So it's not entirely what you're doing, but it prompts me to wonder
about another way round -
- Give your new version of the component a new name.
- add it to the library
- use document.swapElement(newComponent) on each instance of your old
component
- delete the old component from the library
- rename the new one to have the correct name.
That way, you don't need to store any of the attributes, which I think
will get carried across in the swap (they do when it's done by hand),
and you should avoid the naming conflict.
John
________________________________
From: extendflash-bounces at flashguru.co.uk
[mailto:extendflash-bounces at flashguru.co.uk] On Behalf Of Nick Kaayk
Sent: 24 August 2005 14:42
To: extendflash at flashguru.co.uk
Subject: [Extendflash] Updating components without getting the "Resolve
Library Conflict"dialogue
Hello all,
My task is to write some JSFL to replace the components in a FLA's
library with the components in the componentsPanel, without getting the
"Resolve Library Conflict" dialogue ( the one that asks "One or more
library items already exist in the document:" and do you want to replace
them? ).
I have written some code to do this, described below, but it has issues
and so I am asking if there is a simpler method for an automated script
to replace components without getting the "Resolve Library Conflict"
dialogue?
Really, I guess, I want someone to tell me how to disable the "Resolve
Library Conflict" dialogue when running a JSFL script, so that I can
just replace the components in the Library.
Many thanks in advance,
Nick K.
---- description of current JSFL --
Ok, so to avoid the "Resolve Library Conflict" dialogue, currently we:
A) trawl all timelines for instances of the components to replace and
when they are found, we gather all their properties into an array.
B) loop through the array of found components and remove the instances
from their timelines. Now there are none of the components to be
replaced on any timeline.
C) delete the components to replace from the FLA's library. Now, there
are none of the components to be replaced on any timeline **or** in the
Library.
D) Now we can loop through the array of found components and repopulate
the timelines (and thus the library) from the componentsPanel, without
getting the "Resolve Library Conflict" dialogue . Yippee!
This system has two issues. Firstly, it times-out on big (hundreds of
items in the library) FLAs (which has been resolved - see my recent post
"Error Because JSFL script is running too long"). Secondly, it
sometimes crashes (it passes my unit-tests, but when I run it on real
content FLAs, it sometimes fails).
_________________________________________________
Nick Kaayk | Flash Programmer - BBC Digital Curriculum Project
Room 2376 White City | 201 Wood Lane | London W12 7TS
Tel: +44 (0) 20 8752 7592
http://www.bbc.co.uk <http://www.bbc.co.uk>
http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain
personal views which are not the views of the BBC unless specifically
stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in
reliance on it and notify the sender immediately. Please note that the
BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.flashguru.co.uk/pipermail/extendflash/attachments/20050824/d2c1f245/attachment.htm
More information about the Extendflash
mailing list