+1
Respost

Is it possible to delete an object from an action?

Luska72 fa 11 anys updated by icahill (Administrator) fa 11 anys 1
Hello, I have been having issues with the function in rarewire. I am currently able to delete panels, but I cannot delete objects made from a class. Here is the code:

<wire>
<classes>
<class name="Row-Holder">
<panel name="Row1" width="104%" height="25%" ypos="3%">
<image name="Circle" source="images/Circle.png" xpos="4.25%"></image>
<image name="Face" source="images/Face.png" xpos="29.25%"></image>
<image name="Line" source="images/Line.png" xpos="54.25%"></image>
<image name="X" source="images/X.png" xpos="79.25%"></image>
</panel>
<panel name="Row2" width="104%" height="25%" ypos="28%">
<image name="Circle" source="images/Circle.png" xpos="4.25%"></image>
<image name="Face" source="images/Face.png" xpos="29.25%"></image>
<image name="Line" source="images/Line.png" xpos="54.25%"></image>
<image name="X" source="images/X.png" xpos="79.25%"></image>
</panel>
<panel name="Row3" width="104%" height="25%" ypos="53%">
<image name="Circle" source="images/Circle.png" xpos="4.25%"></image>
<image name="Face" source="images/Face.png" xpos="29.25%"></image>
<image name="Line" source="images/Line.png" xpos="54.25%"></image>
<image name="X" source="images/X.png" xpos="79.25%"></image>
</panel>
<panel name="Row4" width="104%" height="25%" ypos="78%">
<image name="Circle" source="images/Circle.png" xpos="4.25%"></image>
<image name="Face" source="images/Face.png" xpos="29.25%"></image>
<image name="Line" source="images/Line.png" xpos="54.25%"></image>
<image name="X" source="images/X.png" xpos="79.25%"></image>
</panel>
</class>
</classes>
<main>
<panel name="background" alias="BACKGROUND" width="100%" height="100%" align="center" background="#ffffff">
<!--Top part that says "partcipating restaurants" -->
<panel name="Restaurants" alias="RESTAURANTS" width="100%" height="25%" align="center">
<text name="Restaurant_Text" width="100%" height="100%" alignment="center" font="helvetica" size="50" color="#000000" text="Participating Restaurants"></text>
</panel>
<!-- Help button for sending more resturants to C3 data base -->
<panel name="Help" alias="HELP" width="50%" height="25%" align="center" ypos="85%" onclickup="SendRestaurant">
<image name="HelpButton" source="images/Add_Button.png" width="100%" height="100%" alignment="center"></image>
</panel>
<panel name="Holder" alias="HOLDER" width="50%" height="50%" align="center" valign="center" background="#1b1632" alpha=".75" onswipeleft="Change-Page">
<object class="Row-Holder" name="picture" alias="PICTURE"></object>
</panel>
</panel>
</main>
<actions>
<action name="SendRestaurant">
<alert title="MyAlter" message="Click"></alert>
</action>
<action name="Change-Page">
<delete target="PICTURES"></delete>
<delete target="HELP"></delete>
<alert title="SWIPE" message="You SWIPED ME"></alert>
</action>
</actions>
</wire>

The class that the object is being created from is "Row-Holder" and is the child of a panel that has an "onswipeleft" action that calls "Change-Page" and from there it deletes the object, and one panel.
Thank you for your help,
Ryan
An object tag is merely a representation of what is in your class, therefore you would never be deleting it. You can however delete your class. In your specific example above, you would need to wrap the contents of the class in a panel and assign it the alias of PICTURE. This should delete the entire contents of the class from your action.

You can't assign an alias to an object tag, only from within the class.