PDA

View Full Version : Contacting A Authoring Time Component via its Custom UI.swf


Prophet.
08-25-2004, 07:00 PM
hey all, new to these forums - usually inhabit Kirupa.coms great forums...

sadly ive thus far not received any replies to what should be a fairly straightforward question....

im developing a component and because it deals with text, there are lots of formatting options (on top of components properties etc) hence i begun developing its custom UI to make it easier and more intuitive for users to enter and edit its properties....

my question is this:
from within a .swf flash panel, i can set a components properties via the xch property BUT i cant actually get what properties have already been set by the user...

CLARIFICATION EXAMPLE:

if i select my component, i can edit its properties fine from within my custom UI.swf in the component parameters panel. when i preview, all is well...
if i deselect my componet, and reselect, all the values in my custom UI are reset to their defaults for the .swf and not the current settings for that component.

Ive already tried using:
global variables - useless if there are more than one instance of my component... and possibly (probably) useless anyway seeing as variables will olnly be declared during runtime and not during authoring time yes?
trying to trace its current xch value before setting it within the .swf but this returns undefined even if i have set it before within the panel.... ie.trace(xch.Dtext)
defaultText.onChanged = function() {
xch.Dtext = defaultText.text
} //OR simply having the variable property of the input text box as xch.Dtext
loadVariables with the URL as a non string value of xch but this comes up with an error saying it cant open the URL...

ive absolutely no idea how to do what should be so simple! :( any help would be greatly appreciated!

Prophet.

PS apologies if you couldnt understand parts of my post.... im not always entirely coherent and am used to typing in computer-shorthand or text-language or whatever its called ;) ive tried to keep it as legible as possible!

tg
08-25-2004, 07:40 PM
have you set up your component definition correctly in the library?

Prophet.
08-25-2004, 11:06 PM
yes - i can set properties of my component correctly.
but i cant get the current settings of the selected component into the custom UI .swf file...

ill try and explain a little better - you select my component.
edit its properties in the component parameters panel.
preview it works fine.
in the panel it displays what you have changed (ie you might have changed the property defaultText from "Prophets Demo Text" to "testing 1, 2, 3" and the latter would be displayed in the panel.
preview and the latter is what it is set to.
deselct the component, then reselect it (ie. reloading its UI).
the property defaultText will read (from the UI) as "Prophets Demo Text"
but if you preview it, you can see that it is still, contrary to what its UI is saying, "testing 1, 2, 3"


and i cant work out how to load in the variables....

Prophet.

tg
08-25-2004, 11:21 PM
if you look at your components fla file, open the library, right click on your component in the library and select 'component definition' from the menu. is that filled out correctly?

Prophet.
08-26-2004, 06:18 PM
yes. it was...
hence y i could set the variables...

my problem was getting the variables INTO the customUI swf, not sending them OUT to the component...

anyway i cracked it today...

for some reason i had to use a setInterval to set the respective boxes etc to the xch.variable, ie.
loadIn = setInterval(function(){
clearInterval(loadIn)
myVariable1.text = xch.myVariable1
myVariableB.text = xch.myVariableB
},15) on every frame of my UI (diff variables on diff frames, obviously)...

ah well... one of flashes oddities i gues!

cheers neway, problem solved...

Prophet.