begin process at 2010 03 20 10:54:40
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Flash / Flash MX

 > 

Base de données

 > 

XML

 > 

probleme de photo et galerie


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

probleme de photo et galerie

vendredi 4 juillet 2008 à 21:07:34 | probleme de photo et galerie

phania

Bonjour je voudrais seulement que sur un click que l'image pop up ou de quoi semblable pour voir l'image en plus gros

Le problème que j'ai est que si je change les dimensions de l'image elle est répéter à plusieurs endroit et elle devient plus grande partout.

Voici le code il se connecte à un fichier xml ;

Code de la page de produit ::

flashblocks.Flashblocks.gate.StoreFull = this
this._visible = false


function init (item) {

this._visible = true
this._alpha=0
this.alphaTo(100,2)

//flashblocks.Flashblocks.TraceObject(item)

// media
pic1.init(item.media.pic1)
pic2.init(item.media.pic2)
pic3.init(item.media.pic3)
pic4.init(item.media.pic4)
pic5.init(item.media.pic5)
pic6.init(item.media.pic6)

// video
vid.contentPath = item.media.video

// price
price.anima.txt.text = '$'+item.price

// title
//title.autoSize="left"
title.text = item.title.txt

// leading
//leading.autoSize="left"
description.displayHtml (item.description.txt.split('\r\n').join('\n'))
//description.

// file
file.onRelease = function () {
_root.getURL(item.files.file1,"_blank")
}


}

code de l'affichage d'une photo :: dans ce clip j'aimerais pouvoir faire une fonction qui sur clic la meme photo apparaît plus grose.

var fbListen = {}
var dif:Number = 0

var name
var extention
var resizeName
var image:String

var width = _width
var height = _height
_xscale = _yscale = 100

init()

function init (image) {


if (!image) {
// check all parent movie clips for the string image and use this string for the thumbnail
var mc:MovieClip = this
while (!image and mc) {
image = mc.image
mc = mc._parent
}
}

name = image.substring(image.lastIndexOf("/")+1, image.lastIndexOf("."))
extention = image.substr(image.lastIndexOf("."))
resizeName = name+"_"+width+"x"+height+extention

bg._width = width
bg._height = height

destroyObject("mb");
this.createClassObject(flashblocks.Mediablock, "mb", 1, {
_width:width+dif,
_height:height+dif,
media_crop:true,
media_scale:true,
sourceFile:image,
resizeName:resizeName});

// complete EVENT
mb.addEventListener("complete", fbListen);
mb.addEventListener("error", fbListen);

}

//fbListen.complete = function(obj:Object){ // {type, target}
// var w = obj.target.content._width
// var h = obj.target.content._height
//}


// if (w!=width or h!=height) {
// //obj.target.setSize(w,h)
//
// width=w
// height=h
// init(image,num)
// }


// This was a hack in order to force the image to resize if there is a problem.
//fbListen.error = function(obj:Object){ // {type, target}
// trace("error")
// // dif=1
// // init ()
//}


ce code c'est quand je modifie la grosseur de l'image ben celle-ci grossit et je veux pas :

// [ Lien ]

// item item padding. try other variables:
// var padding = -150
// var paddingBottom = 100
var padding = 10
var paddingBottom = 30

var x = this._x
var xStart = this._x
var yStart = this._y
var xmlObj:Object
var total=0
var xmlObj = flashblocks.Flashblocks.XmlToObj()


// arrow movie clips can be set here
var arrowL:MovieClip = flashblocks.Flashblocks.gate.arrowLeft
var arrowR:MovieClip = flashblocks.Flashblocks.gate.arrowRight
//arrowL.alpha = 0
//arrowR.alpha = 0


// remove place holder
boundingBox._visible = false
boundingBox._xscale = 0
boundingBox._yscale = 0



// editblockFunction is called be every movie clip that has an Editblock attached.

