A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: How to use use URL from XML

  1. #1
    Junior Member
    Join Date
    Jan 2006
    Location
    Lithuania
    Posts
    12

    How to use use URL from XML

    I know that there was a lot of similar post, but i am not good in scripting so maybe some one will help me.
    i want to add a link on the sub menu and menu buttons and i want to change a color of the text
    thats it.
    please take a look
    Attached Files Attached Files

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    Flash 8 only here ...... cannot open your Flash 9 file

    PLEASE...specify your version when posting

  3. #3
    Junior Member
    Join Date
    Jan 2006
    Location
    Lithuania
    Posts
    12
    Ups ... sorry ... now i attached v.8
    maybe now someone can help me?
    PLEASE!
    Attached Files Attached Files

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    adding the links is easy -

    itemMc["sub"+j].link = this.firstChild.childNodes[i].childNodes[j].attributes.data;

    activating them will require you to contact the author (email in file) for details
    on how to implement the data into the Class

    /*don't hesitate to contact me at dbk@latosensu.com if you need help or anything else
    have fun
    dbk*/

  5. #5
    Junior Member
    Join Date
    Jan 2006
    Location
    Lithuania
    Posts
    12
    the authors emails is not working - thats a problem
    so its is not possible to add links without autors help?
    where exactly i should put this - itemMc["sub"+j].link = this.firstChild.childNodes[i].childNodes[j].attributes.data; ?

  6. #6
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    where exactly i should put this - itemMc["sub"+j].link = this.firstChild.childNodes[i].childNodes[j].attributes.data; ?

    on the line after -

    itemMc["sub"+j].toto = this.firstChild.childNodes[i].childNodes[j].attributes.label;

    where did you find the fla file ? what url ?

  7. #7
    Junior Member
    Join Date
    Jan 2006
    Location
    Lithuania
    Posts
    12
    i have taken it from http://www.flashkit.com/movies/Inter...9210/index.php

    Now i have this. should it work now?

    menuClass.prototype = new MovieClip();
    function menuClass(){
    this = _root.attachMovie("menu","menu",0);
    this._visible = false;
    this._data = new XML();
    this._data._parent = this;
    this._data.ignoreWhite = true;;
    this._data.load("menu.xml");
    this._data.onLoad = parseMenu;
    this.init();
    }

    Object.registerClass("menu",menuClass);

    parseMenu = function(){
    nbChilds = this.firstChild.childNodes.length;
    //for(var i=0;i<nbChilds+1;i++){
    for(var i in this.firstChild.childNodes){
    temp = new itemClass();
    temp.init(i);
    itemMc = temp.mc;
    itemMc._y = 20*i;
    itemMc.park = 20*i;
    itemMc.label = this.firstChild.childNodes[i].attributes.label;

    for(var j=0;j<this.firstChild.childNodes[i].childNodes.length;j++){
    itemMc.attachMovie("sub","sub"+j,10*j);
    itemMc["sub"+j]._y = 20 + 20*j;
    itemMc["sub"+j].toto = this.firstChild.childNodes[i].childNodes[j].attributes.label;
    itemMc["sub"+j].link = this.firstChild.childNodes[i].childNodes[j].attributes.data;
    }
    itemMc.distance = j*20;
    }
    var temp = new itemClass();
    temp.init(this.firstChild.childNodes.length);
    var itemMc = temp.mc;
    itemMc._y = 20*this.firstChild.childNodes.length;
    itemMc.park = 20*this.firstChild.childNodes.length;
    this._parent._visible = true;
    }

    menuClass.prototype.init = function(){
    this.attachMovie("mask","mask",500);
    with(this.mask){
    _y = -1
    _height = _root.menu.item9._y;
    _width = 574;
    }
    this.createEmptyMovieClip("topEdge",203);
    this.setMask(this.mask)
    }

    menuClass.prototype.onEnterFrame = function(){
    this.mask._height = this.item9._y+2;
    //this.createEmptyMovieClip("leftEdge",400);

    }

    myMenu = new menuClass();

  8. #8
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    Now i have this. should it work now?

    i tried for a while and gave up.

    i believe the itemClass events over ride any attempts
    to add an onRelease event to the sub-menus.

    i will take a fresh look in a few days time when i'm free.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center