mediengestalter.info
FAQ :: Mitgliederliste :: MGi Team

Willkommen auf dem Portal für Mediengestalter

Aktuelles Datum und Uhrzeit: Fr 29.03.2024 00:50 Benutzername: Passwort: Auto-Login

Thema: Brauche Hilfe bei flash/xml/html problem vom 10.03.2011


Neues Thema eröffnen   Neue Antwort erstellen MGi Foren-Übersicht -> Multimedia -> Brauche Hilfe bei flash/xml/html problem
Autor Nachricht
RobinJJJ
Threadersteller

Dabei seit: 15.05.2010
Ort: Berlin
Alter: -
Geschlecht: Männlich
Verfasst Do 10.03.2011 23:20
Titel

Brauche Hilfe bei flash/xml/html problem

Antworten mit Zitat Zum Seitenanfang

hi leute,

bin grad an ner seite für nen künstler. hab mir nen image-slider zusammengebastelt der die bilder aus einer xml-datei erst preloaded und anzeigt. in der xml-datei ist im image-knoten ein title-attribut. Der titel wird im txt-feld vom preloader vom full_image angezeigt.
Meine Frage ist, wie kann ich den title-attribut als html auslesen? Hab schon alle möglichen CDATA varianten und as2 auslesemöglichkeiten die ich kenne ausprobiert. google natürlich auch. ich bekomm einfach das title attribut nicht richtig angesprochen. es geht los bei der function(callFullImage), bei der im preloader das my_txt feld erstellt wird. aber erst mal das script:

AS2 ohne meine html versuche:
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;


var myGalleryXML = new XML();
myGalleryXML.ignoreWhite = true;
myGalleryXML.load("gallery.xml");

myGalleryXML.onLoad = function() {

_root.gallery_x = myGalleryXML.firstChild.attributes.gallery_x;
_root.gallery_y = myGalleryXML.firstChild.attributes.gallery_y;
_root.gallery_width = myGalleryXML.firstChild.attributes.gallery_width;
_root.gallery_height = myGalleryXML.firstChild.attributes.gallery_height;

_root.myImages = myGalleryXML.firstChild.childNodes;
_root.myImagesTotal = myImages.length;

_root.thumb_height = myGalleryXML.firstChild.attributes.thumb_height;
_root.thumb_width = myGalleryXML.firstChild.attributes.thumb_width;

_root.full_x = myGalleryXML.firstChild.attributes.full_x;
_root.full_y = myGalleryXML.firstChild.attributes.full_y;

callThumbs();
createMask();
scrolling();

};

function callThumbs() {

_root.createEmptyMovieClip("container_mc",_root.getNextHighestDepth());
container_mc._x = _root.gallery_x;
container_mc._y = _root.gallery_y;

var clipLoader = new MovieClipLoader();
var preloader = new Object();
clipLoader.addListener(preloader);

for (i=0; i<_root.myImagesTotal; i++) {
thumbURL = myImages[i].attributes.thumb_url;

myThumb_mc = container_mc.createEmptyMovieClip(i, container_mc.getNextHighestDepth() );
myThumb_mc._x = _root.thumb_width*i;
clipLoader.loadClip("thumbs/"+thumbURL,myThumb_mc);

preloader.onLoadStart = function(target) {
target.createTextField("my_txt",target.getNextHighestDepth(),0,0,100,20);
target.my_txt.selectable = false;
};

preloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
};

preloader.onLoadComplete=function(target){   
new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
target.my_txt.removeTextField();
target.onRelease=function(){
callFullImage(this._name);

}

target.onRollOver=function(){
new Tween(target, "_alpha", Strong.easeOut, 100, 50, 1, true);
};

target.onRollOut=function(){
new Tween(target, "_alpha", Strong.easeOut, 50, 100, 1, true);
};

}
}
}

function callFullImage(myNumber) {

myURL = myImages[myNumber].attributes.full_url;
myTitle = myImages[myNumber].attributes.title;

_root.createEmptyMovieClip("fullImage_mc",_root.getNextHighestDepth());
fullImage_mc._x = _root.full_x;
fullImage_mc._y = _root.full_y;

var fullClipLoader = new MovieClipLoader();
var fullPreloader = new Object();
fullClipLoader.addListener(fullPreloader);

var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "helvetica";
my_fmt.size = 18;
my_fmt.color = 0xffffff;



fullPreloader.onLoadStart = function(target) {
target.createTextField("my_txt",target.getNextHighestDepth(),10,10,300,260);
target.my_txt.selectable = false;
target.my_txt.background = false;
target.my_txt.backgroundColor = 0x222222;
target.my_txt.border = false;
target.my_txt.multiline = true;
target.my_txt.wordWrap = true;

target.my_txt.setNewTextFormat(my_fmt);

};

fullPreloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
};

