PDA

View Full Version : How do you use datacontrolsvisibilty?


cmcginnis
07-23-2003, 09:40 AM
I have an application that will load a swf resource based on a name in an xml document. After moving the application to v1 this resource becomes visible at startup. I saw in the v1 release notes that you can prevent this by setting a the datacontrolsvisibility to false in the datapath, but I get a compile error when I do this.

Here is my test (test_dp_vis.lzx):

<canvas>
<dataset name="someData" autorequest="true" src="my_data.xml" datacontrolsvisibility="false"/>

<resource name="myresource" src="common/global/btn_sm_rt_noarrow.swf"/>

<view name="aresource" x="50" y="50" visible="false" datapath="someData:/location/text()"
oninit="setResource(this.data)" ondata="setResource(this.data)"/>
</canvas>

Here is my xml (my_data.xml):

<location>myresource</location>


So when I bring this up in a browser I still see the resource even though the view has been set to visible="false". Also there is a compile error in the browser:

test_dp_vis.lzx:2:96: attribute "datacontrolsvisibility" not allowed at this point; ignored


According to your documentation this is the correct place to put this attribute, but the compiler says different.

Thanks for the help!

cmcginnis
07-23-2003, 09:51 AM
Sorry, I was looking at the datapath not the dataset documentation. But I still have the question about where to use the dataconrolsvisibility attribute.

antun
07-23-2003, 02:45 PM
Actually this is a known bug - datacontrolsvisibility doesn't work at the moment at all.

You should be aware that setResource() causes a memory leak at the moment. setSource() does not, and it also loads the image at runtime (so you could use it in your case where the URL of the resource is variable).

-Antun