Skip to main content
Known Participant
October 8, 2009
Answered

Flash and XML help : (

  • October 8, 2009
  • 1 reply
  • 2450 views

Hi all

bit of a newbie, so probably quite easy if you know how:eek:

would anyone beable to help with sorting out an XML file, what I have is a tooltip that loads in via XML and exported from flash. the XML loads in 2 text fields,  field and field2.

what I am trying to do is add a button also to the tooltip so that you can click and go to a url.

would anyone beable to help with this.

this is what I have in my XML file;

<?xml version="1.0" encoding="utf-8"?>
<data>
    <image name="image 1" path="img/img1.jpg"
    title="Food Fight"
    text="Information here!" />

</data>

this loads in 2 text fields.

this is what I have in my AS;

              var tooltip:ToolTip = new ToolTip();
      //tooltip.buttonMode = false; 
                tooltip.field.text = titles;//loads tooltip 1
                tooltip.field2.text = texts;//loads tool tip 2
                holder.addChild(tooltip);

I thought I could do something like this but I seem to be getting errors

XML


<?xml version="1.0" encoding="utf-8"?>
<data>
    <image name="image 1" path="img/img1.jpg"
    title="Food Fight"
    text="Information here!"
             button="click to view/>

</data>

and in my AS

var tooltip:ToolTip = new ToolTip();
                //tooltip.buttonMode = false; 
                tooltip.field.text = titles;//loads tooltip 1
                tooltip.field2.text = texts;//loads tool tip 2
                tooltip.field3.text = buttons;//loads tool tip 3
                holder.addChild(tooltip);


but just not working, what am I doing wrong:yikes:

many thanks for any help!

This topic has been closed for replies.
Correct answer

Hi

I modified your code.

See attachment.

Saransoft


Hi

Here is the code:

var imageName:String = images.@name;

var imagePath:String = images.@path;

var titles:String = images.@title;

var texts:String = images.@text;

var movies:String = images.@swf; // added 24 Aug-09

var buttons:String = images.@button;

var tooltip:ToolTip = new ToolTip();

tooltip.field.text = titles;  //loads tooltip 1

tooltip.field2.text = texts;  //loads tool tip 2

tooltip.field3.text = buttons;

Dont forget to embed the font for the field3.text

Saransoft

1 reply

October 8, 2009

Hi,

U miss the " at last

Try this:

<?xml version="1.0" encoding="utf-8"?>
<data>
    <image name="image 1" path="img/img1.jpg"
    title="Food Fight"
    text="Information here!"
             button="click to view" />

</data>

Saransoft

Known Participant
October 8, 2009

hi there

thanks for the reply  : )

sorry that was a typo, looked at that but, I still get problems : (

October 8, 2009

Hi,

Is it possible to send me the link for my reference to identify.

Saransoft