fullPreloader.onLoadComplete = function(target) {
new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
target.my_txt.text = myTitle;
};

fullClipLoader.loadClip("full_images/"+myURL,fullImage_mc);

this.close_btn.onRelease = function() {
 removeMovieClip(this._parent.fullImage_mc);
};



}


function createMask() {

_root.createEmptyMovieClip("mask_mc",_root.getNextHighestDepth());

mask_mc._x = _root.gallery_x;
mask_mc._y = _root.gallery_y;

mask_mc.beginFill(0x000000,100);
mask_mc.lineTo(_root.gallery_width,0);
mask_mc.lineTo(_root.gallery_width,_root.gallery_height);
mask_mc.lineTo(0,_root.gallery_height);
mask_mc.lineTo(0,0);

container_mc.setMask(mask_mc);

}

function scrolling() {
_root.onEnterFrame = function() {
if (mask_mc._xmouse<(mask_mc._width*(1/3)) || mask_mc._xmouse>(mask_mc._width*(2/3))) {
container_mc._x += Math.cos(((mask_mc._xmouse)/mask_mc._width)*Math.PI)*15;

if (container_mc._x>mask_mc._x) {
container_mc._x = mask_mc._x;
}

if (container_mc._x<(mask_mc._x-(container_mc._width-mask_mc._width))) {
container_mc._x = mask_mc._x-(container_mc._width-mask_mc._width);
}
}
};
}


und der XML-code auch ohne html
Code:
<gallery thumb_width="105" thumb_height="150" gallery_width="1000" gallery_height="150" gallery_x="0" gallery_y="275"
full_x="0" full_y="0">
   <image thumb_url="thumb01.jpg" full_url="01.png" title="Mango Juice" />
   <image thumb_url="thumb02.jpg" full_url="02.png" title="Cherry Seven Up" />
   <image thumb_url="thumb03.jpg" full_url="03.png" title="Strawberry Juice, and other stuff is not to complain about" />
   <image thumb_url="thumb04.jpg" full_url="04.png" title="Rice and Chicken" />
   <image thumb_url="thumb05.jpg" full_url="05.png" title="Mixed Capsicum" />
   <image thumb_url="thumb06.jpg" full_url="06.png" title="Roma at Barbera Cafe" />
   <image thumb_url="thumb07.jpg" full_url="07.png" title="Orange Juice" />
   <image thumb_url="thumb08.jpg" full_url="08.png" title="Fries in Salalah" />
   <image thumb_url="thumb09.jpg" full_url="09.png" title="Chicken Tacos" />
   <image thumb_url="thumb10.jpg" full_url="10.png" title="Club Sandwiches" />
</gallery>


wär echt nett wenn ihr mir weiterhelfen könntet.

Gruß, Robin.


Zuletzt bearbeitet von RobinJJJ am Do 10.03.2011 23:23, insgesamt 1-mal bearbeitet
  View user's profile Private Nachricht senden
phihochzwei
Moderator

Dabei seit: 08.06.2006
Ort: Mülheim an der Ruhr
Alter: 46
Geschlecht: Männlich
Verfasst Fr 11.03.2011 05:02
Titel

Antworten mit Zitat Zum Seitenanfang

A) Was in der XML muss denn als HTML dargestellt werden ?
B) CDATA war schon richtig.
C) Denk dran, dass du dem Textfeld sagen muss, dass es HTML kann (.html = true) und das Du den Ttext auch als HTML zuweist (.htmlText = "sdfsifj"),
  View user's profile Private Nachricht senden Website dieses Benutzers besuchen
Anzeige
Anzeige
 
Ähnliche Themen Flash - Html - problem
Problem mit Flash in Kombi mit html
problem mit flash/html menü
FLASH und XML mit HTML-TAGS PROBLEM
Layer Problem in HTML (Java und Flash)
HTML und Flash - Problem beim Laden der Seite
Neues Thema eröffnen   Neue Antwort erstellen
MGi Foren-Übersicht -> Multimedia


Du kannst keine Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum nicht antworten.
Du kannst an Umfragen in diesem Forum nicht mitmachen.