Help... link URL from XML to Flash Action Script 2

I am trying to link a different URL to each of my files in XML and use this XML in Flash were I created a carousel. In the carousel, when you click on a picture I would like to insert a specific URL. Each picture will have a different URL (http://------------).
Here are my codes:
XML:
<icons>
<icon image="icon1.png" tooltip="Planning" />
<icon image="icon2.png" tooltip="Investments" />
<icon image="icon3.png" tooltip="Education" />
<icon image="icon4.png" tooltip="Insurances" />
<icon image="icon5.png" tooltip="Mortgages" />
<icon image="icon6.png" tooltip="Retirement" />
<icon image="icon7.png" tooltip="Business Owner" />
<icon image="icon8.png" tooltip="Banking" />
</icons>
Flash Action Script 2:
import mx.utils.Delegate;
var numOfItems:Number;
var radiusX:Number = 250;
var radiusY:Number = 75;
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/2;
var speed:Number = 0.01;
var perspective:Number = 60;
var home:MovieClip = this;
var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
tooltip._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
  var t = home.attachMovie("item","item"+i,i+1);
  t.angle = i * ((Math.PI*2)/numOfItems);
  t.onEnterFrame = mover;
  t.toolText = nodes[i].attributes.tooltip;
  t.icon.inner.loadMovie(nodes[i].attributes.image);
  t.ref.inner.loadMovie(nodes[i].attributes.image);
  t.icon.onRollOver = over;
  t.icon.onRollOut = out;
  t.icon.onRelease = released;
function over()
home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
home.tooltip._alpha = 100;
function out()
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
function released()
function moveTip()
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
xml.load("icons.xml");
function mover ()
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = (this._y - perspective) / (centerY+radiusY-perspective);
this._xscale = this._yscale = s * 100
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
this.onMouseMove = function()
speed = (this._xmouse-centerX)/10000;
Thanks so much for the help.

You should be able to add that data into your xml tags and then extract it in the AS2 onLoad function...
XML:
<icons>
<icon image="icon1.png" tooltip="Planning" linkURL="http://www.someURL.com/somePage.html" />
AS2:
xml.onLoad = function()
etc....
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.urlLink = nodes[i].attributes.linkURL;
etc...

Similar Messages

  • Send data from html to flash action script

    Hi,
    I would like my flash to act differently depending on what
    html page it is on. Can I send information from html code to action
    script?

    Hi,
    Yes you can, by using FLASHVARS. Refer the attached code for
    example. Also you can use Javascript setVariable method of Flash
    object to set values in between i.e. after the page has loaded, as
    in case of FLASHVARS these are sent to flash just at the begining
    i.e. once SWF loads. In the attached exmple i've sent 2 variables
    to Flash one is 'username' and other is 'userId', thse will be
    fetched inside flash movie as _root.username and _root.userId.
    Note: I've added flashvars as PARAM and also as an attribute
    for EMBED tag (used by Mozilla, NS etc)
    Hope this helps.
    Thanks,
    Sumeet

  • If I set Firefox as my default web browser, the help links on Adobe Dreamweaver and Flash's welcome screens don't connect to the help pages on Adobe's site. It just links to Firefox's start page and stops. The links work properly if Safari is set to the d

    If I set Firefox as my default web browser, the help links on Adobe Dreamweaver and Flash's welcome screens don't connect to the help pages on Adobe's site. It just links to Firefox's start page and stops. The links work properly if Safari is set to the default browser. Please help.
    == URL of affected sites ==
    http://www.adobe.com

    Hello,
    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • Can access c++ library from flash action script by using SWC lib?

    We want to develope a Flash application based on Windows CE 6.0 R3. The application aims to communicate with middleware libraries written in C/C++. Is it possible to create SWC file using the c++ library file so that we can load this as a component in fla project for accessing the library functions from flash action script 3.0? OR Is there any simple way to access c++ library from action script?
    Thanks,
    Saumini

    I don't think Alchemy will help you.  The reason is Alchemy does not give socket capabilities beyond what Flash provides.

  • Hide webpage link URL from browser status bar?

    Anyone know how to hide webpage link URL from the browser
    status bar with Dreamweaver CS4? So that when the mouse cursor
    hovers over a link on a webpage, the URL won't be shown in the
    browser status bar. This comes in useful for when I put my email as
    a link on a webpage but I don't want to let my email address be
    known prematurely. I prefer to do this through the Dreamweaver CS4
    interface without coding, if possible. What is the easiest way to
    hide link URL like this? Thanks.

    More than the anal users. Many people use this information to
    decide
    whether they will click on the link. By hiding it, you remove
    that
    extremely valuable security information - for example, a link
    tells you on
    the screen that it is taking you to www.wachovia.com, but the
    status bar
    link tells you it's taking you to
    www.iamahackersiteandwilldrinkyourmilkshake.cn
    I don't think you want to remove that from your site, unless,
    of course, you
    are the webmaster for
    'iamahackersiteandwilldrinkyourmilkshake.cn....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "joeq" <[email protected]> wrote in message
    news:gib1tf$kn7$[email protected]..
    > it can be done - Behaviors > Set Text > Set Text
    of Status Bar.
    >
    > do what you want, but know that it's somewhat unreliable
    (see the caveat
    > in
    > the DW Behavior box) and that some anal users will
    object to the masking
    > of
    > your links.
    >
    >
    >
    quote:
    Originally posted by:
    ghost zero
    > Anyone know how to hide webpage link URL from the
    browser status bar with
    > Dreamweaver CS4? So that when the mouse cursor hovers
    over a link on a
    > webpage, the URL won't be shown in the browser status
    bar. This comes in
    > useful for when I put my email as a link on a webpage
    but I don't want to
    > let
    > my email address be known prematurely. I prefer to do
    this through the
    > Dreamweaver CS4 interface without coding, if possible.
    What is the
    > easiest way
    > to hide link URL like this? Thanks.
    >
    >
    >

  • How do you auto reconnect a live video stream broadcast in flash action script 3?

    how do you auto reconnect a live video stream broadcast in flash action script 3?
    so i don't have to ask people to refresh the page if the connection drops
    i copy pasted the live video stream broadcast files and script from here;
    http://www.adobe.com/devnet/adobe-media-server/articles/beginner_live_fms3.html
    http://www.adobe.com/content/dotcom/en/devnet/adobe-media-
    server/articles/beginner_live_fms3/_jcr_content/articlePrerequistes/multiplefiles
    /node_1278314297096/file.res/beginner_live_fms3.zip
    i don't know what i'm doing

    Why don't you use several layers with appropriate alpha properties, and move these layers according to the mouse events?

  • Video bookmark (videomark) using flash/action script?

    Video bookmark is called videomark.
    Anybody did videomark using flash?.
    Is there any good place, i can learn more about videomark in
    flash?.

    yeah..........
    Can I have a small example on this ... so that it would be very easy for me to understand....
    I am a new bee in flash action scripting......
    Thanks & Regards

  • Flv xml Stream Playlist action script help

    So if you go to this site:
    click here
    you will see a FLV player that has a list of videos that are
    pulled from a .xml file...
    The action script for this player is as such:
    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    theVideo.attachVideo(ns);
    rewindButton.onRelease = function() {
    ns.seek(0);
    playButton.onRelease = function() {
    ns.pause();
    var videoInterval = setInterval(videoStatus,100);
    var amountLoaded:Number;
    var duration:Number;
    ns["onMetaData"] = function(obj) {
    duration = obj.duration;
    function videoStatus() {
    amountLoaded = ns.bytesLoaded / ns.bytesTotal;
    loader.loadBar._width = amountLoaded * 194.5;
    loader.scrub._x = ns.time / duration * 194.5;
    var vlist:XML = new XML();
    vlist.ignoreWhite = true;
    vlist.onLoad = function() {
    var videos:Array = this.firstChild.childNodes;
    for(i=0;i<videos.length;i++) {
    videoList.addItem(videos
    .attributes.desc,videos.attributes.url);
    ns.play(videoList.getItemAt(0).data);
    videoList.selectedIndex = 0;
    var vidList:Object = new Object();
    vidList.change = function() {
    ns.play(videoList.getItemAt(videoList.selectedIndex).data);
    videoList.addEventListener("change",vidList);
    vlist.load("videos.xml");
    I want to action script something that will make the videos
    play one after the other, get rid of the list on the right and have
    buttons on player that allow you to go to the next/previous video
    listed in the .xml file
    Its sort of like the player at
    click
    here
    I know this is a lot to ask, but I am currently in a jam and
    any help would be greatly appreciated...
    Thanks
    Matthelm88

    gotoAndLearn is a fantastic base to build off of.
    but
    i'm looking for the same thing... how do you get the files
    to play one after another?
    i've looked for everyhting ns. related and i can find any
    doc's on this one.
    i 've found the
    function complete_listener(eventObject:VideoEvent):void {
    if (my_FLVPlybk.source == "rentv1.flv") {
    my_FLVPlybk.play("rentv2.flv");
    else if (my_FLVPlybk.source == "rentv2.flv") {
    my_FLVPlybk.play("rentv3.flv");
    on the flash video live docs.. but i can't find anything on
    how to tie it into the XML.
    anything anyone can offer would be a huge help ...

  • Loading URL from XML?

    I have a movie clip in rectangle shape and need add link to that from XML.
    How can I do that?
    this my code
    AS Code:var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.load(new URLRequest("linkNewD2.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, displayHTML);
    function displayHTML(e:Event):void {
                    var xmlData:XML = new XML(e.target.data);
                    var tURL:String = xmlData.Header1.option;
                    targetURL(tURL);
    function targetURL(event:String):void
    var valURL:String = event;
    myMc1.addEventListener(MouseEvent.CLICK, gotoHome);
    function gotoHome(evt:MouseEvent):void
                    var myURL:URLRequest = new URLRequest(URL(valURL));
                    navigateToURL(myURL);
    XML Code:
    <data>
    <Header1>
    <option> http://www.google.com </option>
    </Header1>
    </data>
    Please help me!
    Thanks,
    jafy

    First, never use nested functions - they bring in a lot of troubles.
    Try this code (there are better ways but just to follow your initial approach). This code assumes that myMC1 is MovieClip:
    var xmlLoader:URLLoader = new URLLoader();
    // listeners should be added BEFORE load() is called
    xmlLoader.addEventListener(Event.COMPLETE, displayHTML);
    xmlLoader.load(new URLRequest("linkNewD2.xml"));
    function displayHTML(e:Event):void {
         var xmlData:XML = new XML(e.target.data);
         targetURL(xmlData.Header1.option);
    function targetURL(url:String):void
         myMc1.url = url;
         myMc1.addEventListener(MouseEvent.CLICK, gotoHome);
    function gotoHome(e:MouseEvent):void
         navigateToURL(new URLRequest(MovieClip(e.currentTarget).url));

  • Flash Action Script

    I have 3 problems on action script on the following :
    a) I have two instances on the stage. I want to link these 2
    instances by drawing a line by clicking the mouse and drag from
    one instance to another.
    b) I have 2 instances A & B on the stage. I want to drag
    instance A and place it on instance B, Instance A is unmovable
    after
    placing on instance B.
    c) I have an instance on stage which is made visible = false
    on load. onRelease of button this instance is visible = true. I go
    to next frame, then I go back to previous frame, the
    instance become visible = false again. How does the action Script
    like by
    letting the instance visible = true when I go to previous
    frame.
    By dafei

    Flash CS3 works with events.
    To handle clicks you have to capture the click event
    To load a link you have navigateToURL:
    http://livedocs.adobe.com/flex/2/langref/flash/net/package.html#navigateToURL()

  • New to flash / action script 3

    hi guys,
    got sick of playing flash games and want to learn to create.
    i downloaded a gif of sub zero from mortal kombat...the gif has all the frames for each action like jumping / punching etc.
    i have imported it into flash and i have organised the key frames so when i press enter it looks pretty smooth.
    will i be able to control it like this with keyboard using action script? or do i have to convert it to a vector graphic?
    or is this just not possible.
    can anybody please recommend me a good flash/as3 book to read please...i know there are lots...
    thanks
    jonininireland

    imm for an easy gif control try to import it as a movie clip , Gif images must be framed inside your - character Movie clip -
    try to learn about cross images technique for animating chracters.
    of course u'll be able to control game by keyboard ha ! .
    see:http://as3gamedev.blogspot.com/
    Read :Essential Guide to Flash Games
    try:Develop Flash Games
    Good luck
    Mhood

  • Captivate 8 - module FLASH - Action Script

    Bonjour,
    J'utilise Captive 8 pour créer des modules de formation e-learning.
    Le problème est que ma société ne peut pas passer à IE11 pour afficher les modules en HTML5.
    Pour pouvoir créer des modules, il faut que la publication en SWF se fasse avec Action Script 2 et Captivate 8 utilise Action Script3 que mon module de compilation (obligatoire de passer par là) ne gère pas.
    Y a-t-il une solution ?
    Merci de m'aider.

    Bonjour,
    merci de votre réponse et voici donc un descriptif complet de mon "problème".
    1) j'utilise Captivate8 AS3 pour générer des modules en SWF et en HTML5.
    2) j'utilise un outil spécifique MyRenda du Cerfi ensuite pour compiler mon module afin de l'insérer dans MyTeacher (CERFI)
    3) MyRenda compile avec ISPRING qui ne gère pas AS3 pour créer des modules en FLASH
    Vu que ma société utilise encore la version de IE8 pour le portail applicatif (impératif pour des raisons applicatifs métiers), je ne peux pas générer des SWF et vu que IE8 ne supporte pas le HTML5, je ne peux pas publier mes modules de formations.
    Ma question :
    Est-il possible de modifier AS3 en AS2 pour Captivate8 ? ou est-il possible d'obtenir une version antérieure de Captivate qui utilise encore AS2 ?
    En espérant avoir été claire, je reste à disposition.

  • Need help with Link passed from XML

    This is to create a flash driven navigation menu. What I have
    is a coldfusion page that serves a simple XML formatted page. There
    are 3 XML components, linkLabel, linkURL and linkType. The label
    just passes text, the type is just a number 0-9 that is used to
    determine the style of the button. The linkURL that is passed from
    coldfusion comes across encoded for XML, so what I end up with is
    url's that replace "&" with ";amp;".
    So my question is this, is there an easy way in the
    actionscript to replace the ";amp;" with "&"? Other than that
    little problem, the rest of the script runs just fine, I just can't
    seem to find the syntax I'm looking for to replace items in a
    string. I saw the code for replacesel() but this doesn't seem to do
    it, unless i'm writing it wrong.

    Just in case you want something similar in future:
    string = string.split("&amp;").join("&");
    is an easy way to replace something in a string (here
    '&amp;' gets replaced with '&').
    greets,
    blemmo

  • Flash Action Script 3 is giving me 1120 error help please!

    I am having trouble coding this tutorial. I have changed it a little to fit my photos. I am getting this error 1120 below:
    Scene 1, Layer 'actions', Frame 1, Line 1    1120: Access of undefined property btn1.
    Scene 1, Layer 'actions', Frame 1, Line 2    1120: Access of undefined property btn2.
    Scene 1, Layer 'actions', Frame 1, Line 3    1120: Access of undefined property btn3.
    Scene 1, Layer 'actions', Frame 1, Line 4    1120: Access of undefined property btn4.
    I don't really understand the coding and need help fixing this problem. I believe their code is wrong because my gallery will not work from the tutorial.
    The code I have is below:
    stop(); btn1.addEventListener(MouseEvent.CLICK,play1); function play1(event:MouseEvent):void{ gotoAndStop ("rosie") }
      btn2.addEventListener(MouseEvent.CLICK,play2); function play2(event:MouseEvent):void{ gotoAndStop ("mel") }
      btn3.addEventListener(MouseEvent.CLICK,play3); function play3(event:MouseEvent):void{ gotoAndStop ("liz") }
      btn4.addEventListener(MouseEvent.CLICK,play4); function play4(event:MouseEvent):void{ gotoAndStop("kayla") } ;
    The code that was given to me is below: (Source:How to create a simple image gallery in flash cs5) :
      stop(); btn1.addEventListener(MouseEvent.CLICK,play1); function play1(event:MouseEvent):void{ gotoAndStop ("young") } btn2.addEventListener(MouseEvent.CLICK,play2); function play2(event:MouseEvent):void{ gotoAndStop ("thoughtful") } btn3.addEventListener(MouseEvent.CLICK,play3); function play3(event:MouseEvent):void{ gotoAndStop ("dancing") } btn4.addEventListener(MouseEvent.CLICK,play4); function play4(event:MouseEvent):void{ gotoAndStop ("old") }
    Can anyone help me with this tutorial or coding! That would be great. Thanks!!

    Flash CS3 works with events.
    To handle clicks you have to capture the click event
    To load a link you have navigateToURL:
    http://livedocs.adobe.com/flex/2/langref/flash/net/package.html#navigateToURL()

  • Web.xml - can't get the url from xml file..

    Hi all,
    Im a beginner @ jsp =)
    My question is as follow..I cant get base from the web.xml file.
    This is a shorten version of my web.xml..
    <web-app>
         <welcome-file-list>
    <welcome-file>Default.jsp</welcome-file>
    </welcome-file-list>
         <!-- Define the controller servlet -->
         <servlet>
              <servlet-name>ControllerServlet</servlet-name>
              <servlet-class>ControllerServlet</servlet-class>
              <!-- Define initial parameters that will be loaded into
              the ServletContext object in the controller servlet -->
         <init-param>
                   <param-name>base</param-name>
                   <param-value>http://localhost:8080/burnaby/ControllerServlet</param-value>
              </init-param>
    </servlet>
         <servlet-mapping>
    <servlet-name>ControllerServlet</servlet-name>
    <url-pattern>/ControllerServlet</url-pattern>
    </servlet-mapping>
    </web-app>
    And my jsp file:
    <%
         String base = (String) application.getAttribute("base");
         String imageUrl = (String) application.getAttribute("imageUrl");
    %>
    <table width="740" cellpading="0" height="75" cellspacing="0" border="0">
         <tr>
              <td align="left" bgcolor="#F6F6F6">
                   <font face="Verdana" size="3">Sky's E-mall!</font>
              </td>
              <td align="right" bgcolor="#F6F6F6">
                   <a href="<%=base%>?action=displayShoppingCart"><img border="0" src="<%=(imageUrl + "cart.gif" )%>"></a>
                   ���
              </td>
         </tr>
    </table>
    I have written it of a book im reading and i cant get it to work. Base and imageUrl always become null.
    thank you
    /Robert

    I'm a little new to JSPs and servlets too, but I'll give this one a shot. I think since your variables like 'base' are servlet initial parameters, they don't get initialized until you actually call the servlet ( I'm not 100% on this, though). Try calling the servlet and having it forward the response back to your original JSP and see if you get values then.

Maybe you are looking for

  • Any hints of how to exclude these lines from the following BEx output?

    Hi, I have a BEx report which outputs the following shipment activities, showing Doc and Items numbers, Requested and Received dates, actual and PO quantities. DocNoItmNoReqDate-RcvdDate-PO_Qty-Act_Qty---TB% 1101-----5--12/10/05-12/5/05020-- 80 1101-

  • Creation of Variant BOM using Simple BOM

    Hi I am havign a production BOM, i wanted to create Variant BOM using Production BOM. Pls let me know, whether we have any Function modules for the same. Regards MD

  • Validation Restricting Entry to One Cost Object

    I am trying to create a validation in GGBO to restrict postings of Vendor Invoices (KR doc type) and journal entries (SA doc type) to only one cost object (cost center, internal order or WBS element) on expense account lines.  I understand standard f

  • 2.2 and factory reset - fixed issues, and battery is much better

    I am not sure this will help all users with little quirks going on or not, but I had lagging issues, and quirks myself.  Decided to do the factory reset, and re-set up my phone and what a difference.  My web is faster, battery seems to get much more

  • Video scene markers not detected by DVD or computer

    I have burnt an autoplay DVD with elements 2 which combines video and still images. I put scene markers at each video cut and on each still image but when burnt neither DVD or computer detects them and I so I cannot flick between scenes. What might b