Copy link to clipboard
Copied
Hi I hope someone can help me.
I need a flash page to open a Zip folder read an xml file in the folder
From here it can find
the backgrounds to be used
paths to the icons needed
and coordinates for the icons.
The zip folder is in the folder "/ project /"
icons in the folder "/ icons /"
Background images are in the directory "/ project / (the zip folder / images /)"
In the above XML, you can read the descriptions.
<?xml version="1.0" encoding="UTF-8"?>
<icwproject name="Henrik" version="2">
<description>My Projekt</description>
<ihcproject>ihcproject.ihc</ihcproject>
<created day="27" hour="16" min="57" month="8" sec="34" year="2011"/>
<lastmodified day="15" hour="19" min="5" month="9" sec="3" year="2011"/>
// FILE SOURCES WITH ID - FOLLOWING OFFICIALS FILES MUST BE USED //
<images>
<image active="mail_active.png" id="mail" inactive="mail_inactive.png" noresource="mail_noresource.png" preview="mail_preview.png"/>
<image active="scenelink_active.png" id="scenelink" inactive="scenelink_inactive.png" noresource="scenelink_noresource.png" preview="scenelink_preview.png"/>
<image active="spot2_active.png" id="spot2" inactive="spot2_inactive.png" noresource="spot2_noresource.png" preview="spot2_preview.png"/>
<image file="skov_house_800x600.png" id="skov_house_800x600.png"/>
<image active="smoke_active.png" id="smoke" inactive="smoke_inactive.png" noresource="smoke_noresource.png" preview="smoke_preview.png"/>
<image active="skotlamp_active.png" id="skotlamp" inactive="skotlamp_inactive.png" noresource="skotlamp_noresource.png" preview="skotlamp_preview.png"/>
<image active="sos_active.png" id="sos" inactive="sos_inactive.png" noresource="sos_noresource.png" preview="sos_preview.png"/>
<image active="spot_active.png" id="spot" inactive="spot_inactive.png" noresource="spot_noresource.png" preview="spot_preview.png"/>
<image active="led_green_active.png" id="led_green" inactive="led_green_inactive.png" noresource="led_green_noresource.png" preview="led_green_preview.png"/>
<image active="gas_active.png" id="gas" inactive="gas_inactive.png" noresource="gas_noresource.png" preview="gas_preview.png"/>
<image file="default_scene.gif" id="default"/>
<image active="led_red_active.png" id="led_red" inactive="led_red_inactive.png" noresource="led_red_noresource.png" preview="led_red_preview.png"/>
<image active="pendant_active.png" id="pendant" inactive="pendant_inactive.png" noresource="pendant_noresource.png" preview="pendant_preview.png"/>
<image active="bulb_active.png" id="bulb" inactive="bulb_inactive.png" noresource="bulb_noresource.png" preview="bulb_preview.png"/>
<image active="socket_active.png" id="socket" inactive="socket_inactive.png" noresource="socket_noresource.png" preview="socket_preview.png"/>
<image active="thief_active.png" id="thief" inactive="thief_inactive.png" noresource="thief_noresource.png" preview="thief_preview.png"/>
<image active="docklamp_active.png" id="docklamp" inactive="docklamp_inactive.png" noresource="docklamp_noresource.png" preview="docklamp_preview.png"/>
<image active="button1_active.png" id="button1" inactive="button1_inactive.png" noresource="button1_noresource.png" preview="button1_preview.png"/>
</images>
<scenes>
// For each "scene" THIS IS A NEW PAGE. attributes.name "PROVIDE SITE NAME //
<scene name="MinScene" type="pc">
<description>Af: Henrik Andersen</description>
// "imageref" OPLYSER HVILKEN BAGGRUND DER SKAL BRUGES PÃ… SIDEN //
// "Imageref" PROVIDE THE BACKGROUND TO BE USED ON SITE //
<imageref id="skov_house_800x600.png"/>
<sceneelements>
// FOR EACH "resourcebinaryelement" IS THERE A NEW IMAGE. "resourcebinaryelement" 'S attributes the X & Y coordinates OF injected. "imageref" SAY WHAT ONE OF PREVIOUS IMAGES TO BE USED //
<resourcebinaryelement name="SOFABORD" type="lightcontrol" x="330" y="117">
<description/>
<imageref id="pendant"/>
<format fontscaling="50" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<master resource_type="airlink_dimming" rid="5e55d"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Lys niveau" resource_type="airlink_dimming" rid="5e55d" type="setting"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="SPISEBORD" type="lightcontrol" x="530" y="220">
<description/>
<imageref id="pendant"/>
<format fontscaling="50" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<master resource_type="airlink_dimming" rid="5d65d"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Lys niveau" resource_type="airlink_dimming" rid="5d65d" type="setting"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="TV" type="lightcontrol" x="412" y="344">
<description>TV STIK</description>
<imageref id="socket"/>
<format fontscaling="50" imagescaling="50" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="4b5e"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Scenarier" resource_type="scenes" rid="4a54" type="setting"/>
<menuitem direct="no" name="Indgang for manuel KIP af udgang" resource_type="resource_input" rid="61511" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="HIFI OFF" invertstate="no" textposition="top" true="HIFI ON"/>
</resourcebinaryelement>
<resourcebinaryelement name="Gas" type="signal" x="500" y="360">
<description/>
<imageref id="gas"/>
<format fontscaling="50" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<gui>
<menuitems/>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="top" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="Røg" type="signal" x="550" y="360">
<description/>
<imageref id="smoke"/>
<format fontscaling="50" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<gui>
<menuitems/>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="top" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="Indbrud" type="signal" x="500" y="410">
<description/>
<imageref id="thief"/>
<format fontscaling="50" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<gui>
<menuitems/>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="top" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="Personalarm" type="signal" x="550" y="410">
<description/>
<imageref id="sos"/>
<format fontscaling="50" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<gui>
<menuitems/>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="top" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="Stikkontakt" type="lightcontrol" x="314" y="425">
<description/>
<imageref id="socket"/>
<format fontscaling="70" imagescaling="50" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="4e5e"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Indgang" resource_type="resource_input" rid="5ae11" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="Væg lampe" type="lightcontrol" x="407" y="575">
<description/>
<imageref id="skotlamp"/>
<format fontscaling="70" imagescaling="50" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="12d45b"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Kip" resource_type="resource_input" rid="12d811" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="Væg lampe" type="lightcontrol" x="84" y="575">
<description/>
<imageref id="skotlamp"/>
<format fontscaling="70" imagescaling="50" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="12d45b"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Kip" resource_type="resource_input" rid="12d811" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="DOCK lampe" type="lightcontrol" x="50" y="363">
<description/>
<imageref id="docklamp"/>
<format fontscaling="70" imagescaling="50" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="12d45b"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Kip" resource_type="resource_input" rid="12d811" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="DOCK lampe" type="lightcontrol" x="50" y="440">
<description/>
<imageref id="docklamp"/>
<format fontscaling="70" imagescaling="50" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="12d45b"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Kip" resource_type="resource_input" rid="12d811" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="Spot" type="lightcontrol" x="323" y="506">
<description/>
<imageref id="spot2"/>
<format fontscaling="70" imagescaling="100" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="10bf5b"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Kip" resource_type="resource_input" rid="10c311" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="Spot" type="lightcontrol" x="226" y="407">
<description/>
<imageref id="spot2"/>
<format fontscaling="70" imagescaling="100" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="10b65b"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Kip" resource_type="resource_input" rid="100d11" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="Spot" type="lightcontrol" x="153" y="315">
<description/>
<imageref id="spot2"/>
<format fontscaling="70" imagescaling="100" labelcolor="#000000" labelposition="top"/>
<gui>
<menuitems/>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="Spot" type="lightcontrol" x="342" y="429">
<description/>
<imageref id="spot2"/>
<format fontscaling="70" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="12255b"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Kip" resource_type="resource_input" rid="122911" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="LED" type="lightcontrol" x="412" y="403">
<description/>
<imageref id="spot2"/>
<format fontscaling="70" imagescaling="50" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="12255b"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Kip" resource_type="resource_input" rid="122911" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="SKOT lampe" type="lightcontrol" x="456" y="542">
<description/>
<imageref id="skotlamp"/>
<format fontscaling="70" imagescaling="50" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="12d45b"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Kip" resource_type="resource_input" rid="12d811" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="SKOT lampe" type="lightcontrol" x="172" y="525">
<description/>
<imageref id="skotlamp"/>
<format fontscaling="70" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="116e5b"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Kip" resource_type="resource_input" rid="117211" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
// "linkelement" ALMOST THE SAME AS "resourcebinaryelement" BUT THEY DO NOT MIX TOGETHER anyway / /
<linkelement name="Kælder etage" type="link" x="99" y="520">
<description/>
<imageref id="scenelink"/>
<format fontscaling="70" imagescaling="70" labelcolor="#00ffff" labelposition="top"/>
<link scene="Kælder"/>
</linkelement>
<resourcebinaryelement name="Postkasse" type="signal" x="500" y="460">
<description/>
<imageref id="mail"/>
<format fontscaling="70" imagescaling="70" labelcolor="#00ffff" labelposition="top"/>
<gui>
<menuitems/>
</gui>
<text colorfalse="#00ffff" colortrue="#00ffff" false="" invertstate="no" textposition="center" true="Der er post"/>
</resourcebinaryelement>
<resourcebinaryelement name="Spot" type="lightcontrol" x="140" y="116">
<description/>
<imageref id="spot"/>
<format fontscaling="100" imagescaling="100" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="14365b"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Kip" resource_type="resource_input" rid="143d11" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
</sceneelements>
</scene>
<scene name="Morten Skov" type="web">
<description>Af: Henrik Andersen</description>
<imageref id="skov_house_800x600.png"/>
<sceneelements>
<resourcebinaryelement name="Sofabord" type="lightcontrol" x="322" y="114">
<description/>
<imageref id="pendant"/>
<format fontscaling="50" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Scenarier" resource_type="scenes" rid="5054" type="setting"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="top" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="TV" type="lightcontrol" x="413" y="345">
<description>HIFI Kontakt</description>
<imageref id="socket"/>
<format fontscaling="50" imagescaling="50" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="4b5e"/>
<gui>
<menuitems/>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="HIFI OFF" invertstate="no" textposition="top" true="HIFI ON"/>
</resourcebinaryelement>
<resourcebinaryelement name="Spisebord" type="lightcontrol" x="513" y="218">
<description/>
<imageref id="pendant"/>
<format fontscaling="50" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Scenarier" resource_type="scenes" rid="5354" type="setting"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="top" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="Gas" type="signal" x="491" y="360">
<description/>
<imageref id="gas"/>
<format fontscaling="50" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<gui>
<menuitems/>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="top" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="Røg" type="signal" x="546" y="360">
<description/>
<imageref id="smoke"/>
<format fontscaling="50" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<gui>
<menuitems/>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="top" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="Indbrud" type="signal" x="499" y="407">
<description/>
<imageref id="thief"/>
<format fontscaling="50" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<gui>
<menuitems/>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="top" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="Personalarm" type="signal" x="548" y="409">
<description/>
<imageref id="sos"/>
<format fontscaling="50" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<gui>
<menuitems/>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="top" true=""/>
</resourcebinaryelement>
</sceneelements>
</scene>
<scene name="Kælder" type="pc">
<description>Kælder etage</description>
<imageref id="default"/>
<sceneelements>
<resourcebinaryelement name="Elektrisk pære" type="lightcontrol" x="155" y="118">
<description>Vaskerum</description>
<imageref id="bulb"/>
<format fontscaling="70" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="10005b"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Kip" resource_type="resource_input" rid="ea611" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="SKOT lampe" type="lightcontrol" x="154" y="319">
<description>Kontor</description>
<imageref id="skotlamp"/>
<format fontscaling="70" imagescaling="70" labelcolor="#000000" labelposition="top"/>
<master resource_type="resource_output" rid="ffd5b"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Kip" resource_type="resource_input" rid="f5211" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<linkelement name="Stue etage" type="link" x="69" y="407">
<description/>
<imageref id="scenelink"/>
<format fontscaling="70" imagescaling="70" labelcolor="#00ffff" labelposition="top"/>
<link scene="MinScene"/>
</linkelement>
</sceneelements>
</scene>
<scene name="Alarm" type="pc">
<description/>
<imageref id="default"/>
<sceneelements>
<resourcebinaryelement name="1" type="genericcontrol" x="79" y="61">
<description/>
<imageref id="button1"/>
<format fontscaling="70" imagescaling="100" labelcolor="#ffffff" labelposition="center"/>
<master resource_type="resource_input" rid="1bba5a"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Tryk Tast 1" resource_type="resource_input" rid="1bba5a" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="2" type="genericcontrol" x="121" y="61">
<description/>
<imageref id="button1"/>
<format fontscaling="70" imagescaling="100" labelcolor="#ffffff" labelposition="center"/>
<master resource_type="resource_input" rid="1bbb5a"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Tryk Tast 2" resource_type="resource_input" rid="1bbb5a" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="3" type="genericcontrol" x="80" y="103">
<description/>
<imageref id="button1"/>
<format fontscaling="70" imagescaling="100" labelcolor="#ffffff" labelposition="center"/>
<master resource_type="resource_input" rid="1bbc5a"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Tryk Tast 3" resource_type="resource_input" rid="1bbc5a" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="4" type="genericcontrol" x="123" y="103">
<description/>
<imageref id="button1"/>
<format fontscaling="70" imagescaling="100" labelcolor="#ffffff" labelposition="center"/>
<master resource_type="resource_input" rid="1bbd5a"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Tryk Tast 4" resource_type="resource_input" rid="1bbd5a" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="5" type="genericcontrol" x="81" y="144">
<description/>
<imageref id="button1"/>
<format fontscaling="70" imagescaling="100" labelcolor="#ffffff" labelposition="center"/>
<master resource_type="resource_input" rid="1bbe5a"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Tryk Tast 5" resource_type="resource_input" rid="1bbe5a" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="6" type="genericcontrol" x="123" y="143">
<description/>
<imageref id="button1"/>
<format fontscaling="70" imagescaling="100" labelcolor="#ffffff" labelposition="center"/>
<master resource_type="resource_input" rid="1bbf5a"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Tryk Tast 6" resource_type="resource_input" rid="1bbf5a" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="7" type="genericcontrol" x="82" y="186">
<description/>
<imageref id="button1"/>
<format fontscaling="70" imagescaling="100" labelcolor="#ffffff" labelposition="center"/>
<master resource_type="resource_input" rid="1bc05a"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Tryk Tast 7" resource_type="resource_input" rid="1bc05a" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="8" type="genericcontrol" x="124" y="185">
<description/>
<imageref id="button1"/>
<format fontscaling="70" imagescaling="100" labelcolor="#ffffff" labelposition="center"/>
<master resource_type="resource_input" rid="1bc15a"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Tryk Tast 8" resource_type="resource_input" rid="1bc15a" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="9" type="genericcontrol" x="83" y="226">
<description/>
<imageref id="button1"/>
<format fontscaling="70" imagescaling="100" labelcolor="#ffffff" labelposition="center"/>
<master resource_type="resource_input" rid="1bc25a"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Tryk Tast 9" resource_type="resource_input" rid="1bc25a" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="0" type="genericcontrol" x="125" y="225">
<description/>
<imageref id="button1"/>
<format fontscaling="70" imagescaling="100" labelcolor="#ffffff" labelposition="center"/>
<master resource_type="resource_input" rid="1bc35a"/>
<gui>
<menuitems>
<menuitem direct="yes" name="Tryk Tast 0" resource_type="resource_input" rid="1bc35a" type="follow"/>
</menuitems>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="" type="genericcontrol" x="130" y="31">
<description/>
<imageref id="led_green"/>
<format fontscaling="70" imagescaling="50" labelcolor="#ffffff" labelposition="center"/>
<master resource_type="resource_output" rid="1bc55b"/>
<gui>
<menuitems/>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
<resourcebinaryelement name="" type="genericcontrol" x="119" y="31">
<description/>
<imageref id="led_red"/>
<format fontscaling="70" imagescaling="50" labelcolor="#ffffff" labelposition="center"/>
<master resource_type="resource_output" rid="1bc45b"/>
<gui>
<menuitems/>
</gui>
<text colorfalse="#000000" colortrue="#ff0000" false="" invertstate="no" textposition="center" true=""/>
</resourcebinaryelement>
</sceneelements>
</scene>
</scenes>
<notifications/>
<emailcontrols/>
</icwproject>
Hope some one can help me.
sorry for the google translation.
Copy link to clipboard
Copied
I will concentrate on extracting an XML from a ZIP. (Please create a new thread if you want to know how to use your XML.)
I have this simple XML called "test.xml":
<?xml version="1.0" encoding="UTF-8"?>
<test>This is a text XML</test>
Then I zipped this up to create a ZIP file "test.xml.zip".
In order to read a ZIP you need a AS3 ZIP Library by David Chang:
http://nochump.com/blog/archives/15
Here's an example script:
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLRequest;
import flash.net.URLStream;
import flash.utils.ByteArray;
import nochump.util.zip.ZipEntry;
import nochump.util.zip.ZipFile;
public class ZipTest extends Sprite {
public function ZipTest():void {
init();
}
private function init():void {
var stream:URLStream = new URLStream();
stream.addEventListener(Event.COMPLETE, streamCompleted);
stream.load(new URLRequest("test.xml.zip"));
}
private function streamCompleted(e:Event):void {
var zip:ZipFile = new ZipFile(e.target as URLStream);
for(var i:uint = 0, zipEntryCount:uint = zip.entries.length; i < zipEntryCount; i++){
var entry:ZipEntry = zip.entries;
if(entry.name == "test.xml"){
var bytes:ByteArray = zip.getInput(entry);
trace(bytes);
}
}
}
}
}
Trace
<?xml version="1.0" encoding="UTF-8"?>
<test>This is a text XML</test>
--
Kenneth Kawamoto
Copy link to clipboard
Copied
Thanks for the response.
I get this error:
1037: Packages cannot be nested.
And i think i can handel some of the xml my self.
Copy link to clipboard
Copied
Sorry I should have stated but my example was meant to be a document class, not a timeline code.
--
Kenneth Kawamoto
Copy link to clipboard
Copied
Dont know what you mean.
Copy link to clipboard
Copied
A document class is an external class file represents the main timeline. You need to save the above code as a class and set it as document class in Flash.
Alternatively here's a "translated" timeline code:
import flash.events.Event;
import flash.net.URLRequest;
import flash.net.URLStream;
import flash.utils.ByteArray;
import nochump.util.zip.ZipEntry;
import nochump.util.zip.ZipFile;
init();
function init():void {
var stream:URLStream = new URLStream();
stream.addEventListener(Event.COMPLETE, streamCompleted);
stream.load(new URLRequest("test.xml.zip"));
}
function streamCompleted(e:Event):void {
var zip:ZipFile = new ZipFile(e.target as URLStream);
for (var i:uint = 0, zipEntryCount:uint = zip.entries.length; i < zipEntryCount; i++) {
var entry:ZipEntry = zip.entries;
if (entry.name == "test.xml") {
var bytes:ByteArray = zip.getInput(entry);
trace(bytes);
}
}
}
--
Kenneth Kawamoto
Copy link to clipboard
Copied
i have never tryed to make a class.
so have no idea how to do it.
Copy link to clipboard
Copied
i have used the code now witout error
but how to get the data out?
Copy link to clipboard
Copied
Did you get the xml traced out? If so to create an XML from a string you'd do:
new XML(xmlString);
--
Kenneth Kawamoto
Copy link to clipboard
Copied
i tryed to copy - paste what you posted and nothing happend.
Copy link to clipboard
Copied
I just tested it and works fine You should get errors if something is not right - did you set the error mode? If not do so in the "ActionScript Settings". Your FLA should not contain nothing but this script (for now). You also need the ZIP library - did you download it?
--
Kenneth Kawamoto
Copy link to clipboard
Copied
yes it is downloadet and past the code that you poasted.
But what do i need to output it in a "dynamic text box" or what?
Copy link to clipboard
Copied
Do you mean you want to display the XML in the TextField? Do you get the trace of your XML? If so just set the "text" property of your TextField to the string you get. If you are not getting the trace you need to fix that.
--
Kenneth Kawamoto
Copy link to clipboard
Copied
i can not se that eany thing is set as trace.
Copy link to clipboard
Copied
can you make a ready to use zip folder with "fla", "as" and "test.xml.zip"
So i can se what i do wrong
Copy link to clipboard
Copied
Yes of course I can do that - but I wonder if I can ZIP a ZIP file I have no time now so I will do it tomorrow but this will be just a FLA with the code above pasted....
One thing - did you set the path to the SWC in your Flash? But then if you didn't you should get errors saying it cannot import the classes - but you said no errors. Your responses really puzzle me
--
Kenneth Kawamoto
Copy link to clipboard
Copied
i can not use that fla file
I Use Adobe Flash CS3.
Copy link to clipboard
Copied
Sorry I don't have CS3 right now. Just copy the script above and paste in to frame 1 of empty FLA, that's all you need to do. I don't think you can use SWC in Flash CS3 though (IIRC). What you need to do is to download the source classes: nochump-ziplib-105-src.zip then place "nochump" folder next to your FLA.
--
Kenneth Kawamoto
Copy link to clipboard
Copied
And then i get this:
1084: Syntax error: expecting rightbrace before end of program.
Copy link to clipboard
Copied
Now i got it.
Copy link to clipboard
Copied
It was bacause my folder that i was zipping vas locked
How du i nowe input this:
myXML = new XML();
myXML.ignoreWhite = true;
myXML.load('xml.xml');
var map:Array = new Array();
myXML.onLoad = function() {
icon_dir = "icon/";
bg_dir = "skov/images/";
path1 = "/icwproject/scenes/sceneelements/resourcebinaryelement";
path = "/sceneelements/resourcebinaryelement";
aNode = mx.xpath.XPathAPI.selectNodeList(this.firstChild, path);
len = aNode.length;
for (var i=0; i<len; i++) {
obj = {}
obj.xpos = aNode.attributes.x;
obj.ypos = aNode.attributes.y;
obj.name_txt = aNode.attributes.name;
obj.type_txt = aNode.attributes.type;
map.push(obj);
dups(i);
}
};
function dups(i){
duplicateMovieClip(_root.button, "knop"+i, i+1000);
ref = _root["knop"+i];
ref._x = map.xpos;
ref._y = map.ypos;
trace(map.xpos);
trace(map.xpos);
trace(map.name_txt);
trace(map.type_txt);
};
Copy link to clipboard
Copied
Your code is in AS1/2 and you cannot mix it with AS3.
To work with AS3 XML, first of all you need to create an XML object from the string you extracted from the ZIP file - can you manage that?
--
Kenneth Kawamto
Copy link to clipboard
Copied
Then this one:
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("xml.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);
var xmlList:XMLList;
var dataLoader:Loader;
var totalThumbs:Number;
var getfirstItem:Number;
function processXML(event:Event):void
{
myXML = XML(event.target.data);
xmlList = myXML.children();
totalThumbs = xmlList.length();
trace (totalThumbs)
for(var i:int =0; i < xmlList.length(); i++)
{
dataLoader = new Loader();
dataLoader.load(new URLRequest(xmlList.filename));
trace (dataLoader);
dataLoader.x = xmlList.xCoordinate;
dataLoader.y = xmlList.yCoordinate;
addChild(dataLoader);
}
}
Copy link to clipboard
Copied
This is where your code is creating an XML object from URLLoader.data:
myXML = XML(event.target.data);
You will be using the ByteArray you extracted from the ZIP file instead:
...
var bytes:ByteArray = zip.getInput(entry);
myXML = XML(bytes.toString());
--
Kenneth Kawamoto
Copy link to clipboard
Copied
1151: A conflict exists with definition i in namespace internal.