Ciao a tutti!
Il menù fighissimo che potete vedere in questo link
flashden.net/item/xml-team-menu/3356
carica dei clip filmato "dude" identificati anche con la proprietà di concatenamento, identificatore "dude1", "dude2", "dude3", ecc...
Caricati grazie alle action script contenenti in un clip (che non contiene grafica, solo azioni), che poi è il menù. E grazie ai comandi del file "menu.xml".
Il problema è che si aprono dei link ad altre pagine, ma per migliorare la navigazione del sito, interamente in flash, occorre che i** pulsanti (dude) si aprano delle scene all'interno dell'swf**.
é possibile, combiando dei comandi???
Il problema è che le sagome del menù (dude) vengono caricate grazie al file .xml
Queste le azioni del clip filmato menu:
// Importing the transition class
import mx.transitions.*;
import mx.transitions.easing.*;
easeSpeed = 3; // set the ease sensetivity
MovieClip.prototype.elasticScale = function(toSize) {
easeType = mx.transitions.easing.Regular.easeInOut;
myTween = new Tween(this, "_yscale", easeType, this._yscale, toSize, easeSpeed);
myTween = new Tween(this, "_xscale", easeType, this._xscale, toSize, easeSpeed);
};
// Here the array object is created.
var rubrieken:Array = new Array();
// Here the XML object is created.
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(success) {
// De data from the xml is loaded into flash
// Using a 'for' loop the data is placed inside the array
if (success) {
menuItems = this.firstChild;
for (i=0; i<menuItems.childNodes.length; i++) {
rubriek = menuItems.childNodes*;
rubrieken.push(rubriek);
}
}
// As soon as the data is loaded int the array the function below will be executed
attachMenu();
};
myXML.load("menu.xml");
// This function attaches the people figures to the stage with the right data
function attachMenu() {
// This margin variable sets the space on the right and the left. roght now 80px;
margin = (Stage.width-680)/rubrieken.length;
for (i=0; i<rubrieken.length; i++) {
loadDude = rubrieken*.attributes.dude;
var menuItems = peopleHolder.attachMovie(loadDude, "dude"+i, 10000+i);
menuItems._x = menuItems._x+(margin)*i;
// This inline fuction executes the proximity function onEnterFrame
menuItems.onEnterFrame = function() {
proximity(this);
};
menuItems._href = rubrieken*.attributes.href;
menuItems.idText = rubrieken*.attributes.dudesname;
menuItems.knopTekst.text = rubrieken*.attributes.naam;
// The events when you roll over the button
menuItems.onRollOver = function() {
this.swapDepths(10000+i);
// makes the tooltip appear
this.nameTip._alpha = 100;
// Out the name from the xml inside the tooltip
this.nameTip.idTag.text = this.idText;
};
menuItems.onRollOut = function() {
// makes the tooltip disappear
this.nameTip._alpha = 0;
};
menuItems.onRelease = function() {
getURL(this._href, "_self");
};
}
}
// This here is the function that calculates the size of each item depending on the proximity of the mouse position
// You could play a little with these number but it is kinda tricky.
function proximity(clip) {
var x:Number = peopleHolder._xmouse;
var y:Number = peopleHolder._ymouse;
var cx:Number = clip._x;
var cy:Number = clip._y-clip._height/2;
var prox:Number = Math.sqrt((x-cx)*(x-cx)+(y-cy)*(y-cy));
// if the mouse is closer to the object than 100px it increases its size
if (prox<100) {
clipx = 300-prox*2;
clip.elasticScale(clipx);
// if the mouse is futher away than 100 it keeps it original size
} else {
clipx = 100;
clip.elasticScale(clipx);
}
}
```**Questo il contenuto del file "menu.xml":**
[html]<?xml version="1.0" encoding="iso-8859-1"?>
<rubriekenxml>
<project dude="dude0" dudesname="Sam" href="...link..."/>
<project dude="dude1" dudesname="Richard" href="...link..."/>
<project dude="dude2" dudesname="John" href="...link..."/>
<project dude="dude3" dudesname="Curtis" href="...link..."/>
<project dude="dude4" dudesname="Charles" href="...link..."/>
<project dude="dude5" dudesname="Otis" href="...link..."/>
<project dude="dude6" dudesname="Benny" href="...link..."/>
<project dude="dude7" dudesname="Ray" href="...link..."/>
<project dude="dude8" dudesname="Billy" href="...link..."/>
<project dude="dude9" dudesname="Paul" href="...link..."/>
</rubriekenxml>[/html]
Chi ha qualche idea/soluzione...???