function editblockFunction (obj) {


var file:String

// Get file from text input
if (obj.data.textInput[0].theContent) file = obj.data.textInput[0].theContent
// Or selected file
else file = obj.data.selectFile[0].src

// set editblockHeader to item file name, from here, rather then from editblock component inspector.
if (file) obj.target.editblockHeader = file



// create Editors for this Editblock instance:
//
// fileTree configuration
//
// dir = "flashblocks/data/xml/" - this is the Directory to look for XML files with the fileBrowser.swf when selecting a file
// showExtentions = "xml" - display file types in file browser - "jpg|jpeg|gif|png|swf|bmp"
// dialogWinExtension = "*.xml;" - display file types when uploading - "*.jpg;*.jpeg;*.gif;*.png;*.swf;*.bmp;"

obj.target.editors = {
//textInput:[{caption:"Enter XML Feed"}],
selectFile: [{caption:"Select XML File",
editorObject:{
dir:"flashblocks/data/xml/",
showExtentions:"xml|php",
dialogWinExtension:"*.xml;"} }],
XMLeditor:[{
caption:"Edit XML File",
editorObject:{
file:file,
dir:"flashblocks/data/images/",
showExtentions:"",
dialogWinExtension:"*"} }] }

loaditems(file)

}

// As an example, I have converted the Flashblocks News Module, in the demo site.
// Essentially you can now specify Editor configuration data from the Editblock instance editors object (obj.target.editors).
// For example, the editblockFunction could now look something like this:
//
//function editblockFunction (obj) {
//
// // retrieve stored url
// var newsFile = obj.data.selectFile[0].src
//
// obj.target.editors = {
// XMLeditor1:[{ mirrorEditor:"XMLeditor", caption:"Edit Quotes", editorObject:{file:"flashblocks/data/xml/quotes.xml"} }],
// XMLeditor2:[{ mirrorEditor:"XMLeditor", caption:"Edit MP3s", editorObject:{file:"flashblocks/data/xml/mp3Player.xml"} }],
// XMLeditor3:[{ mirrorEditor:"XMLeditor", caption:"Edit selected file", editorObject:{file:newsFile} }],
// selectFile:[{ caption:"Select XML File", editorObject:{dir:"flashblocks/data/", showExtentions:"xml", dialogWinExtension:"*.xml;"} }]
// }
//}


function loaditems (file) {

trace("file:"+file)

if (flashblocks.Flashblocks.http) file += "?="+Math.random()

xmlObj = {}
xmlObj = flashblocks.Flashblocks.XmlToObj() //new com.flashblocks.util.XMLtoOBJ()//
xmlObj.arrays = true
xmlObj.toOBJ = xmlObj
xmlObj.ignoreFirstChild = true
xmlObj.nodeTag = "txt"
xmlObj.addEventListener("onLoad", this);
xmlObj.loadXML (file)
}


// XmlToObj - must recompile Flashblocks Component



function onLoad (evt) {
var mc:MovieClip
var item:Object
var h = 0
var pos:Number = 0
//trace(flashblocks.Flashblocks.TraceObject(xmlObj))
if (xmlObj.channel) {

removeItems() // remove old item items from screen

if (xmlObj.channel.item.length) item = xmlObj.channel.item
else item = xmlObj.channel.item = [xmlObj.channel.item] // if not array { make array

total = item.length

boundingBox._xscale = 100
boundingBox._yscale = 100

//flashblocks.Flashblocks.TraceObject(item)

for (var i=0; i < total; i++) {

mc = boundingBox.duplicateMovieClip("item"+i, i+1)
mc.num = i

// pic
mc.pic.image = item[i].media.pic1

// price
mc.price.text = '$'+item[i].price

// title
//mc.title.autoSize="left"
mc.title.text = item[i].title.txt

// leading
//mc.leading.autoSize="left"
mc.leading.text = item[i].leading.txt.split('\r\n').join('\n')

// bg
//mc.bg._height = mc.description._y+mc.description._height+(paddingBottom)+150

mc.bg.onRelease = function () {
flashblocks.Flashblocks.gate.StoreFull.init(item[this._parent.num])
//moveR()
//if (total == this._parent.num+1) moveStart()
}
mc.bg.onRollOver = function () {
moveUp(this._parent)
}
mc.bg.onRollOut = function () {
moveDown(this._parent)
}
mc.bg.onRollOut()

mc._x = pos
pos += mc._width+padding
}

boundingBox._xscale = 0
boundingBox._yscale = 0

_x = -_width
moveStart()
this.tween("_y", yStart, 0)
arrowDraw ()
}
}

