Jagged images on xml gallery
http://codadesign.net/newsite/design.html
The images on both the thumbs and the final seem jagged. Any idea why?
use a complete listener, cast your content as a bitmap and assign its smoothing property to true:
var l:Loader=new Loader();
l.contentLoaderInfo.addEventListener(Event.COMPLETE,f);
l.load(new URLRequestion(yourbitmap));
function f(e:Event):void{
Bitmap(l.content).smoothing=true;
Similar Messages
-
Can't load images for photo gallery
Hi All,
This is my first stab at using Spry and I've run into a small
problem. I can't get my images to show up for the thumbs or the
large image. And when I read the article for this I only got more
confused.
quote:
Now you can make use of these new data points in the album.
Start by replacing the hard coded image folder paths to the values
used in the XML file.
In the thumbnail 'src' path, remove the 'thumbnails/' and
replace it with the XML value. Make sure to remove the forward
slash since that is already stored in the XML value for the path.
Repeat for the main IMG tag. Remove the 'images/' from the
'src' field and replace it with the XML value.
Now you have to tell the dynamic region that you will be
using data from the new dataset. Add the data set name to the
spry:region attribute, separated by a space.
When it says "replace it with the XML value", how do I do
that? What XML value? Can someone give me an example? Do I spec out
the directories in the XML file or within the code on my
gallery.html page?
Here's my dir structure
gallery.html
-photo_gallery (dir)
--photo.xml
--gallery (dir)
---pic1.jpg
---pic2.jpg
---pic3.jpg etc.Hi Petron,
Sorry for the confusion.
You can do either. It depends on how you structure your XML.
The most flexible way would to just have the image name in
the XML file. That will let you change your folder structure
without having to update the file.
So your XML can say:
<photos>
<photo name="pic1.jpg" />
<photo name="pic1.jpg" />
</photos>
And your <img> tag can be:
<img src="gallery/{@name}">
{@name} is the data reference for your data set which
contains the image info.
But, if you have the full path in the XML:
<photos>
<photo name="gallery/pic1.jpg" />
then your img would be <img src="{@name}" />
Either way, the full path has to be built to the .jpg file.
The first way is probably better...
In my gallery tutorial, we start out with one gallery. But
later on, we expand it to use multiple galleries. We use one XML
file to tell use the image directory:
<galleries>
<gallery>china</gallery>
<gallery>egypt</gallery>
Where we can use these values as folder names.
Let me know if this helps. I don't want to give too many
unnecessary details that might confuse the issue.
If you have a sample URL, we can accurately help you.
Thanks,
Don -
Need help with this xml gallery !!!
i have build a gallery but its very simple...... it takes images from xml file.
i have attached all files in zip.
i just want two things if anyone can help.
first when i press next button it goes to next image but with no effect. it just displays next image ... i want to incorporate a sliding effect when the image is changed to another.
and second i want to use autoplay feature.
as soon as swf starts the images came one by one with difference of few seconds.
thx in advance... i really need help in this....!You're welcome.
I don't have an example to offer for the autorun. You should be able to think it thru. One key, as I mentioned is to preload all of the images first, that will allow for smooth playing of the show--no waiting for images to load between changes. You can load them into empty movieclips and hide them (_viisible = false) until they are needed. You could load them when called for, but you would have to put conditions on the displaying of things until the image loads, which will change when they are all loaded, so I recommend just loading them all first.
For the timing you can use setInterval. If something is going to be allowed to interupt the autorun, then you will need to make use of the clearInterval function as well, so that you stop the clock.
Since you will be wanting to know when things are loaded, you will need to use the MovieClipLoader.loadClip method for loading the images instead of using loadMovie. This is because the MovieClipLoader class supports having an event listener. If you look in the help documents in the MovieClipLoader.addListener section, there is an example there that provides a fairly good complete overview of using the code. The only difference is you'd be looking for the onLoadComplete event rather than the onLoadInit event. -
i have a flash & xml gallery source. whatever click the
thumbnails, opening first image. where is the problem? i need help,
please...
Flash & Xml
Gallerythen that's a problem. sometimes your cookie may loaded
sooner than the needed frame in your swf and when you try to go to
a frame that hasn't been downloaded, the swf will stay on frame 1.
i assume you already have a stop() on frame 1 and you check
the cookie's value before proceeding. in addition to waiting for
the cookie to load, you should wait for the needed frame of your
swf to load.
so, if you're not using a loop now to check for your cookie,
you'll need one for your swf to check its _framesloaded property
before advancing the timeline. -
Clear loaded pictures in xml gallery to load another set
i cannot figure how to unload my already populated xml gallery, before loading new content :
here the functions i want :
//following 2 functions will be called by a button :
// removes previously placed objects
function clearLoadedPictures():void {
// Load another ,xml to load new pictures set - ok : works fine
function LoadNewPictures():void {
i_g = 0;
// xml data
var xml_gallery:XML = new XML();
var xml_gallery_List:XMLList = new XMLList;
// XML data loader...
var xmlUrlReq:URLRequest = new URLRequest("xml/gallery2.xml");// gallery2.xml will replace gallery.xml already loaded
var xml_gallery_UrlLoader:URLLoader = new URLLoader(xmlUrlReq);
xml_gallery_UrlLoader.addEventListener(Event.COMPLETE, xml_gallery_Complete);
xml_gallery_UrlLoader.addEventListener(IOErrorEvent.IO_ERROR, xml_gallery_LoadFailed);
here the xml gallery code :
var _mc:item;
var total:int;
var i_g:int;
var id:int;
var btn_Gallery_Ready:Boolean;
var speedX:Number;
var spaceR:Number;
var img_gallery_Loader:Loader;
i_g = 0;
// xml data
var xml_gallery:XML = new XML();
var xml_gallery_List:XMLList = new XMLList;
// XML data loader...
var xmlUrlReq:URLRequest = new URLRequest("xml/gallery.xml");
var xml_gallery_UrlLoader:URLLoader = new URLLoader(xmlUrlReq);
xml_gallery_UrlLoader.addEventListener(Event.COMPLETE, xml_gallery_Complete);
xml_gallery_UrlLoader.addEventListener(IOErrorEvent.IO_ERROR, xml_gallery_LoadFailed);
bottom24.gallery.content_mc.addEventListener(MouseEvent.ROLL_OVER, startScroll);
bottom24.gallery.content_mc.addEventListener(MouseEvent.ROLL_OUT, stopScroll); //
// xmlComplete function
function xml_gallery_Complete(e:Event):void
xml_gallery = XML(e.target.data); //
xml_gallery_List = xml_gallery.item; // <item> in gallery.xml
total = xml_gallery_List.length();
spaceR = xml_gallery.attribute("space"); // specified in gallery.xml file as is : <gallery space="119" speed="0.2">
speedX = xml_gallery.attribute("speed");
init_gallery();
function xml_gallery_LoadFailed(e:IOErrorEvent):void {
trace("Load Failed: " + e);
function init_gallery() //
//bottom.gallery.content_mc.itemHolder_mc.
_mc = new item(); //
_mc.alpha = 0;
//_mc.imgMask_mc.scaleY = 0; // condition pour apparition des timbres ds la gallery - OLD
_mc.imgMask_mc.alpha = 0; // condition pour apparition des timbres ds la gallery - NEW
_mc.x = i_g * spaceR;
_mc.btn.id = i_g;
_mc.btn.mouseChildren = false;
bottom24.gallery.content_mc.itemHolder_mc.addChild(_mc);
Tweener.addTween(_mc, {alpha:1, time:0.8, transition:"easeOutExpo"});
_mc.online_mc.alpha = 0; //invisible sans roll over
if (xml_gallery_List[i_g].url != "")
_mc.btn.buttonMode = true;
_mc.online_mc.visible = true;
btn_Gallery_Ready = true;
else
_mc.btn.buttonMode = false;
_mc.online_mc.visible = false;
btn_Gallery_Ready = false;
var imgRequest:URLRequest = new URLRequest (xml_gallery_List[i_g].image); //
img_gallery_Loader = new Loader(); // var imgLoader:Loader;
img_gallery_Loader.load(imgRequest); //
img_gallery_Loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imgLoading);
img_gallery_Loader.contentLoaderInfo.addEventListener(Event.COMPLETE, img_gallery_Complete);
i_g++;
function imgLoading(event:ProgressEvent):void // tiny preloader in bottom thumbs pics
_mc.preloader_mc.width = Math.round(img_gallery_Loader.contentLoaderInfo.bytesLoaded / img_gallery_Loader.contentLoaderInfo.bytesTotal * 100);
function img_gallery_Complete(event:Event):void
_mc.imgHolder_mc.addChild(img_gallery_Loader);
Tweener.addTween(_mc.imgHolder_mc, {_saturation:0.9, time:0.6});// desaturate scrolling thumbs
//_mc.imgHolder_mc.alpha = 0.5; // test
// apparition des timbres ds la gallery, ici fade in : - NEW
Tweener.addTween(_mc.imgMask_mc, {"alpha":1, delay:i_g / 20, time:0.4, transition:"easeOutExpo"});// test
// apparition des timbres ds la gallery, ici image apparait de haut en bas : - OLD
//Tweener.addTween(_mc.imgMask_mc, {"scaleY":1, delay:i_g / 10, time:1, transition:"easeOutExpo"});
// la ligne de preloader qui diminue vers la gauche :
Tweener.addTween(_mc.preloader_mc, {"scaleX":0, delay:0, time:1, transition:"easeOutExpo"});
_mc.btn.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);
_mc.btn.addEventListener(MouseEvent.ROLL_OUT, onMouseOut);
_mc.btn.addEventListener(MouseEvent.CLICK, onMouseClick);
if (i_g < total)
init_gallery();
thankshi,
back to work,
then i used a loop in the first clear function:
var n:int = 0;
while (n < xml_gallery_List.length() -1) {
bottom24.gallery.content_mc.itemHolder_mc.removeChildAt(n); //
i++;
and it remove all my previously loaded pictures,but it throw me an error :
RangeError: Error #2006: The supplied index is out of bounds.
at flash.display: DisplayObjectContainer/removeChildAt()
it seems error come from the removeChildAt, but i can't figure out what's wrong
i've tried to replace removeChildAt(n); by removeChild(n); and the loop crash Flash software....
any suggestion ? -
No Thumbs or Main Image with Spry Gallery Demo
Hi everyone, DW CS3 newbie here.
I hope this topic hasn't been beaten into the ground yet.
I'm trying to put together a site
(members.cox.net/rangersbu9/gallery.html) for my son's soccer team
and am running into a wall getting the original, dynamic Spry
gallery demo to work. I've done my best to collect and modify the
required files and place them appropriately but, when the files are
loaded on the live server (the wrap div contents are all but
invisible when I view with IE7 locally, apparently due to the PC
not be set up as local server) the thumbs are 'x's and the main
image is a 1px x 1px dot.
The controls will highlight between the empty thumbs and the
gallery pull-down will select between the two options I've put in
the XML file but that's about it. Perhaps it is my ignorance, but
it seems like a ( src= ) tag is missing in the 'mainImageOutline'
div because I cannot understand where the main picture is coming
from otherwise.
Any insight from the source at the link above? Please keep in
mind I have two week's experience with DW and website building but
do have a programming background (from a few decades ago :->). I
believe I have the un-updated CS3 Spry version, if that matters.
Many thanks to Don and others here for posts that have helped
me get this far.
-KurtUpdate:
Got the thumbs to appear. Had them physically sized larger
than the XML fields stated. However, they will not grow/shrink. In
digging through gallery.js, I see that those two functions call
Spry.Effects.SizeAndPosition() - I cannot find that function in any
of the includes (i.e. SpryEffects.js). Spry.Effects.Size yes, but
not SizeAndPosition. Wondering if this gallery.js calls a later
version of SpryEffects.js than I currently have installed (it's
Spry 1.4). I will download 1.6 and check it out but if anyone has
any other input, please let me know.
Still no main image. In gallery.js I found ShowCurrentImage()
which had a hardcoded path to the images that did not match mine.
Corrected the path but no change.
Any suggestions?
Thanks.
-Kurt -
Xml gallery with thumbnails & next/previous buttons.
hallo all the wise people,
sorry to bother you, but i'm kind of desperate, and nobody around to ask, so....
i've spend now three full days editing an xml gallery... to my needs, and always goes messy, so maybe it's time give up and make my own from the scratch, or looking from a one closer to my needs =/ (helpless).
could anyone help - maybe any of you by some chance knows a link as close as possible to tutorial/source as3 fla to sthg as close as possible to this:
a) xml gallery
b) thumbnails
c) when thumbnail clicked a big picture shows
d) next/previous buttons possible
otherwise, i can also post the code of my gallery where i absolutely can't add next/previous buttons without making a big mess =/
i will be totally youbie doubie grateful for any help... any, if you only know any good link, 'll try to fugure out a tutorial or edit the source myself....
thanks in advanceheyyyo wise one,
at least this is really nice of you to ask - this gallery really makes me by now feel twice as blond as i am 8-0. but this is kinda really nested.
the xml structure goes like this (this is easy and more or, less standard)(Caption is neglectable, probabaly i will not even display it, unless i have some extra time):
<MenuItem>
<picnum>01</picnum>
<thumb>thumbs/Image00001.jpg</thumb>
<picture>Image00001.jpg</picture>
<Caption>Fist Title</Caption>
</MenuItem>
uaaha, then the as goes. there is the URLloader, but also two different loaders inside (one for the thumbnails, one for the big picture). and this is all inside a for each loop -eh... i was always trying to change the pictLdr behavior - the loader, that loads the big picture.
anyway the URL loader, and the main function, which is attached to it go like this:
var myXML:XML = new XML();
var XML_URL:String = "gallery_config.xml";
var myXMLURL:URLRequest = new URLRequest(XML_URL);
var myLoader:URLLoader = new URLLoader(myXMLURL);
myLoader.addEventListener("complete", xmlLoaded);
// Create the xmlLoaded function
function xmlLoaded(event:Event):void
// Place the xml data into the myXML object
myXML = XML(myLoader.data);
// Initialize and give var name to the new external XMLDocument
var xmlDoc:XMLDocument = new XMLDocument();
// Ignore spacing around nodes
xmlDoc.ignoreWhite = true;
// Define a new name for the loaded XML that is the data in myLoader
var menuXML:XML = XML(myLoader.data);
// Parse the XML data into a readable format
xmlDoc.parseXML(menuXML.toXMLString());
// Access the value of the "galleryFolder" node in our external XML file
for each (var galleryFolder:XML in myXML..galleryFolder)
// Access the value of the "pagenum" node in our external XML file
var galleryDir:String = galleryFolder.toString();
//trace (galleryDir);
//trace (galleryFolder);//output taki sam jak powyżej
// inicjuję variable flag, która bedzie trzsymac nazwę klikniętego thumbnail
var flag2:String = null;
// Set the index number of our loop, increments automatically
var i:Number = 0;
// Run the "for each" loop to iterate through all of the menu items listed in the external XML file
for each (var MenuItem:XML in myXML..MenuItem)
// Access the value of the "picnum" node in our external XML file
var picnum:String = MenuItem.picnum.toString();
// Access the value of the "pagetext" node in our external XML file
var Caption:String = MenuItem.Caption.toString();
// Access the value of the "thumb" node in our external XML file
var thumb:String = MenuItem.thumb.toString();
// Access the value of the "pagepicture" node in our external XML file
var picture:String = MenuItem.picture.toString();
// Just some trace I used for testing, tracing helps debug and fix errors
//trace(picnum);
var thumbLdr:Loader = new Loader();
var thumbURLReq:URLRequest = new URLRequest(galleryDir + thumb);
thumbLdr.load(thumbURLReq);
// Create MovieClip holder for each thumb
var thumb_mc = new MovieClip();
thumb_mc.addChild(thumbLdr);
addChildAt(thumb_mc, 1);
// Create the rectangle used for the clickable button we will place over each thumb
var rect:Shape = new Shape;
rect.graphics.beginFill(0xFFFFFF);
rect.graphics.lineStyle(1, 0x999999);
rect.graphics.drawRect(0, 0, 80, 80);
// Create MovieClip holder for each button, and put that rectangle in it,
// make button mode true and set it to invisible
var clip_mc = new MovieClip();
clip_mc.addChild(rect);
addChild(clip_mc);
clip_mc.buttonMode = true;
clip_mc.alpha = .0;
// The following four conditionals create the images where the images will live on stage
// by adjusting math through each row we make sure they are laid out good and not stacked
// all on top of one another, or spread out in one long row, we need 4 rows, so the math follows
if (picnum < "05")
line1xpos = line1xpos + distance; // These lines place row 1 on stage
clip_mc.x = line1xpos;
clip_mc.y = yPlacement;
thumb_mc.x = line1xpos;
thumb_mc.y = yPlacement;
else if (picnum > "04" && picnum < "11")
line2xpos = line2xpos + distance; // These lines place row 2 on stage
clip_mc.x = line2xpos;
clip_mc.y = 86;
thumb_mc.x = line2xpos;
thumb_mc.y = 86;
else if (picnum > "10" && picnum < "14")
line3xpos = line3xpos + distance; // These lines place row 3 on stage
clip_mc.x = line3xpos;
clip_mc.y = 172;
thumb_mc.x = line3xpos;
thumb_mc.y = 172;
else if (picnum > "13" && picnum < "21")
line4xpos = line4xpos + distance; // These lines place row 4 on stage
clip_mc.x = line4xpos;
clip_mc.y = 258;
thumb_mc.x = line4xpos;
thumb_mc.y = 258;
// And now we create the pic loader for the larger images, and load it into "pictLdr"
var pictLdr:Loader = new Loader();
var pictURL:String = picture;
var pictURLReq:URLRequest = new URLRequest(galleryDir + picture);
//var pictURLReq:URLRequest = new URLRequest("gallery/Image00004.jpg");sprawia,ze zawsze wyswitla sie jeden obrazek
pictLdr.load(pictURLReq);
// Access the pic value and ready it for setting up the Click listener, and function
clip_mc.clickToPic = pictLdr;
// Access the text value and ready it for setting up the Click listener, and function
clip_mc.clickToText = Caption;
//var instName:String = flag();
// Add the mouse event listener to the moviClip button for clicking
clip_mc.addEventListener (MouseEvent.CLICK, clipClick);
// Set the function for what happens when that button gets clicked
function clipClick(e:Event):void
// Populate the parent clip named frameSlide with all of the necessary data
MovieClip(parent).frameSlide.gotoAndPlay("show"); // Makes it appear(slide down)
MovieClip(parent).frameSlide.caption_txt.text = e.target.clickToText; // Adds the caption
MovieClip(parent).frameSlide.frame_mc.addChild(e.target.clickToPic); // Adds the big pic
} // This closes the "for each" loop
} // And this closes the xmlLoaded function
and the effect looks like this (it's a sketch, so big pictures are loaded randomly, don;t put too much attention to it): http://bangbangdesign.pl/xmlGallery/gallery29.swf
but i guess it's a terrible stuff to go through all this. i would be totallly satisfied with a likng to a good tutorial to do it from scratch, or just a hint where to start rebuilding this.
+ in any case i send greetinngs to whereever you are =] -
Insert link over an image in XML
Hello,
I recently bought this template: http://www.templatemonster.com/flash-templates/27466.html but I have a big problem. I want to add a hyperlink over the big images which appears when you click on bedrooms for example. There are 9 small images in the right side and 1 big image on the left. I changed all the images but I want also to add hyperlinks on some big images. The action script import an xml file like:
<?xml version="1.0" encoding="iso-8859-1"?>
<root>
<pageGallery nameGallery="GALLERY 1" name="gallery1" folder="gallery" line="3" maxImages="9">
<titleImages>
<smallImages>_gallery_small_images_1.jpg</smallImages>
<bigImages>_gallery_big_images_1.jpg</bigImages>
<infoImages><![CDATA[Fusce suscipit varius mi. Cum sociis natoque penatibus et -<br>magnis dis parturient montes, nascetur ridiculus mus. Nulla dui.<br>Fusce feugiat malesuada odio. Morbi nunc odio, gravida at. ]]></infoImages>
</titleImages>
<titleImages>
<smallImages>_gallery_small_images_2.jpg</smallImages>
<bigImages>_gallery_big_images_2.jpg</bigImages>
<infoImages><![CDATA[Fusce suscipit varius mi. Cum sociis natoque penatibus et -<br>magnis dis parturient montes, nascetur ridiculus mus. Nulla dui.<br>Fusce feugiat malesuada odio. Morbi nunc odio, gravida at. ]]></infoImages>
</titleImages>
<titleImages>
<smallImages>_gallery_small_images_3.jpg</smallImages>
<bigImages>_gallery_big_images_3.jpg</bigImages>
<infoImages><![CDATA[Fusce suscipit varius mi. Cum sociis natoque penatibus et -<br>magnis dis parturient montes, nascetur ridiculus mus. Nulla dui.<br>Fusce feugiat malesuada odio. Morbi nunc odio, gravida at. ]]></infoImages>
</titleImages> ........
Please help me with the correct syntax to add hyperlink over a big image in XML. I think I have to do some changes in .fla project, but I don't know where...
Thank you !This is the as for "load big images"
onClipEvent (load) {
if (_parent._parent.numLoadTitle == undefined) {
_parent._parent.numLoadTitle = 0;
if (_root.part == undefined) {
xmlNod = _root.xmlNodes.childNodes[0].childNodes[0];
} else {
var nameGalleryTytle:Number = _root.xmlNodes.childNodes[0].childNodes[0].childNodes.length;
var i:Number = 0;
while (i<nameGalleryTytle) {
titleNameGallery = _root.xmlNodes.childNodes[0].childNodes[i].attributes.name;
if (_root.part == titleNameGallery) {
xmlNod = _root.xmlNodes.childNodes[0].childNodes[i];
i++;
AllxmlNode = xmlNod.childNodes[_parent._parent.numLoadTitle];
images = AllxmlNode.childNodes[1].firstChild.nodeValue;
titleInfo = AllxmlNode.childNodes[2].firstChild.nodeValue;
var ifFolder:String = xmlNod.attributes.folder;
if (ifFolder == undefined) {
loadMovie(_root.url+images, cont.pic);
} else if (ifFolder == "") {
loadMovie(_root.url+images, cont.pic);
} else {
loadMovie(ifFolder+"/"+_root.url+images, cont.pic);
} else {
if (_root.part == undefined) {
xmlNod = _root.xmlNodes.childNodes[0].childNodes[0];
} else {
var nameGalleryTytle:Number = _root.xmlNodes.childNodes[0].childNodes[0].childNodes.length;
var i:Number = 0;
while (i<nameGalleryTytle) {
titleNameGallery = _root.xmlNodes.childNodes[0].childNodes[i].attributes.name;
if (_root.part == titleNameGallery) {
xmlNod = _root.xmlNodes.childNodes[0].childNodes[i];
i++;
AllxmlNode = xmlNod.childNodes[_parent._parent.numLoadTitle];
images = AllxmlNode.childNodes[1].firstChild.nodeValue;
titleInfo = AllxmlNode.childNodes[2].firstChild.nodeValue;
var ifFolder:String = xmlNod.attributes.folder;
if (ifFolder == undefined) {
loadMovie(_root.url+images, cont.pic);
} else if (ifFolder == "") {
loadMovie(_root.url+images, cont.pic);
} else {
//loadMovie(ifFolder+"/"+_root.url+small[i], item["mini"+i].cont.pic);
loadMovie(ifFolder+"/"+_root.url+images, cont.pic);
***** Here is the first frame frome scene:
import mx.transitions.Tween;
import mx.transitions.easing.*;
Stage.scaleMode = "noScale";
Stage.align = "TL";
setProperty("", _quality, "BEST");
url = "tfile";
_root.linkGallery=0;
_root.titleGallery = 0;
_root.cacheKiller = "true";
import gs.dataTransfer.XMLParser;
function onFinish(success_boolean, results_obj, xml) {//This fhunction gets called as soon as the XML loads and gets parsed.
if (success_boolean) {
stop();
var parsed_obj = {};//We'll use this to hold the parsed xml object (once the XML loads and gets parsed successfully).
var unCash = new Date().getTime();
if (_root.cacheKiller == "true") {
fileToLoad = url+"_main.xml?cacheKiller="+unCash;
fileToLoad = url+"_main.xml";
} else {
fileToLoad = url+"_main.xml";
XMLParser.load(fileToLoad,onFinish,parsed_obj);
_root.emp.useHandCursor = 0;
///forplayer
_root.mus = 1;
_root.n = 1;
_root.num = 1;
*** This is the second frame :
import gs.dataTransfer.XMLParser;
function onFinish(success_boolean, gallery_obj, xml) {//This fhunction gets called as soon as the XML loads and gets parsed.
if (success_boolean) {
play();
//system settings
// frame number where readMore movieClip is situated
pagesReadMoreFrame = 4;
// frame number of the first content page
firstPageFrame = 1;
//system settings
#include "gs/dataTransfer/xmlFunctions.as"
//_root.link=_root.getMenuSystemOrder(0);
//trace(_root.link)
_root.link = 1;
_root.titleNumPage = 1;
_root.openNewGallery = true
_root.part = _root.xmlNodes.childNodes[0].childNodes[0].attributes.name
*** And here is the xmlFunctions.as:
import flash.display.*;
function loadBitmapSmoothed(url:String, target:MovieClip) {
// Create a movie clip which will contain our
// unsmoothed bitmap
var bmc:MovieClip = target.createEmptyMovieClip("bmc", target.getNextHighestDepth());
// Create a listener which will notify us when
// the bitmap loaded successfully
var listener:Object = new Object();
// Track the target
listener.tmc = target;
// If the bitmap loaded successfully we redraw the
// movie into a BitmapData object and then attach
// that BitmapData to the target movie clip with
// the smoothing flag turned on.
listener.onLoadInit = function(mc:MovieClip) {
mc._visible = false;
var bitmap:BitmapData = new BitmapData(mc._width, mc._height, true);
this.tmc.attachBitmap(bitmap, this.tmc.getNextHighestDepth(), "auto", true);
bitmap.draw(mc);
// Do it, load the bitmap now
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(listener);
loader.loadClip(url, bmc);
var mainObj=_root.parsed_obj;
var galleryObj=_root.gallery_obj;
function textSelectable(selectedObject) {
isTextSelected=getSettingsValue(mainObj, "textSelectable", "item");
if (isTextSelected=="true") {
selectedObject.selectable=true;
function getXmlSection (obj, itemName, sectionName) {
i=0;
while (obj[itemName][i]) {
if (obj[itemName][i].name==sectionName) {
returnedResult=true;
return (i);
break;
i++;
function getSettingsValue (obj, itemName, itemType) {
sectionNum=getXmlSection(obj, "section", "settings");
k=0;
while (obj["section"][sectionNum][itemType][k]) {
if (obj["section"][sectionNum][itemType][k].name==itemName) {
return (obj.section[sectionNum][itemType][k].value);
break;
k++;
function getCopyright (textObj) {
textObj.htmlText=getSettingsValue(mainObj, "copyright", "item");
textSelectable(textObj);
function getCompanyName (textObj) {
textObj.htmlText=getSettingsValue(mainObj, "companyName", "item");
textSelectable(textObj);
function getSlogan (textObj) {
textObj.htmlText=getSettingsValue(mainObj, "slogan", "item");
textSelectable(textObj);
function getSystemValue (textObj, systemOptionName) {
textObj.htmlText=getSettingsValue(mainObj, systemOptionName, "item");
textSelectable(textObj);
function getMenuLink (textObj, linkNum) {
sectionNum=getXmlSection(mainObj, "section", "menu");
textObj.htmlText=mainObj["section"][sectionNum].link[linkNum].value;
textSelectable(textObj);
function getMenuSystemOrder (linkNum) {
sectionNum=getXmlSection(mainObj, "section", "menu");
return (mainObj["section"][sectionNum].link[linkNum].systemOrder);
function getGlobalText(textObj, textsNumber, optional:Boolean) {
sectionNum = getXmlSection(mainObj, "section", "global_text");
textObj.htmlText = mainObj["section"][sectionNum].texts[textsNumber].value;
if (optional == undefined) {
textSelectable(textObj);
} else {
// do nothing
function getGlobalImageName(imageNumber) {
sectionNum = getXmlSection(mainObj, "section", "global_img");
//currentPage = _root.link-_root.firstPageFrame;
imageParams = new Array();
imageParams['name'] = mainObj["section"][sectionNum]["image"][imageNumber]["imageUrl"];
imageParams['linkToOpen'] = mainObj["section"][sectionNum]["image"][imageNumber]["link"];
return (imageParams);
function getCurrentText(textObj, textNumber) {
sectionNum=getXmlSection(mainObj, "section", "pages");
currentPage=_root.link-_root.firstPageFrame;
textObj.htmlText=mainObj["section"][sectionNum]["page"][currentPage]["texts"][0]["pageTex t"][textNumber].value;
textSelectable(textObj);
function getMenuPreviousLink (linkNum) {
k=0;
systemOrder=getMenuSystemOrder(k);
while (systemOrder) {
if (systemOrder==linkNum) {
orderResult=k+1;
break;
k++;
systemOrder=getMenuSystemOrder(k);
return (orderResult);
function getCurrentImageName(imageNumber) {
sectionNum=getXmlSection(mainObj, "section", "pages");
currentPage=_root.link-_root.firstPageFrame;
imageParams=new Array();
imageParams['name']=mainObj["section"][sectionNum]["page"][currentPage]["image"][imageNum ber]["imageUrl"];
imageParams['linkToOpen']=mainObj["section"][sectionNum]["page"][currentPage]["image"][im ageNumber]["link"];
imageParams['target']=mainObj["section"][sectionNum]["page"][currentPage]["image"][imageN umber]["target"];
return (imageParams);
function getCurrentImageName_splash(imageNumber) {
sectionNum=getXmlSection(mainObj, "section", "settings");
imageParams=new Array();
imageParams['name']=mainObj["section"][sectionNum]["image"][imageNumber]["imageUrl"];
imageParams['linkToOpen']=mainObj["section"][sectionNum]["image"][imageNumber]["link"];
return (imageParams);
function checkLinkType (linkTextType, linkNumber) {
k=0;
typeCount=0;
finalLinkNumber=parseInt(linkNumber)+1;
currentPage=_root.link-_root.firstPageFrame;
sectionNum=getXmlSection(mainObj, "section", "pages");
linkTypeCkeck=mainObj["section"][sectionNum]["page"][currentPage]["link"][k]["linkType"];
while (linkTypeCkeck){
if (linkTypeCkeck==linkTextType) {
typeCount++;
if (typeCount==finalLinkNumber) {
return(k);
break;
k++;
linkTypeCkeck=mainObj["section"][sectionNum]["page"][currentPage]["link"][k]["linkType"];
_root.readMoreFrameType = 'readmore';
function more_click_func(number) {
tempNumber = number.split(" ");
number=tempNumber.join("");
number=number.toLowerCase();
num=_root.pagesReadMoreFrame;
currentPage=_root.link-_root.firstPageFrame;
if( isNaN(Number(number)) ) {
readMoreType = number;
} else {
readMoreType = 'readmore';
//if( (_root.link<>num || _root.readMoreFrameType!=readMoreType)) {
if (_root.animation){
//if (_root.link<>5 ){
_root["item" + getMenuPreviousLink(_root.link)].gotoAndPlay("s2");
//_root.menu2["item" + getMenuPreviousLink(_root.link)].gotoAndPlay("s2");
if (number=='privacypolicy') {
_root.readMoreFrameType = 'privacypolicy';
sectionNum=getXmlSection(mainObj, "section", "privacyPolicy");
titleNum=getXmlSection(mainObj.section[sectionNum], "item", "pageTitle");
textNum=getXmlSection(mainObj.section[sectionNum], "item", "pageText");
_root.readMoreTitle=mainObj.section[sectionNum]["item"][titleNum].value;
_root.readMoreText=mainObj.section[sectionNum]["item"][textNum].value;
} else if (number=='termsofuse') {
_root.readMoreFrameType = 'termsofuse';
sectionNum=getXmlSection(mainObj, "section", "termsOfUse");
titleNum=getXmlSection(mainObj.section[sectionNum], "item", "pageTitle");
textNum=getXmlSection(mainObj.section[sectionNum], "item", "pageText");
_root.readMoreTitle=mainObj.section[sectionNum]["item"][titleNum].value;
_root.readMoreText=mainObj.section[sectionNum]["item"][textNum].value;
} else {
_root.readMoreFrameType = 'readmore';
sectionNum=getXmlSection(mainObj, "section", "pages");
linkCount=checkLinkType("readMoreLink", number);
i=0;
linkTitleNum=getXmlSection(mainObj["section"][sectionNum]["page"][currentPage]["link"][li nkCount], "item", "title");
linkTextNum=getXmlSection(mainObj["section"][sectionNum]["page"][currentPage]["link"][lin kCount], "item", "linkText");
_root.readMoreTitle=mainObj["section"][sectionNum]["page"][currentPage]["link"][linkCount ]["item"][linkTitleNum].value;
_root.readMoreText=mainObj["section"][sectionNum]["page"][currentPage]["link"][linkCount] ["item"][linkTextNum].value;
_root.subMenu.subMenu.subMenu["item"+(_root.link-1)].mouseRelease = true;
_root.link = 8;
_root.linkClosePanel = false;
_root.titleNumPage = _root.pagesReadMoreFrame;
_root.content.play();
function getContactFormText(textObj, textNumber) {
sectionNum=getXmlSection(mainObj, "section", "contactForm");
textObj.htmlText=mainObj["section"][sectionNum]["texts"][0]["pageText"][textNumber].value ;
textSelectable(textObj);
function getContactFormText_only(textNumber) {
sectionNum=getXmlSection(mainObj, "section", "contactForm");
return htmlText=mainObj["section"][sectionNum]["texts"][0]["pageText"][textNumber].value;
function getContactFormParams() {
sectionNum=getXmlSection(mainObj, "section", "contactForm");
ContactFormParams=new Array();
servNum=getXmlSection(mainObj["section"][sectionNum], "item", "serverOption");
recNum=getXmlSection(mainObj["section"][sectionNum], "item", "recipient");
ContactFormParams['rec']=mainObj["section"][sectionNum]["item"][recNum].value;
ContactFormParams['serv']=mainObj["section"][sectionNum]["item"][servNum].value
return (ContactFormParams);
// gallery functions
function getGallerySystemProperty(propName) {
sectionNum=getXmlSection(galleryObj, "section", "systemOptions");
propNum=getXmlSection(galleryObj["section"][sectionNum], "option", propName);
return (galleryObj["section"][sectionNum]["option"][propNum].value);
function getGallerySettings(propName) {
sectionNum=getXmlSection(galleryObj, "section", "settings");
propNum=getXmlSection(galleryObj["section"][sectionNum], "option", propName);
return (galleryObj["section"][sectionNum]["option"][propNum].value);
function getGalleryImage(imageNum, categoryNum) {
sectionNum=getXmlSection(galleryObj, "section", "imagesData");
imageParams=new Array();
image=galleryObj["section"][sectionNum]["category"][categoryNum]["image"][imageNum];
nameNum=getXmlSection(image, "item", "imageUrl");
commentNum=getXmlSection(image, "item", "imageComment");
imageParams['name']=image['item'][nameNum].value;
imageParams['comment']=image['item'][commentNum].value;
return (imageParams);
function getCurrentGalleryName(categoryNum) {
sectionNum=getXmlSection(galleryObj, "section", "imagesData");
return (galleryObj["section"][sectionNum]["category"][categoryNum].name); -
How to load external png image via xml?
Can anyone help me with adding a png image to a mc with an instance name.
I only want to display a single image (no gallery)
I would like to get the url for the image via an xml.
Here is a copy of my current action script which has already pulled in the xml data which includes the node with the url for the photo.
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("links.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void
myXML = new XML(e.target.data);
trace(myXML);
menumv.carbtn.addEventListener(MouseEvent.CLICK, openCURL);
menumv.edubtn.addEventListener(MouseEvent.CLICK, openEURL);
menumv.psybtn.addEventListener(MouseEvent.CLICK, openPURL);
menumv.stubtn.addEventListener(MouseEvent.CLICK, openSTURL);
menumv.busbtn.addEventListener(MouseEvent.CLICK, openBURL);
menumv.shabtn.addEventListener(MouseEvent.CLICK, openSURL);
studentmv.stuname.text = myXML.student.name;
function openCURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.car.url));
function openEURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.edu.url));
function openPURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.psy.url));
function openSTURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.stu.url));
function openBURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.bus.url));
function openSURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.sha.url));
And here is a copy of the node containing the url
<menu>
<student>
<name>testnamehere</name>
<photo>http://10.0.0.2/test/photos/testnamephoto.jpg</photo>
</student>
</menu>
I did see this tutorial but it was for a gallery and I couldnt seem to hack and slash it to do what I want.
http://tuts.flashmint.com/creating-a-simple-xml-gallery-in-actionscript3/
Thanks again in advance for all the help.I have added that code but I think i have buggered up something else in the process.
I get the following error
ReferenceError: Error #1069: Property data not found on flash.display.LoaderInfo and there is no default value.
at sdp_fla::MainTimeline/load_complete()
Current AS
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("links.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void
myXML = new XML(e.target.data);
trace(myXML);
menumv.carbtn.addEventListener(MouseEvent.CLICK, openCURL);
menumv.edubtn.addEventListener(MouseEvent.CLICK, openEURL);
menumv.psybtn.addEventListener(MouseEvent.CLICK, openPURL);
menumv.stubtn.addEventListener(MouseEvent.CLICK, openSTURL);
menumv.busbtn.addEventListener(MouseEvent.CLICK, openBURL);
menumv.shabtn.addEventListener(MouseEvent.CLICK, openSURL);
studentmv.stuname.text = myXML.student.name;
var _request:URLRequest = new URLRequest(myXML.student.photo);
var _ldr = new Loader();
studentmv.photo.addChild(_ldr);
_ldr.load(_request);
_ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, load_complete, false, 0, true);
function openCURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.car.url));
function openEURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.edu.url));
function openPURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.psy.url));
function openSTURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.stu.url));
function openBURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.bus.url));
function openSURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.sha.url));
function load_complete(event):void
var bitmap:Bitmap = Bitmap(event.currentTarget.data);
bitmap.smoothing = true;
bitmap.width = studentmv.photo.width
bitmap.width = studentmv.photo.height
studentmv.photo.addChild(bitmap) -
Xml gallery alignment, help
I am making an XML gallery with thumbnails. It is working fine, but I have a problem with alignment of the images. All the large images are loading into the top left corner. I would like them to load with center alignment for all images. I don't know anything about Action Script. The way I made this website was to use already made sample of some one else. Can you help me to figure out this alignment problem? Again, I am very bad at Action Script, so it would be great if you can show me the actual coding for this to work.
Here is the sample gallery: http://www.chimeddorj.com
Here goes the Sript>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
RemoveAllThumbs.onLoad = function(){
removeAllThumbs()
//init global variables and properties
Stage.scaleMode = "noscale";
import gs.TweenFilterLite;
import gs.TweenLite;
XML LOADING
//handle loading of external images..
var slide:XML = new XML();
slide.ignoreWhite = true;
var largeImageUrl:Array = new Array();
var thumbUrl:Array = new Array();
var captions:Array = new Array();//not used
var p:Number = 0;//tracks position in arrays
/*!!!!if you want to load in another XML file, make sure you clear the existing thumbnails
by calling the removeAllThumbs() function first!*/
slide.onLoad = function() {
largeImageUrl = [];
thumbUrl = [];
captions = [];
xmlNode = this.firstChild;
var images:Array = this.firstChild.childNodes;
for (i=0; i<images.length; i++) {
thumbUrl[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
largeImageUrl[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
captions[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
p = 0;//reset p for different gallery loading
//create a bg clip for the thumbsTrack. Enables padding between images to work correctly
thumbMask_mc.thumbBox_mc.createEmptyMovieClip("thumbTrackBg",1);
thumbMask_mc.thumbBox_mc.thumbTrackBg.beginFill(0x000000,20);
thumbMask_mc.thumbBox_mc.thumbTrackBg.moveTo(thumbMask_mc.thumbBox_mc._x,thumbMask_mc.thum bBox_mc._y);
thumbMask_mc.thumbBox_mc.thumbTrackBg.lineTo(thumbMask_mc.thumbBox_mc._x+thumbMask_mc.thum bBox_mc._width,thumbMask_mc.thumbBox_mc._y);
thumbMask_mc.thumbBox_mc.thumbTrackBg.lineTo(thumbMask_mc.thumbBox_mc._x+thumbMask_mc.thum bBox_mc._width,thumbMask_mc.thumbBox_mc._y+thumbMask_mc.thumbBox_mc._height);
thumbMask_mc.thumbBox_mc.thumbTrackBg.lineTo(thumbMask_mc.thumbBox_mc._x,thumbMask_mc.thum bBox_mc._y+thumbMask_mc.thumbBox_mc._height);
thumbMask_mc.thumbBox_mc.thumbTrackBg.lineTo(thumbMask_mc.thumbBox_mc._x,thumbMask_mc.thum bBox_mc._y);
thumbMask_mc.thumbBox_mc.thumbTrackBg.endFill();
//load the thumbs
loadThumbs();
Mouse.removeListener(mouseListener);//kill the mouselistener if it is added
slide.load("paintings.xml");//load xml
var imageWidth:Number = 0;//default x position of our movieclips relative to containing movieclip
var buffer:Number = 20;//padding between images
var thumbsToShow:Number = 5//
LOAD THUMBNAILS, ADD ACTIONS & PADDING TO THUMBS
//here we load in our thumbnails
function loadThumbs() {
//remove the movieclip loade listener on each iteration of this function
Clip.removeListener(mclListener);
//attach and associate with a variable a MC to hold each loaded movieClip
var container:MovieClip = thumbMask_mc.thumbBox_mc.attachMovie("thumbBox", "thumbBox"+p, thumbMask_mc.thumbBox_mc.getNextHighestDepth(), {_x:imageWidth, _y:0});
//create a movieclip loader
var Clip:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
mclListener.onLoadStart = function(target_mc:MovieClip) {
target_mc._alpha = 0;//set thumb alpha to be zero
//handle loading progress - simple counter here
mclListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
//use this if you want to indicate loading of your thumbnails etc...
//loadTxt.captions_txt.text = Math.floor(bytesLoaded/bytesTotal*100)+"%";
mclListener.onLoadInit = function(target_mc:MovieClip) {
//here we can access our loaded clips properties!
//here is where we attach functions to our clip so that we can dynamically create rollovers etc.
//make our thumbnails visible again
TweenLite.to(target_mc, 2, {_alpha:100});
//based off image width this places our thumbs next to each other
imageWidth = (imageWidth+target_mc._width)+buffer;
//associate a variable here with our p value, we use this later to load in large images
target_mc.pictureValue = p;
//handle image rollovers these are active only on the thumb image!!! Watch the US spelling!
target_mc.onRollOver = function() {
TweenFilterLite.to(target_mc,.4,{type:"Color", brightness:1.5, ease:None.easeOut});
target_mc.onRollOut = function() {
TweenFilterLite.to(target_mc,4,{type:"Color", brightness:1, ease:None.easeOut});
//handle a click on a thumbnail
target_mc.onRelease = function() {
//load large images
mcLoader.loadClip(largeImageUrl[target_mc.pictureValue],largeImage_mc);
caption.text = captions[target_mc.pictureValue];;
p++;//increment value to cycle through array
if (p<thumbUrl.length) {
loadThumbs();//create loop
if (p == thumbUrl.length) {
/*we set this variable here because this is where we know the length of our thumbnails containing mc.
After we have loaded all content in. Makes sense really!*/
mcWidth = thumbMask_mc.thumbBox_mc._width;
//adjust the width and height of the thumbstrack bg clip
thumbMask_mc.thumbBox_mc.thumbTrackBg._width = mcWidth;
thumbMask_mc.thumbBox_mc.thumbTrackBg._height = thumbMask_mc.thumbBox_mc._height
/*add the mouse listener object to the thumbnail mask. We do this element of our script here so
we do not enable scrolling of our mc before the images have all loaded in. As this can look a little funny*/
Mouse.addListener(mouseListener);
//load in the next thumb
Clip.addListener(mclListener);
Clip.loadClip(thumbUrl[p],container);
REMOVE ALL THUMBS METHOD
//Use to clear old thumbs if you are going to add in a new set of thumbs
function removeAllThumbs():Void {
for (var i in thumbMask_mc.thumbBox_mc) {
if (typeof (thumbMask_mc.thumbBox_mc[i]) == "movieclip") {
removeMovieClip(thumbMask_mc.thumbBox_mc.getInstanceAtDepth(thumbMask_mc.thumbBox_mc[i].ge tDepth()));
thumbMask_mc.thumbBox_mc._width = thumbMask_mc._width
/*sampleRemoveAllButton.onRelease = function(){
removeAllThumbs()
LOAD LARGE IMAGES MOVIECLIP LOADER FUNCTION
/*generic load object here we handle loading in external images etc
this block of code loads the large images into the bright blue mc
for instance, you could fade in/out big images or make a progress indicator
using this block of script*/
var mcLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
listener.onLoadStart = function(target_mc:MovieClip) {
//empty
listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
//amountLoaded = Math.floor((bytesLoaded/bytesTotal)*100);//calulate a loading percentage!
listener.onLoadInit = function(target:MovieClip):Void {
//empty
mcLoader.addListener(listener);
MOUSE LISTENER
//this handles the panning of the thumbnails
mouseListener = new Object();
mouseListener.onMouseMove = function() {
if (thumbMask_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
maskOver();//call the scroll function
SCROLLER FUNCTION
var scrollSpeed:Number = 5;
var halfMaskWidth:Number = thumbMask_mc._width/2;
var npixels:Number;
var mcWidth:Number = thumbMask_mc.thumbBox_mc._width;
var maskWidth:Number = Math.floor(thumbMask_mc._width);
function slideThumbs() {
// stop scrolling if we are off the mask and delete the enterframe event
if (!thumbMask_mc.thumbBox_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
delete this.onEnterFrame;
// mouse over left half of slider:
if (thumbMask_mc._xmouse>0 && thumbMask_mc._xmouse<thumbMask_mc._x+halfMaskWidth) {
npixels = (halfMaskWidth-thumbMask_mc._xmouse)/halfMaskWidth*scrollSpeed;
thumbMask_mc.thumbBox_mc._x += npixels;
//stop sliding too far to the left
if (thumbMask_mc.thumbBox_mc._x>=0) {
thumbMask_mc.thumbBox_mc._x = 0;
delete this.onEnterFrame;
// mouse over right half of slider:
if (thumbMask_mc._xmouse>halfMaskWidth && thumbMask_mc._xmouse<thumbMask_mc._x+thumbMask_mc._width) {
npixels = (thumbMask_mc._xmouse-halfMaskWidth)/halfMaskWidth*scrollSpeed;
thumbMask_mc.thumbBox_mc._x -= npixels;
//stop sliding too far to the right
if (thumbMask_mc.thumbBox_mc._x<=-(mcWidth-maskWidth)) {
thumbMask_mc.thumbBox_mc._x = -(mcWidth-maskWidth);
delete this.onEnterFrame;
//function to do the scrolling man!
function maskOver() {
this.onEnterFrame = function() {
slideThumbs();I am using Flash CS 4, like I mentioned earlier, I am making this site on some one's pre-made flash file. There is a movie symbol for loading the large images (called largeImage_mc). I resized this movie clip to 550x450 px (landscape). And positioned it at X=200 Y=0 (top left corner registration point or the anchor point).
The movie clip could be dragged to any position. But images that are loaded into this bo is always aligning to the top left corner of this movie symbol.
If I calculate the actual center of this image loading area (regarding its position on the window), it would be x=425, y=225.
I hope my writing makes sence.
actual site: www.chimeddorj.com -
I have an XML gallery that has been giving me some problems. My as3 refers to an .as file that is in itself a class. This class creates the gallery and has an event listener to exit the gallery when clicked. It works perfectly fine for exiting the main image, but my thumbnails don't budge. I fixed the thumbnail issue by adding the code removeChild, which removes the gallery completely, but freezes the main image. What I think is happening is that when I add the code removeChild it disables any communication between my swf and as files, which in turn skips over the eventListener to remove my main image.. the code is kind of long and complicated, but i was hoping for some advice.. tips.. anything.
thanks for the help!!
I'm still getting an error 2007 non null object, even though i declared it in same style in which i declared photo_bit.
take the following code for example...
stage.removeChild(stage.getChildByName("photo_bit"));
stage.removeChild(stage.getChildByName("thumb_btn"));
stage.removeChild(stage.getChildByName("thumb_bit"));
and yes I added it to my .as file
private function displaythumb(e:Event):void
thumb_btn = new Sprite();
thumb_bit= new Bitmap();
thumb_btn.name="thumb_btn";
thumb_bit.name="thumb_bit";
thumb_btn.y=(stage.stageHeight-thumb_btn.height)/1.25;
thumb_btn.graphics.beginFill(0x000000,0);
thumb_btn.graphics.drawRect(0,0,125,125);
thumb_btn.graphics.endFill();
thumb_bit=e.target.content as Bitmap;
thumb_bit.y=(stage.stageHeight-thumb_bit.height)/1.045;
thumb_btn.width=thumb_btn.height=thumb_bit.width=thumb_bit.height=125;
thumb_bit.smoothing=true;
addChild(thumb_bit);
addChild(thumb_btn);
thumb_btn.addEventListener(MouseEvent.CLICK,loadphoto); -
Xml gallery problem??
I´m using a xml gallery with thumbs . I tried several
things but can´t get it work. I want to add links in the
textfield. The text in the textfield comes from a .txt file and xml
file. I dont know if it´s possible to add links in .txt files
or if there is any other way to open urls with links for the
different images.
I hope someone can help me with this..
file included...
http://www.robertr.se/flash/portfoliopage.zip
207 kb
Very best regards
/RobertI'm not really sure what you are trying to do. I dont know
what you are trying to make a link out of....
However if you have a movieclip called myPic, and you want it
to link to one of your urls loaded from the xml or a .txt file
myLink= whatever your loaded link from xml or .txt is;
myPic.onRelease=function(){
getURL(myLink,blank);} -
Hi! I'm nearly there but I can't get this scipt to work!! Its
a basic gallery I'm building that imports images via xml with
thumnails. Problem is I started trying to make columns and it wont
work! I'm nearly there though I can smell it! The Column bit is
declaired at the top and in a for statement at the bottom! Can you
take a look?
Thanks GavinI could generate the mixed case columns with no problem. It was my mistake and sorry for the inconvinience.
However I am running into problems modelling a nested hierarchical set of queries with levels more than 2.
Please advise of any sample code available anywhere.
For example I could do :
create table x1 ( id number , f1 varchar2(10));
creat table x2 ( id number , id_x1 number references x1(id) , f1 varchar2(10)) ;
create table x3 ( id number , id_x2 number references x2(id), f1 varchar2(10)) ;
To model this, I did
create type x3_typ as object ( id number, id_x2 number , f1 varchar2(10)) ;
create type x3_typ_t is table of x3_typ ;
create type x2_typ as object ( id number, id_x1 number , f1 varchar2(10), x3_list x3_typ_t ) ;
create type x2_typ_t is table of ref x2_typ ;
create type x1_typ as object ( id number
, f1 varchar2(10) , x2_list x2_typ_t ) ;
create or replace view x3_x2 as
select id , f1 , cast(multiset(select * from x3 ) as x3_typ_t ) as x3_list
If I try to use a view again like as given below, I get the Oracle inconsistent datatypes error.
create or replace view x2_x1 as
select id , f1 , cast(multiset(select * from x3_x2 ) as x2_typ_t ) as x2_list
I there a better way? Am I missing something? Please help. -
I've got an xml gallery that i've built in flash...
everything works just fine- but i'm now trying to build an
alternate gallery and I'm in a bit over my head.
Here are the nodes I have in my xml:
<pic>
<image></image>
<caption></caption>
<thumbnail></thumbnail>
<projname></projname>
<subtitle></subtitle>
<view></view>
</pic>
from there: the thumnails layout- the image, and copy display
on rollOver of the thumbs...
for my alternate gallery- I want the same layout- however for
example a 'web' category, i only want the 'web' thumbnails to work-
and still have the rest of the gallery load an alternate thumbnail-
that is a grayscale version of the original- and i want it to do
absolutely nothing but sit there. I have created alternate gray
versions of the images and they load fine...
obviously leaving out the nodes i don't want stops the xml
from loading... and leaving them blank returns an 'undefined' in my
dynamic text boxes.
i haven't had to tackle something like this in the past and
i'm not sure where to start-
would it work to have a category node and then an if/else
statement leaving specified categories rollOver states .enabled =
false; ?
if anyone has any ideas - i'm just not sure where to go from
here.
thanks!any type of filtering through XML CAN be done through flash,
or parsed in the asp/php file that is generated, but modifying the
SQL statement that creates your initial data is the real way to
handle your issue.
If you do end up parsing all the XML in flash alone, you'll
do a lot more work, but you'll probably have to split up your XML
into seperate objects via catagory. (or write if statements to
ignore empty nodes). -
hi! i was woundering if anyone can help me with an xml
gallery. i have one created and it displays the pictures fine, but
i would like one which i would not have to edit the xml file to add
new images into, so the gallery updates itself everytime a new
image is placed into the folder.
is this possible or am i stuck with having to edit the xml
file myself everytime?Possible but to update the xml you will need additional -
server side - software like ASP, PHP, CF, Java.
Maybe you are looking for
-
I had to reformat my hard drive on my pc...have a backup now of my music on my PC....my question is how do I get the music into I tunes and have I tunes recognize my ipod now when I connect it to my pc so that it syncs automatically Thanks
-
Cs5 or cs6 , can i use 2 monitors?
Hi i'm under windows 7 and sometime xp i have 2 monitors can i use them with photoshop cs5 or cs6? for example have the image in the bigger monitor or camera raw in the bigger monitor and the tools in the smaller? or viveversa? thanks cheers
-
Adobe Bridge won't start. Shows message: Adobe Bridge CC has stopped working
Running Windows 8, with 16GB memory, running 64-bit Bridge. When I try to start Bridge it loads, shows main screen, then immediately shows dialog that says Adobe Bridge CC has stopped working. Only options are to debug or close program. I did Ctrl/Cl
-
Application crashes when I click and drag object. Any time I am in an adobe program on my new computer (OS X Yosemite 10.10.1, 15 inch macbook pro 2.5gHz) say Illustrator for example, it will be fine until I inevitably need to click and drag somethin
-
How to debug correlation?
Hi, the correlation I've set up doesn't seems to working, although I've done everything by the book. How can I debug the BPEL process to learn what happens with the correlation? I've looked at the visualisation of process in the EM console in debug m