Click to See Complete Forum and Search --> : Link Flash button with XML


cher1402
06-05-2008, 07:21 AM
Hi there, please assist me, i have created a flash banner for a radio station. I want to know what code i should use in flash for the action script and the buttons which are 5 in total: show, dj1, dj2, studioCam, listenLive. Please also assist me with the code for the XML file and the HTML file. Desperate and Urgent.

Eye for Video
06-05-2008, 10:02 PM
Hello,
Well it seems like you have a pretty big project on your plate if you don’t understand how to handle some of those basic things. Generally you’ll get more response out of the group if you have part of the project completed and are having problems finishing it.
Let me help you get started on the list of requests.
First stick your banner in a <div> set to the size of the banner. I recommend you use SWFObject to create alternate content and also write (via JavaScript) the Flash .swf file into the <div>.
http://www.adobe.com/devnet/flash/articles/swfobject.html
Second, if you have created Flash buttons and need ActionScript to make them work, it will depend on a couple of things. I take it that the site is HTML and not Flash, correct. Then the action the button will need to do is load a different HTML page, correct? Depending on with version of ActionScript you are using you will need a get URL(); (for AS2) or … well AS3 is a bit more complicated.
As far as the xml part goes, I’m not really sure why or what you are doing with that. I have used xml to populate the captions on buttons but I don’t know what you have in mind.
Check out this site:
http://www.lostmountainsurfcompany.com/crew_page.html
Hover over the “Video Clip” buttons. While there is some AS to make the surfboard draw back, the AS to get the selected clip is:
getURL("http://www.lostmountainsurfcompany.com/video_library/vid_clip_7.html");
These buttons also include text which comes in from an xml file. But I’m not sure you need that yet.
Do a “view source code” to see how the buttons have both a jpeg and anchor version (the swfobject alternate content) for viewers without Flash, and an animated Flash button:
var so = new SWFObject("video_library/vid_clip_buttons/vid_btn_5.swf", "vid_btn_5", "330", "35", "8", "#4796d2");
Some good tutorials are available at:
www.gotoandlearn.com

Best wishes.
Eye for Video
www.cidigitalmedia.com

cher1402
06-06-2008, 03:15 AM
Hi there,

Thank you for your response. I am not completely starting from scratch. I wanted to control my flash buttons from outside flash and i did this by using a txt file. Everything worked fine but my problem came in when i was told by the developement team that my txt file solution was not working properly with the Vignette CMS. The txt file had to sit in the same folder has the swf file and somehow when uploading with the Vignette's CMS the files doesn't get put together. I was told that i needed to pass some variable that embedded the txt file into the HTML. I was not sure how to do this so i thought maybe an xml solution will work better, hence my attempt to start over again. If you can help me with my txt solution then i wont need to start over with XML.

I am using flash CS3. This is my code so far.

Flash Timeline
loadVariables("bannerUrl.txt",_root);

Flash button (VukaMzansi)
on (release)
{
//Goto Webpage Behavior
getURL(VukaMzansi,"_top");
//End Behavior
}

bannerUrl.txt
&VukaMzansi=http://wip.dataworld.co.za/ukhoziFM_new/onAir/LindaSbonga_aboutShow.html&

My HTML file:
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
'width', '980',
'height', '152',
'src', 'banner02_monFri_6.30-9.00',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'banner02_monFri_6.30-9.00',
'bgcolor', '#ffffff',
'name', 'banner02_monFri_6.30-9.00',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'banner02_monFri_6.30-9.00',
'salign', ''
); //end AC code
}
</script>

My swf banner is called: 'banner02_monFri_6.30-9.00.swf

This is the site on which my banner is set up: http://wip.dataworld.co.za/ukhozifm_new/

I hope i make some sense, otherwise i can zip my work and send it through. I am so desperate to sort this out, please assist me.

Thanks.

Eye for Video
06-06-2008, 10:01 AM
Not sure if this will help but have you tried playing with different addresses for the .txt file. It may only need to be in the same folder if the path says it is… so change the path to the correct location.
Flash Timeline
loadVariables("bannerUrl.txt",_root);
changes to
Flash Timeline
loadVariables("other folder/bannerUrl.txt",_root);
or whatever the correct path is.
Maybe a second option is to ftp the text file straight into the folder you need and not use the CMS for the upload.
Other than that…I’m out of ideas.
Best wishes,
Eye for Video
www.cidigitalmedia.com