PDA

View Full Version : <resource/> in <state/> tag?


girardjf
01-23-2003, 01:35 PM
Is this allowed? I know, per the example, that a state can contain <text/>, but can it contain a <resource/>?

Here's two syntax methods i tried:

1.
<state name="state_01">
<resource src="img/Home_Sect01.swf">
</resource>
</state>

The above syntax gives me a compilation warning of "resource not allowed in this context"

2.
<state name="state_01" resource="img/Home_Sect01.swf"/>
</state>

I get no compilation with this syntax but the "state.apply()" method does not seem to be working.

antun
01-23-2003, 01:38 PM
I think what you might be looking for is:-


<state name="state_01">
<view resource="img/Home_Sect01.swf" />
</state>


-Antun

girardjf
01-23-2003, 02:00 PM
The syntax i have below works:

<state name="state_01" resource="img/Home_Sect01.swf"/>

However, "oninit=state_01.apply()" does not apply the state. I can call a method via "oninit", but it doesn't seem as if i may use an expression when i am addressing the specific state.

I.E.

<method name="chngState" args="state">
myview.state.apply();
</method>

"onclick" DOES work, as long as the view containing the state has some content, a width, or a height.

I'm sure there is something i'm missing. Please let me know if you see it. I'd rather use the method call anyway.

Thanks,

-j

adam
02-10-2003, 12:32 PM
Can I see the code that you are using to apply the state? This should work. I would expect to see something like this

<view oninit="s.apply()">
<state name="s" resource="foo.jpg"/>