function removeItems () {
var i = 0
while(this["item"+i]) {
this["item"+i].removeMovieClip()
i++
}
}
function moveUp (mc) {
mc.alphaTo(100,1,null,0)
//mc.tween("_y", -mc._height+220,.5)
}

function moveDown (mc) {
mc.alphaTo(70,1)
//mc.tween("_y", 0,1)
}


function moveStart () {
x = xStart
this.tween("_x",x, 1)
arrowDraw()
}

function moveR () {
if (moreR()) {
x -= item0.bg._width+padding
this.tween("_x", x, 2)
}
arrowDraw()
}

function moveL () {
if (moreL()) {
x += item0.bg._width+padding
this.tween("_x", x, 2)
}
arrowDraw()
}

function moreR ():Boolean {
if (x > -(_width-(500))) return true // 870
else return false
}

function moreL ():Boolean {
if (x < xStart) return true
else return false
}





// ARROWS

function arrowDraw () {
if (moreR()) {
arrowR.alphaTo(100,1)
arrowR.onPress = function () {
moveR();
moveR();
}
}
else {
delete arrowR.onPress
arrowR.alphaTo(0,1)
}

if (moreL()) {
arrowL.alphaTo(100,1)
arrowL.onPress = function () {
moveL()
moveL()
}
}
else {
delete arrowL.onPress
arrowL.alphaTo(0,1)
}
}


Cette discussion est classée dans : file, var, item, mc, flashblocks


Répondre à ce message

Sujets en rapport avec ce message

mc_clip.duplicateMovieClip ???? ehehh [ par mica1 ] Hoïbon ma question est simplej'aimerais duplikatouiller une clipouille mais bon le ptit problème c'est que ce petit clipouille contient des champs de Pb de chargement swf externe [ par praganelli ] Bonjour, voila j'ai un  petit pb avec le script 16971, qui est une galerie photo tout en ActionScript, superbe d'ailleurs.. J'ai un scenario principal Dupliquer MC sur 2 colonnes ? [ par badoux ] Bonjour, Je souhaiterai dupliquer mes mc su deux colonnes, pour ça j'ai fais ce script ci-dessous qui fonctionne très bien, jusqu'au moment de lui di référence à array ? [ par benfox ] Salut.ça y'est je crois bien que j'ai réussi à obtenir ce que je voulais... je me suis battuPas évident pour un novice comme moi.Bon, du coup je n'arr Pb Effet sur Boutons [ par TikoMoon ] Débutant dans Flash, je rencontre un problème dans ma création de Bouton.Il s'agit de boutons animés (Clip) avec Un Bouton transparent pour créer mes affiche_photos aléatoirement [ par kartoon ] Bonjour,Voilà j'ai un code qui va chercher des photos dans un fichier nommé "images" dans lequel se trouve 11 photos au format jpg, et qui pioche les ScrollPane : problème [ par soulwax ] Et bien voila le problème : Je suis en train de faire un inventaire pour un jeu d'aventure. Le principe est de drag dropper des items à l'interieur de Color.setTransform + fondu ?? [ par phildrink ] Bonjour,J'aimerai ajouter un fondu pour passer en douceur un mc d'une couleur à une autre (tel quel c'est direct) :var my_color:Color = new Color(mon_ [jeu] Problème d'attachMovie [ par Gizmil ] Salut à tous,   En ce moment, je crée le moteur d'un petit jeu à l'aide de mes modestes connaissances et je rencontre un problème qui semble être un p Assigner une image dynamique à un clip [ par Vano05 ] Bonjour à tous ! J'ai un petit probleme tout bete, mais qui me rend fou !Je voudrais adapter le code suivant pour assigner des positions bie


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mars 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728
293031    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,562 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales