begin process at 2008 08 21 23:11:56
1 229 693 membres
501 nouveaux aujourd'hui
14 266 membres club

Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum.
Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

Sujet : probleme de photo et galerie [ Base de données / XML ] (phania)

probleme de photo et galerie le 04/07/2008 21:07:34

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)
}
}


Classé sous : file, var, item, mc, flashblocks

Participer à cet échange

Pub



Appels d'offres

CalendriCode

Août 2008
LMMJVSD
    123
45678910
11121314151617
18192021222324
25262728293031

Téléchargements

Logiciels à télécharger sur le même thème :

Boutique

Boutique de goodies CodeS-SourceS