..:: MX Studio Fóruns ::..: Link em galeria XML. - ..:: MX Studio Fóruns ::..

Jump to content

Publicidade




ATENÇÃO

Para evitar posts desnecessários e que não influam para o andamento e desenvolvimento do fórum, clique aqui e leia todas as regras.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Link em galeria XML. como por link para as fotos ampliar?

#1 User is offline   luizcastelli 

  • Group: Membros
  • Posts: 54
  • Joined: 22-September 05

  Posted 11 May 2009 - 03:38 PM

olá, não estou conseguindo por link nas fotos da galeria para ampliar


NO FLASH
QUOTE
images_xml = new XML();
images_xml.onLoad = startImageViewer;
images_xml.load("xml/images.xml");
images_xml.ignoreWhite = true;
//
// Show the first image and intialize variables
function startImageViewer(success) {
if (success == true) {
rootNode = images_xml.firstChild;
// 'totalImages' is the variable name set to correspond with the the dynamic text instance of 'totalImages'
totalImages = rootNode.childNodes.length;
// [ totalImages = rootNode.childNodes.length; ] gets the total number of childNodes (total number of image and text files) in your .xml document
firstImageNode = rootNode.firstChild;
currentImageNode = firstImageNode;
// 'currentIndex' is the variable name set to correspond with the dynamic text instance of 'currentIndex'
currentIndex = 1;
// [ currentIndex = 1; ] sets the viewer to play the first childNode (first image and text file) in your .xml document
updateImage(firstImageNode);
}
}
//
// Updates the current image with new image and text
function updateImage(newImageNode) {
// 'imagePath' is the variable name set to correspond with the .jpeg file name located in your .xml document
imagePath = newImageNode.attributes.jpegURL;
// 'imageText' is the variable name for the instance 'textArea'
imageText = newImageNode.firstChild.nodeValue;
// 'targetClip' is the instance name for the movie clip 'imageArea', this is where all your image files from your .xml document are loaded
targetClip.loadMovie(imagePath);
// IMPORTANT : RESCALING THE SIZE OF THE 'imageArea' MOVIE CLIP WILL AFFECT THE ORIGNAL SIZE OF WHATEVER IMAGE YOU HAVE IN YOUR IMAGES FOLDER
}
//
/* Event handlers for 'Next image' and 'Previous image' buttons.
These statements allows flash to advance or go back to the next childNode
(next image and text) in your .xml document.

The Property (.nextSibling;) evaluates the XML object and references the next sibling
in the parent node's child list. This method returns null if the node does not
have a next sibling node. This is a read-only property and cannot be used to
manipulate child nodes.
*/
next_btn.onRelease = function() {
nextImageNode = currentImageNode.nextSibling;
if (nextImageNode == null) {
break;
} else {
currentIndex++;
updateImage(nextImageNode);
currentImageNode = nextImageNode;
}
};
//
// Event handler for 'Previous image' button
back_btn.onRelease = function() {
previousImageNode = currentImageNode.previousSibling;
if (previousImageNode == null) {
break;
} else {
currentIndex--;
currentImageNode = previousImageNode;
updateImage(previousImageNode);
}
};



NO XML
QUOTE
<IMAGES>
<imageNode jpegURL="images/image1.jpg">Rapidly develop rich Internet applications with approachable, integrated tools that leverage leading web server technologies and device platforms.</imageNode>


<imageNode jpegURL="images/image2.jpg">Dreamweaver MX
Build websites and web applications.</imageNode>

<imageNode jpegURL="images/image3.jpg" link="images/image1.jpg">Macromedia Flash MX
Create rich Internet content and applications.</imageNode>

<imageNode jpegURL="images/image4.jpg">ColdFusion MX
Rapidly build and deploy Internet applications.</imageNode>

<imageNode jpegURL="images/image5.jpg">Fireworks MX
Design and optimize interactive web graphics.</imageNode>

<imageNode jpegURL="images/image6.jpg">FreeHand 10
Create vector-based illustrations for Macromedia Flash and for print.</imageNode>

<imageNode jpegURL="images/image7.jpg">Director 8.5 Shockwave Studio
Develop magnetic Internet destinations and powerful multimedia.</imageNode>

<imageNode jpegURL="images/image8.jpg">JRun 4
The fast, affordable, and reliable J2EE server.</imageNode>

<imageNode jpegURL="images/image9.jpg">Authorware 6.5
Create rich-media e-learning applications with a drag-and-drop visual interface.</imageNode>

</IMAGES>



quem puder ajudar agradeço! alegre.gif
0

#2 User is offline   Natan 

  • Group: Moderador Global
  • Posts: 7350
  • Joined: 28-February 04

Posted 11 May 2009 - 10:49 PM

Que link? Não tem nenhum link no XML.

[]s
0

#3 User is offline   luizcastelli 

  • Group: Membros
  • Posts: 54
  • Joined: 22-September 05

Posted 12 May 2009 - 03:46 AM

bom, eu não tenho muito conhecimento em flash, mas fiz isso abaixo.

imageLink = newImageNode.firstChild.link; (não tem no inicio do topico pq não funcionou, por isso tirei)

e no xml coloquei

<imageNode jpegURL="images/image2.jpg" link="images/large_images2.jpg">
0

#4 User is offline   Natan 

  • Group: Moderador Global
  • Posts: 7350
  • Joined: 28-February 04

Posted 12 May 2009 - 06:35 PM

Você pode criar um botão com instancia de btURL. E deixe suas ações assim:

CÓDIGO
images_xml = new XML();
images_xml.onLoad = startImageViewer;
images_xml.load("xml/images.xml");
images_xml.ignoreWhite = true;
//
// Show the first image and intialize variables
function startImageViewer(success) {
if (success == true) {
rootNode = images_xml.firstChild;
// 'totalImages' is the variable name set to correspond with the the dynamic text instance of 'totalImages'
totalImages = rootNode.childNodes.length;
// [ totalImages = rootNode.childNodes.length; ] gets the total number of childNodes (total number of image and text files) in your .xml document
firstImageNode = rootNode.firstChild;
currentImageNode = firstImageNode;
// 'currentIndex' is the variable name set to correspond with the dynamic text instance of 'currentIndex'
currentIndex = 1;
// [ currentIndex = 1; ] sets the viewer to play the first childNode (first image and text file) in your .xml document
updateImage(firstImageNode);
}
}
//
// Updates the current image with new image and text
function updateImage(newImageNode) {
// 'imagePath' is the variable name set to correspond with the .jpeg file name located in your .xml document
imagePath = newImageNode.attributes.jpegURL;
// 'urlPath' é o nó que contém o link da imagem
urlPath = newImageNode.attributes.link;
// 'imageText' is the variable name for the instance 'textArea'
imageText = newImageNode.firstChild.nodeValue;
// 'targetClip' is the instance name for the movie clip 'imageArea', this is where all your image files from your .xml document are loaded
targetClip.loadMovie(imagePath);
// IMPORTANT : RESCALING THE SIZE OF THE 'imageArea' MOVIE CLIP WILL AFFECT THE ORIGNAL SIZE OF WHATEVER IMAGE YOU HAVE IN YOUR IMAGES FOLDER
}
//
/* Event handlers for 'Next image' and 'Previous image' buttons.
These statements allows flash to advance or go back to the next childNode
(next image and text) in your .xml document.

The Property (.nextSibling;) evaluates the XML object and references the next sibling
in the parent node's child list. This method returns null if the node does not
have a next sibling node. This is a read-only property and cannot be used to
manipulate child nodes.
*/
next_btn.onRelease = function() {
nextImageNode = currentImageNode.nextSibling;
if (nextImageNode == null) {
break;
} else {
currentIndex++;
updateImage(nextImageNode);
currentImageNode = nextImageNode;
}
};
//
// Event handler for 'Previous image' button
back_btn.onRelease = function() {
previousImageNode = currentImageNode.previousSibling;
if (previousImageNode == null) {
break;
} else {
currentIndex--;
currentImageNode = previousImageNode;
updateImage(previousImageNode);
}
};
btURL.onPress = function() {
   getURL(currentImageNode.attributes.url);
};


[]s
0

#5 User is offline   luizcastelli 

  • Group: Membros
  • Posts: 54
  • Joined: 22-September 05

  Posted 19 May 2009 - 04:36 PM

ok, colei o code no lugar do outro (no flash)


e no xml coloquei assim

CÓDIGO
<imageNode jpegURL="imagem_menor.jpg" link="imagem_maior.jpg">empresa</imageNode>


acredito que seja isso, certo? mas não deu certo, só vejo o jpegURL e o link não fica ativo. =\
0

#6 User is offline   Natan 

  • Group: Moderador Global
  • Posts: 7350
  • Joined: 28-February 04

Posted 23 May 2009 - 04:49 PM

Troque essa linha:

CÓDIGO
getURL(currentImageNode.attributes.url);


Por essa:

CÓDIGO
getURL(currentImageNode.attributes.link);


Veja se com isso funciona.

[]s
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic



Publicidade




1 User(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)