Menu With Categories From External File
are there any good examples on how to create a menu which gets the menu points from an external source? i'm not a native english speaker - hope you understand what i mean.
preferably with submenu points... (drop down or hierarchial)
thanks in advance
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 10-14-2004, 08:12 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Menu With Categories From External File
are there any good examples on how to create a menu which gets the menu points from an external source? i'm not a native english speaker - hope you understand what i mean.
preferably with submenu points... (drop down or hierarchial)
thanks in advance
External File In Dyn Menu
hi all,
My question regarding this tutorial:
http://www.actionscripts.org/tutoria...us/index.shtml
it wroks fine, BUT I want to Load External Text File with
ActionScript Code:
loadVariablesNum("items.txt", 0, "POST");
BUT does not work with External File at all
Can you tell me how can I use the text file to load the items to the MENU?
ActionScript Code:
// to be replaced by extrenal text file.
// menu items
total = 11;
text1 = "home";
text2 = "dogs";
text3 = "cats";
text4 = "rabbits";
text5 = "hamsters";
text6 = "rats";
text7 = "mice";
text8 = "guinea pigs";
text9 = "ferrets";
text10 = "chinchillas";
text11 = "monkeys";
// submenus
subText2 = 2;
stext21 = "puppies";
stext22 = "adult";
subText4 = 2;
stext41 = "short hair";
stext42 = "long hair";
I have this TEXT FILE :
ActionScript Code:
&total = 11&text1 = home&text2 = dogs&text3 = cats&text4 = rabbits&text5 = hamsters .... ETC
Dynamic Menu And External File
Hello,
I'm new to Flash 5 and to this forum. I've been reading books and studying tutorials trying to learn how to use the software. I am currently working with dynamic text boxes and external files. I was browsing the Internet when I came across this site: http://www.5sec.com. I liked the dynamic menus that are used in the templates so I thought I would give it a try. NO LUCK!! I know how to read an external file using a dynamic text box, but I could not for the life of me figure out how to create the button effects. I would appreciate any assistance. I've been trying for about a week.
Thank You, and let me know if I need to provide more information.
Navigation Menu From External File
Hi All,
Can anyone please explain me how can i make dynamic navigation menu in which all navigation item (e.g. about us, services, products) and their values (linking pages) fetch from external file.
I hope u guys understand what i m trying to say.
Nitin
Navigation Menu From External Txt File
Hello,
I wanna ask if anybody know how to make a vertical scrolling menu, where the button names come from a txt file, an also the how many buttons there are are determine in this txt file. Is this possible?
So you can determine almost anything in the txt file :
the name of the buttons (by variable)
how many buttons there most appear
and the links of the buttons
I just don't know how i must define how many buttons there most be
can anyone help me please,
thx
Creating Dynamic Menu Using External Txt File
Hi,
I would like to create a dynamic menu in flash importing the text from an external file. I downloaded an fla from actionscript.org which makes the dynamic menu part (attached the fla & txt) and created a txt file. This is the point where I' m lost: How can I import the text for the menu from that txt file and store it in variable(s) than build the menu. Please help me out if you know the solution for my problem.
Thanx,
Cicus
Creating Dynamic Menu Using External Txt File
Hi,
I would like to create a dynamic menu in flash importing the text from an external file. I downloaded an fla from actionscript.org which makes the dynamic menu part (attached the fla & txt) and created a txt file. This is the point where I' m lost: How can I import the text for the menu from that txt file and store it in variable(s) than build the menu. Please help me out if you know the solution for my problem.
Thanx,
Skunk
Menu -labels External Text File
I want to create a menu which involves 5 links, and all the text labels will be from external text file. once a user click on one of the link, (some file loads to the target movie clip.) and the link gets disabled, so tht it should not allow to click again and load a file again..& its vice-versa when a user cliks on other links as well.. how to do it..
please let me know
Open An External File .txt With A Tree Menu
Hi, i'm sorry if my english is not very well
So.. i have read the tutorial about the tree component, but when i click on one node in the tree menu, it show me only what i do in the text area.
I have modified the xml file:
- <node label="Inbox">
<node label="file" src="file.txt" />
<node label="file" src="file.txt" />
<node label="file" src="file.txt" />
</node>
But i can't open the file when i link it from the menu.
I think the problem is on the Action Script.
But i don't know this language, so i ask you if can help me to change the Script.
Flash MX 2004 External File Info In Menu?
I am using MX 2004
i am not a complete newb but i am very rusty... like 99 was the last time i really worked with flash.
basically what i am doing is makign one of those fancy smooth scrolling menus that you just move the mouse to one side or the other and it scrolls info or thumbnails in that direction... which i have already made... the trick is, i want to update it by just throwing files in a folder... either jpgs or little swfs or whatever (you tell me)... and then having that propogate the menu.
i am relatively sure this is possible but i am having a very hard time finding any tutorials on it because i dont know how exactly it would be phrased.
all help is very very much apreciated
thanks
Infinite Menu Displaying Images From External File
Hi,
I've used the infinite menu tutorial to display images. The images act as buttons with an action for each. however I have a lot of images I would like to have in the menu, and it becomes really long (since we have to have two instances of the movie clip) and also, the loading time takes a while. Is there a way to display the images using xml where it accesses a folder with all the images?
Thanks,
Sooninc
Parsing An External Text File Into Varibles For A Drop Down Menu
I am building a drop down menu for the US states and am getting the file from an external document. the external document is one string with commas separating. How do use actionscript to separate them into variables and have each state have and individual value? Thanks in advance for any help
-Bob
XML & Categories
Hi there,
Iv posted this also in actionscript 1&2 but no replies.
ive been searching the forum for hours but cant exactly find what i need. Im building this navigation/gallery sort a thing and im using KIRUPA's gallery. I know how this thing works now, but i iwant to try something else. I the navigation ive build in the gallery. On every link i want the gallery to swap to a other category of images. I cant figure it OUT.. help please.
here's my code, so far
Code:
//var url = "http://www.cvay.com/new/navigatie/";function loadXML(loaded) { if (loaded) { xmlNode = this.firstChild; image = []; category = []; ctotal= xmlNode.childNodes.length; total = xmlNode.firstChild.childNodes.length; for (i=0; i<total; i++) { image[i] = xmlNode.childNodes[0].childNodes[i].firstChild.firstChild.nodeValue; } for (i=0; i<ctotal; i++) { category[i] = xmlNode.childNodes[i].nodeName; } firstImage(); } else { _parent.nextFrame(); }}var test = new Array(category[i]);trace (test)xmlData = new XML();xmlData.ignoreWhite = true;xmlData.onLoad = loadXML;xmlData.load("nav_images.xml");/////////////////////////////////////c = 0; function nextCategory(){ c++; trace(c); loadXML(); trace(image)}function nextImage() { if (p<(total-1)) { p++; if (loaded == filesize) { main._alpha = 0; main.loadMovie(image[p]); } } if (p ==(total-1)){ p = 0-1; }}function firstImage() { p = 0; if (loaded == filesize) { main._alpha = 0; main.loadMovie(image[0], 1); }}/////////////////////////////////////////////////// PRELOADERonEnterFrame = function() { filesize = _root.main.getBytesTotal(); loaded = _root.main.getBytesLoaded(); var amount:Number = _root.main.getBytesLoaded() / _root.main.getBytesTotal() *100; _root.preloader_mc._visible = true; if (loaded != filesize) { _root.preloader_mc.preload_bar._xscale = 100*loaded/filesize; _root.preloader_mc.loadProc_mc._x = preloader_mc.preload_bar._width - preloader_mc.loadProc_mc._width+20; } else { _root.preloader_mc._visible = false; if (_root.main._alpha<100) { _root.main.alphaTo(100,1,"linear"); } }};
heres the XML
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?><images> <home> <pic> <image>home_1.jpg</image> </pic> <pic> <image>home_2.jpg</image> </pic> <pic> <image>home_3.jpg</image> </pic> <pic> <image>home_3.jpg</image> </pic> </home> <villassale> <pic> <image>villassale_1.jpg</image> </pic> <pic> <image>villassale_2.jpg</image> </pic> <pic> <image>villassale_3.jpg</image> </pic> </villassale></images>
the link for the banner
if someone could explain it to me
thnx
Sorting Xml Categories
hey everyone,
i'm trying to sort out some xml entries based on an attribute when you click a button. an example of my xml is below.
Code:
<list>
<entries cat="all">
<entry cat="category1">
<item>Info</Item>
</entry>
<entry cat="category2">
<item>Info</Item>
</entry>
<entry cat="category1">
<item>Info</Item>
</entry>
</entries>
</list>
the only thing i can figure out is how to sum up how many different categories there are..i'm not even sure if that matters. if anyone could give me advice or some tips i'd greatly appreciate it.
thanks!
Help In Photogallery With Categories
Can someone help me on puting a combobox to load images from XML file into a photogallery like that:
http://www.kirupa.com/developer/mx20...otogallery.htm
Sorting Xml Categories
hey everyone,
i'm trying to sort out some xml entries based on an attribute when you click a button. an example of my xml is below.
Code:
<list>
<entries cat="all">
<entry cat="category1">
<item>Info</Item>
</entry>
<entry cat="category2">
<item>Info</Item>
</entry>
<entry cat="category1">
<item>Info</Item>
</entry>
</entries>
</list>
the only thing i can figure out is how to sum up how many different categories there are..i'm not even sure if that matters. if anyone could give me advice or some tips i'd greatly appreciate it.
thanks!
Photoalbum With Categories
I have created a photo album with categories. but i have to click "category1" button two times to load the thumbnail. on first click it hide the thumbnail and 2nd click it shows the thumbnail.
flowing is the code and let me know where i am doing wrong.
CODE:-
info.text = "Loading...";
my_xml = new XML ();
my_xml.ignoreWhite = true;
my_xml.load ("images.xml");
_root.image = 0;
LastitemTotal = 0;
category = "Its Me";
my_xml.onLoad = function (status)
{
if (status)
{
_root.levelChild = this.firstChild;
category_fn (category);
var mcl:MovieClipLoader = new MovieClipLoader ();
var picListener:Object = new Object ();
mcl.addListener (picListener);
mcl.loadClip (info_xml[0].attributes.source, pic1);
info.text = info_xml[0].attributes.title;
picListener.onLoadInit = function (mc:MovieClip)
{
setPicture (image);
};
}
ZoomOut._visible = false;
ZoomOutText._visible = false;
ZoomInText._visible = true;
};
function setPicture (image)
{
this.onEnterFrame = function ()
{
if (pic1._width > 0)
{
var mcl:MovieClipLoader = new MovieClipLoader ();
var picListener:Object = new Object ();
mcl.addListener (picListener);
mcl.loadClip (info_xml[image].attributes.source, pic1);
info.text = info_xml[image].attributes.title;
picListener.onLoadInit = function (mc:MovieClip)
{
if (mc._height > mc._width)
{
mc._height = 520;
mc._width = 420;
stageWidth = 640;
stageHeight = 560;
mc._x = 27 + (stageWidth - mc._width) / 2;
mc._y = 40 + (stageHeight - mc._height) / 2;
pic1._alpha = 100;
}
else
{
mc._height = 520;
mc._width = 620;
mc._x = 32;
mc._y = 55;
}
};
ZoomInText._visible = true;
ZoomIn._visible = true;
ZoomOutText._visible = false;
ZoomOut._visible = false;
Frame._visible = true;
delete my_xml;
delete this.onEnterFrame;
_root.image = image;
}
};
}
ZoomIn.onRelease = function ()
{
image = _root.image;
var mcl:MovieClipLoader = new MovieClipLoader ();
var picListener:Object = new Object ();
mcl.addListener (picListener);
mcl.loadClip (info_xml[image].attributes.source, pic1);
info.text = info_xml[image].attributes.title;
picListener.onLoadInit = function (mc:MovieClip)
{
ZoomIn._visible = false;
ZoomInText._visible = false;
ZoomOutText._visible = true;
ZoomOut._visible = true;
Frame._visible = false;
thumbnail_mc.enabled = false;
thumbnail_mc._visible = false;
if (mc._height > mc._width)
{
mc._height = 575;
mc._width = 450;
stageWidth = 800;
stageHeight = 600;
mc._x = 2 + (stageWidth - mc._width) / 2;
mc._y = 2 + (stageHeight - mc._height) / 2;
pic1._alpha = 100;
}
else
{
mc._height = 550;
mc._width = 750;
stageWidth = 800;
stageHeight = 600;
mc._x = 10 + ((stageWidth - mc._width) / 2);
mc._y = 10 + ((stageHeight - mc._height) / 2);
}
};
delete my_xml;
delete this.onEnterFrame;
};
ZoomOut.onRelease = function ()
{
delete this.onEnterFrame;
setPicture (image);
ZoomInText._visible = true;
ZoomIn._visible = true;
ZoomOutText._visible = false;
ZoomOut._visible = false;
thumbnail_mc.enabled = true;
thumbnail_mc._visible = true;
};
function thumbNailScroller ()
{
// thumbnail code!
this.createEmptyMovieClip ("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function ()
{
if ((_root._xmouse >= thumbnail_mc._x) && (_root._xmouse <= thumbnail_mc._x + thumbnail_mc._width))
{
if ((_root._ymouse >= (hit_right._y - 40)) && (thumbnail_mc.hitTest (hit_right)))
{
thumbnail_mc._y -= scroll_speed;
}
else if ((_root._ymouse <= 100) && (thumbnail_mc.hitTest (hit_left)))
{
thumbnail_mc._y += scroll_speed;
}
}
else
{
delete tscroller.onEnterFrame;
}
};
}
Category0.onRelease = function ()
{
category_fn ("Gods");
setPicture (0);
};
Category1.onRelease = function ()
{
category_fn ("Its Me");
setPicture (0);
};
function category_fn (category)
{
Total = _root.levelChild.childNodes.length;
for (attr = 0; attr < Total; attr++)
{
if (_root.levelChild.childNodes[attr].attributes.Menu == category)
{
//then count and loop through items in category until found specific item
itemTotal = _root.levelChild.childNodes[attr].childNodes.length;
info_xml = _root.levelChild.childNodes[attr].childNodes;
thumbnails = new Array ();
if (itemTotal < LastitemTotal)
{
unloadclips ();
}
for (i = 0; i < itemTotal; i++)
{
thumbnails[i] = info_xml[i].attributes.thumbnail;
thumbnails_fn (i);
}
}
}
LastitemTotal = itemTotal;
}
function unloadclips ()
{
thumbnail_mc.unloadMovie ();
LastitemTotal = itemTotal - 1;
image_mcl = new MovieClipLoader ();
image_mcl.loadClip (thumbnails, thumbnail_mc);
this.thumbnail_mc.refresh;
this.clear;
}
function thumbnails_fn (k)
{
thumbnail_mc.createEmptyMovieClip ("t" + k, thumbnail_mc.getNextHighestDepth ());
tlistener = new Object ();
tlistener.onLoadInit = function (target_mc)
{
target_mc._y = hit_left._y + (eval ("thumbnail_mc.t" + k)._height + 5) * k;
target_mc.pictureValue = k;
target_mc.onRelease = function ()
{
p = this.pictureValue;
// Draw Picture
setPicture (p);
};
target_mc.onRollOver = function ()
{
this._alpha = 50;
thumbNailScroller ();
};
target_mc.onRollOut = function ()
{
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader ();
image_mcl.addListener (tlistener);
image_mcl.loadClip (thumbnails[k], "thumbnail_mc.t" + k);
}
How To Set An Array Of Categories
Hello Kirupa Forum,
I got this old question ticking in my head: how to get various categories in a xml, like:
<slide category="rooms"/>
<slide category="rooms"/>
<slide category="rooms"/>
<slide category="dinner"/>
<slide category="dinner"/>
<slide category="dinner"/>
<slide category="kitchen"/>
<slide category="kitchen"/>
<slide category="kitchen"/>
<slide category="kitchen"/>
<slide category="kitchen"/>
and fill and array with olny these 3 categories programaticaly, in as 3.0?
XML-gallery With Categories...
Hello!
I'm trying to create an xml/flash video gallery...
this is what my XML-code looks like:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<images>
<category name="Humor">
<pic>
<title>HAHA</title>
<desc>Fun...</desc>
<URL></URL>
<thumb>thumbs 04.jpg</thumb>
</pic>
<pic>
<title>HIHIHOHO</title>
<desc>lalala...</desc>
<URL></URL>
<thumb>thumbs 03.jpg</thumb>
</pic>
</category>
<category name="Music videos">
<pic>
<title>Jack Johnson</title>
<desc>Times like theese</desc>
<URL></URL>
<thumb>thumbs 02.jpg</thumb>
</pic>
<pic>
<title>Jack Johnson</title>
<desc>Times like that other time...</desc>
<URL></URL>
<thumb>thumbs 01.jpg</thumb>
</pic>
</category>
</images>
Now, here's my question...How do I trace the different values, such as category, title and so on....
Thanks
AS3 XML Gallery With Categories?
Hey,
Ok, so I know there are a ton of AS 3.0/XML Gallery tuts out there, but what I just can't find is one that has multiple categories/galleries. I wrote a PHP script that writes an XML file from the the directory of images, in which the XML looks like this:
Code:
<Galleries>
<gallery id=GraphicDesign>
<image>
<largeImg>Images/GraphicDesign/sample1.jpg</largeImg>
<thumbImg>Images/GraphicDesign/thumbImgs/sample1.jpg</thumbImg>
</image>
</gallery>
<gallery id=3Dimages>
<image>
<largeImg>Images/3Dimages/sample1.jpg</largeImg>
<thumbImg>Images/3Dimages/thumbImgs/sample1.jpg</thumbImg>
</image>
</gallery>
<gallery id=WebImages>
<image>
<largeImg>Images/WebImages/sample1.jpg</largeImg>
<thumbImg>Images/WebImages/thumbImgs/sample1.jpg</thumbImg>
</image>
</gallery>
</Galleries>
So basically each gallery node is a folder in the images directory and they will each be a category in the flash gallery. I can't find a flash tut anywhere to teach me how to do that. Only ones that have only one gallery with all the images in. And most of those are coded in the timeline. I've been trying to get it right for weeks, but I'm pretty new to AS (and coding in general) so I'm really bumping my head. Any help or a link to a tutorial would be awesome.
I can't figure out how to use the XML to make a Gallery object that will load all the relevant images and thumbs in that gallery when it is clicked. I can pull off the single gallery vibe, but this multiple gallery stuff is really stumping me.
This is where I am at the moment (it's written in the timeline at the moment, but I will be using classes):
Code:
var loader:URLLoader = new URLLoader();
var fileReq:URLRequest = new URLRequest("galleries.xml");
loader.addEventListener(Event.COMPLETE, xmlLoaded);
loader.load(fileReq);
var xml:XML;
var galleriesXML:XMLList;
var galleries:Array;
function xmlLoaded(event:Event):void
{
galleries = [];
var loader:URLLoader = event.target as URLLoader;
xml = new XML(loader.data);
galleriesXML = new XMLList(xml.child("gallery"))
var numGalleries:uint = galleriesXML.length();
var image:XML;
for (var i:uint = 0; i < numGalleries; i++)
{
image = galleriesXML[i] as XML;
galleries.push( image.@id + image.child("image").child("large") + image.child("image").child("thumb").toString());
}
trace(galleries);
}
The trace outputs:
Code:
Wedding
<large>Wedding/1.jpg</large>
<large>Wedding/2.jpg</large>
<large>Wedding/3.jpg</large>
<large>Wedding/4.jpg</large><thumb>Wedding/thumbs/1.jpg</thumb>
<thumb>Wedding/thumbs/2.jpg</thumb>
<thumb>Wedding/thumbs/3.jpg</thumb>
<thumb>Wedding/thumbs/4.jpg</thumb>,design
<large>design/1.jpg</large>
<large>design/2.jpg</large>
<large>design/3.jpg</large>
<large>design/4.jpg</large><thumb>design/thumbs/1.jpg</thumb>
<thumb>design/thumbs/2.jpg</thumb>
<thumb>design/thumbs/3.jpg</thumb>
<thumb>design/thumbs/4.jpg</thumb>,3D
<large>3D/1.jpg</large><thumb>3D/thumbs/1.jpg</thumb>,FOUR
<large>FOUR/1.jpg</large><thumb>FOUR/thumbs/1.jpg</thumb>
So each 'Gallery' is a string in the galleries array, but I don't really know what to do with that now. I think I'm actually way off base here so some pointers will really be appreciated.
Thanks and enjoy your Christmas tomorrow.
Shane
Accessing Sub-categories Via Xml
I told a friend I would help them with his business' site but have gotten to a point where I am lost. I know how to access a firstChild node and pull all info into an array and display via a combobox. What I need is to pull the next firstChild array into another combobox and then that chosen topic will cause images and text to be uploaded.
I know how to do the first part and the last part but am stuck how to get the second array and put it into the next combobox. I bought 2 actionscript books that have not helped and have searched may help sites. No one mentions how to do this part.
Example xml would be:
Code:
<main category>
<category id="1">
<subcategory id="1">
<item 1 />
<item 2 />
</subcategory id="1">
<subcategory id="2">
</subcategory id="2"
</category id="1">
<category id="2">
</category id="2">
</main category>
the first combobox lists the categories, the second should list the subcategories and when a subcategory is chosen, it lists the items. I have gotten the beginning and the end to work, just not the middle step.
Any help would be appreciated and thanks for your time.
AS3 XML Gallery With Categories?
Hey,
Ok, so I know there are a ton of AS 3.0/XML Gallery tuts out there, but what I just can't find is one that has multiple categories/galleries. I wrote a PHP script that writes an XML file from the the directory of images, in which the XML looks like this:
Code:
<Galleries>
<gallery id=GraphicDesign>
<image>
<largeImg>Images/GraphicDesign/sample1.jpg</largeImg>
<thumbImg>Images/GraphicDesign/thumbImgs/sample1.jpg</thumbImg>
</image>
</gallery>
<gallery id=3Dimages>
<image>
<largeImg>Images/3Dimages/sample1.jpg</largeImg>
<thumbImg>Images/3Dimages/thumbImgs/sample1.jpg</thumbImg>
</image>
</gallery>
<gallery id=WebImages>
<image>
<largeImg>Images/WebImages/sample1.jpg</largeImg>
<thumbImg>Images/WebImages/thumbImgs/sample1.jpg</thumbImg>
</image>
</gallery>
</Galleries>
So basically each gallery node is a folder in the images directory and they will each be a category in the flash gallery. I can't find a flash tut anywhere to teach me how to do that. Only ones that have only one gallery with all the images in. And most of those are coded in the timeline. I've been trying to get it right for weeks, but I'm pretty new to AS (and coding in general) so I'm really bumping my head. Any help or a link to a tutorial would be awesome.
I can't figure out how to use the XML to make a Gallery object that will load all the relevant images and thumbs in that gallery when it is clicked. I can pull off the single gallery vibe, but this multiple gallery stuff is really stumping me.
This is where I am at the moment (it's written in the timeline at the moment, but I will be using classes):
Code:
var loader:URLLoader = new URLLoader();
var fileReq:URLRequest = new URLRequest("galleries.xml");
loader.addEventListener(Event.COMPLETE, xmlLoaded);
loader.load(fileReq);
var xml:XML;
var galleriesXML:XMLList;
var galleries:Array;
function xmlLoaded(event:Event):void
{
galleries = [];
var loader:URLLoader = event.target as URLLoader;
xml = new XML(loader.data);
galleriesXML = new XMLList(xml.child("gallery"))
var numGalleries:uint = galleriesXML.length();
var image:XML;
for (var i:uint = 0; i < numGalleries; i++)
{
image = galleriesXML[i] as XML;
galleries.push( image.@id + image.child("image").child("large") + image.child("image").child("thumb").toString());
}
trace(galleries);
}
The trace outputs:
Code:
Wedding
<large>Wedding/1.jpg</large>
<large>Wedding/2.jpg</large>
<large>Wedding/3.jpg</large>
<large>Wedding/4.jpg</large><thumb>Wedding/thumbs/1.jpg</thumb>
<thumb>Wedding/thumbs/2.jpg</thumb>
<thumb>Wedding/thumbs/3.jpg</thumb>
<thumb>Wedding/thumbs/4.jpg</thumb>,design
<large>design/1.jpg</large>
<large>design/2.jpg</large>
<large>design/3.jpg</large>
<large>design/4.jpg</large><thumb>design/thumbs/1.jpg</thumb>
<thumb>design/thumbs/2.jpg</thumb>
<thumb>design/thumbs/3.jpg</thumb>
<thumb>design/thumbs/4.jpg</thumb>,3D
<large>3D/1.jpg</large>3D/thumbs/1.jpg,FOUR
<large>FOUR/1.jpg</large>FOUR/thumbs/1.jpg
So each 'Gallery' is a string in the galleries array, but I don't really know what to do with that now. I think I'm actually way off base here so some pointers will really be appreciated.
Thanks and enjoy your Christmas tomorrow.
Shane
Making Button Categories?
how do you make a category list below a button when you click on that button?
example:
button name (links)
when you click on the button "links" a menu slides down under it giving 2 more options for navigation. I almost figured it out, but can't nail it in the edit button menu for flash 5.
[F8] Problem With Categories In Quiz
Just wondered if any one can help me. I'm trying to create a quiz for a trip itinery with multiple choice answers. There are 7 possible categories that each answer can fall into.
1. Beach
2. Nature
3. Outback
4. Journeys
5. Aboriginal
6. Food
7. Cities
Some answers have more than one category allocated to them so there is no correct answer as such.
The problem is the way the code is set up only one point is added to each answer but I would like it so any answer can score for more than one category. Sounds confusing I know. I've attached the fla.
Any ideas how I could do that would be most appreciated.
Categories Ina Photo Gallery? Is It Possible?
What I mean is by having my photo gallery and beneath it my arrows and also arrows. Arrows which tell the photo gallery to load a certain category of photos.
any ideas?
Thanx SpitwolF
Flex How To Add Categories To Flexbook?
Hello, I am currently working on a project in flex that involves a flexbook with about 100-120 images.
The flexbook is here
http://www.rubenswieringa.com/blog/f...component-beta
The api is located here
http://www.rubenswieringa.com/code/as3/flex/Book/docs/
I am trying to create a few different categories maybe 8 that load the images dynamically through xml & a php backend
Superviewstack
Pagemanager
Book
Out of those 3 I believe I could create maybe 8 seperate books or 1 book with "children" & grandchildren
I was looking for some help on getting the categories straightened out and also binding the data through xml.
my email is coolcourt@gmail.com and I would greatly appreciate any help.
Photogallery With Multiple Categories
Hi everyone,
I've been searching the site for quite a time now, but did not find any answer how to create a gallery with multiple categories.
I'm making my gallery based on http://www.kirupa.com/developer/mx20...otogallery.htm
Can any body help me with the code?
Thnx in advance
I've attached a link for the stuff I already made...http://www.sendspace.com/file/bjcci8
Categories Ina Photo Gallery? Is It Possible?
What I mean is by having my photo gallery and beneath it my arrows and also arrows. Arrows which tell the photo gallery to load a certain category of photos.
any ideas?
Thanx SpitwolF
Accessing Certain Categories In XML Depending On Choice
Hello,
Let's say that I let the user choose between different categorys and depending on which category the user choose I want to present all information in that category. Everything is gathered from an XML-file.
How would you write the XML-document for this and how would you gather the data dynamically with AS3?
Flash/XML Photo Gallery > Categories
(x-posted in Flash Actionscript)
Hello everyone,
First of all, thank goodness for this website and all the helpful tutorials. I never expected to get this far!
I'm using a combination of the Photo Gallery using XML and Flash (with thumbnails and a simple PHP gallery script called Gallery Thingie. So far, I've got the XML file's image data working with the Flash movie. However, Gallery Thingie also has a feature allowing the creation (and deletion) of image categories. How can I use this feature with the flash gallery?
So far I've added some buttons that would switch between categories, but they don't do much yet since I'm not sure how to say "when this category variable is present, display only thumbnails with that variable." Download the flash file (and others) from the link below.
Code:
ActionScript Code:
/*Code for loading XML file. */
function loadXML(loaded) {
if (loaded) {
/* "xmlNode" is just a faster way of saying "this.firstChild". */
xmlNode = this.firstChild;
image = [];
head = [];
description = [];
thumbnails = [];
category = [];
cat = xmlNode.childNodes[0].firstChild.attributes.cid
/* Finds total number of child nodes (images w/captions to be displayed, in this case). */
total = xmlNode.childNodes[1].childNodes.length;
/* Extracts data from each child node, stopping when the total (defined above) is reached. */
for (i=0; i<total; i++) {
image[i] = "images/"+xmlNode.childNodes[1].childNodes[i].childNodes[0].firstChild.nodeValue;
head[i] = xmlNode.childNodes[1].childNodes[i].childNodes[1].firstChild.nodeValue;
description[i] = xmlNode.childNodes[1].childNodes[i].childNodes[2].firstChild.nodeValue;
category[i] = xmlNode.childNodes[1].childNodes[i].childNodes[3].firstChild.nodeValue;
thumbnails[i] = "images/th_"+xmlNode.childNodes[1].childNodes[i].childNodes[0].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
cat = 0;
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("gt-data.xml");
/////////////////////////////////////
/* Lets the user scroll through with left and right arrow keys. */
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
/* Note the references to button instances previous_btn and next_btn here.*/
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
/* The movie begins, naturally, at the beginning--in XML, that's zero! */
p = 0;
/* Preloader for images. */
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader._visible = true;
} else {
/* Makes preloader invisible once the image starts to fade in. */
preloader._visible = false;
/* Fade in the image. (If the alpha is under 100, add 10.) */
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
/* Load & display the next image. It cleverly calculates whether you are at the end of the
images or not. If you are, the script doesn't run.*/
function nextImage() {
/* If it's less than the total (the last image), let's go ahead and load the next image. */
if (p<(total-1)) {
p++;
if (loaded == filesize) {
/* If it is loaded, set alpha to zero, so that the preloader can fade it in! */
picture._alpha = 0;
/* Put the image where it is supposed to go. */
picture.loadMovie(image[p], 1);
/* Load description into text box "desc_txt" */
desc_txt.text = description[p];
head_txt.text = head[p];
/* Activates the function down below, telling you what number picture you're viewing. */
picture_num();
}
}
}
/* Basically the same as nextImage(), but backwards. Fading and image/text insertion is the same. */
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
head_txt.text = head[p];
picture_num();
}
}
/* Automatically show the first image when the movie is loaded, fade-in and all. */
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
/* Use image[0] instead of image[p] since this only applies to the first image. */
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
head_txt.text = head[0];
picture_num();
}
}
/* Thumbnail list. */
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc._alpha = 50;
target_mc.onRollOver = function() {
this._alpha = 100;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 50;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=40) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
/* Displays current position and total number of pictures. */
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
Code for XML:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<gallery>
<categories>
<category cid="0">Monkeys</category>
<category cid="1">Sample</category>
</categories>
<images>
<image id="0">
<file>image1.jpg</file>
<title>Pig Tailed Something</title>
<description>This is really easy.</description>
<imgcategory>0</imgcategory>
</image>
<image id="1">
<file>image2.jpg</file>
<title>Wooly Monkey</title>
<description>Here's another!</description>
<imgcategory>0</imgcategory>
</image>
<image id="2">
<file>image3.jpg</file>
<title>Photo</title>
<description>Something by Peter Laytin.</description>
<imgcategory>1</imgcategory>
</image>
</images>
</gallery>
I'd appreciate any help I can get!
Combobox With Deactivated Items [Categories]?
hey guys, is it possible to make it so that certain items in a dropdown have deactivated items because i want to have categories like:
Main
Option1
Option2
Blah
Option3
Option4
is it possible for Main, Blah to also have different font color?
XML Photo Gallery With Thumbnails (Now Need Categories)
First post all.
Just wanted to say these are some really great tutorials. I'm in the midst of making a personal website and have really hit the grindstone designing a photo gallery. With the help of the tutorials I was able to create the gallery with thumbnails drawing from an XML file.
Now, before I go any further I would really like to know how to add onto this by giving it some categories. SO when a person selects the text (or button), the pictures switch to the appropriate category.
It doesn't help that Actionscript and me go together like Oil and water...so any help would be greatly appreciated!
Thanks!
Photo Gallery With Thumbs And Categories
Hello everyone, Im new to gotoAndLearn and I must say this site is awsome for new flash users. Well...Ive been using flash for some time but havent fully learned actionscript, and am still somewhat "green" to the whole thing. In the process now of building a site and looking towards a photo gallery. During my search on google I came across this very sleek xml gallery on a template site. You can have a look here.....
Ive also come across some others on here and Kirupa and Flashkit but all I find are slide shows, which is great but I cant seem to find any tutorial or direction on building one like I have posted. So basically Im looking for any tutorial or some direction on a gallery with thumbnails and categories a user can select from. Perhaps someone may know of an example I can look at?
Any help is greatly appreciated and I look forward to learning alot about actionscript and Flash on here and hopefully help out as much as I can.
Design Inspiration Site Broken Into Categories?
Hey Guys,
A while ago I ran into a great site that posted links to design inspiring sites, organized under categories such as "clean", "professional", "whimsical", "high tech", ect...
Does anyone know what I'm talking about?
I'm trying to find a clean / dreamy / relaxed flash site...
Thanks!
Loading Random Categories With Scenes (Help Needed)
This is a project I've been working on for a while now and I almost have it running properly except for one thing. Here is the situation:
- A screen loads with a "compass" and a button that will make it spin.
- There is a possible 8 random categories that the compass can land on.
- When the compass stops spinning it is suppose to go to the Numbered Scene, but instead it doesn't do anything.
I would normally do this with loadMovie() instead of a gotoAndPlay(scene) but I need to evenually pass a variable and I can't do that with loadMovie().
here is a download of the file: http://www.legion-e.ca/rob/compass3.fla
Any help would be greatly appreciated!
Thanks!
Kirupa's Flash/XML Photo Gallery > Categories?
Hello everyone,
I'm using a combination of the Photo Gallery using XML and Flash (with thumbnails and a simple PHP gallery script called Gallery Thingie. So far, I've got the XML file's image data working with the Flash movie. However, Gallery Thingie also has a feature allowing the creation (and deletion) of image categories. How can I use this feature with the flash gallery?
So far I've added some buttons that would switch between categories, but they don't do much yet since I'm not sure how to say "when this category variable is present, display only thumbnails with that variable." Download the flash file (and others) from the link below.
ActionScript Code:
/*Code for loading XML file. */
function loadXML(loaded) {
if (loaded) {
/* "xmlNode" is just a faster way of saying "this.firstChild". */
xmlNode = this.firstChild;
image = [];
head = [];
description = [];
thumbnails = [];
category = [];
cat = xmlNode.childNodes[0].firstChild.attributes.cid
/* Finds total number of child nodes (images w/captions to be displayed, in this case). */
total = xmlNode.childNodes[1].childNodes.length;
/* Extracts data from each child node, stopping when the total (defined above) is reached. */
for (i=0; i<total; i++) {
image[i] = "images/"+xmlNode.childNodes[1].childNodes[i].childNodes[0].firstChild.nodeValue;
head[i] = xmlNode.childNodes[1].childNodes[i].childNodes[1].firstChild.nodeValue;
description[i] = xmlNode.childNodes[1].childNodes[i].childNodes[2].firstChild.nodeValue;
category[i] = xmlNode.childNodes[1].childNodes[i].childNodes[3].firstChild.nodeValue;
thumbnails[i] = "images/th_"+xmlNode.childNodes[1].childNodes[i].childNodes[0].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
cat = 0;
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("gt-data.xml");
/////////////////////////////////////
/* Lets the user scroll through with left and right arrow keys. */
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
/* Note the references to button instances previous_btn and next_btn here.*/
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
/* The movie begins, naturally, at the beginning--in XML, that's zero! */
p = 0;
/* Preloader for images. */
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader._visible = true;
} else {
/* Makes preloader invisible once the image starts to fade in. */
preloader._visible = false;
/* Fade in the image. (If the alpha is under 100, add 10.) */
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
/* Load & display the next image. It cleverly calculates whether you are at the end of the
images or not. If you are, the script doesn't run.*/
function nextImage() {
/* If it's less than the total (the last image), let's go ahead and load the next image. */
if (p<(total-1)) {
p++;
if (loaded == filesize) {
/* If it is loaded, set alpha to zero, so that the preloader can fade it in! */
picture._alpha = 0;
/* Put the image where it is supposed to go. */
picture.loadMovie(image[p], 1);
/* Load description into text box "desc_txt" */
desc_txt.text = description[p];
head_txt.text = head[p];
/* Activates the function down below, telling you what number picture you're viewing. */
picture_num();
}
}
}
/* Basically the same as nextImage(), but backwards. Fading and image/text insertion is the same. */
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
head_txt.text = head[p];
picture_num();
}
}
/* Automatically show the first image when the movie is loaded, fade-in and all. */
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
/* Use image[0] instead of image[p] since this only applies to the first image. */
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
head_txt.text = head[0];
picture_num();
}
}
/* Thumbnail list. */
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc._alpha = 50;
target_mc.onRollOver = function() {
this._alpha = 100;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 50;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=40) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
/* Displays current position and total number of pictures. */
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
Code for XML:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<gallery>
<categories>
<category cid="0">Monkeys</category>
<category cid="1">Sample</category>
</categories>
<images>
<image id="0">
<file>image1.jpg</file>
<title>Pig Tailed Something</title>
<description>This is really easy.</description>
<imgcategory>0</imgcategory>
</image>
<image id="1">
<file>image2.jpg</file>
<title>Wooly Monkey</title>
<description>Here's another!</description>
<imgcategory>0</imgcategory>
</image>
<image id="2">
<file>image3.jpg</file>
<title>Photo</title>
<description>Something by Peter Laytin.</description>
<imgcategory>1</imgcategory>
</image>
</images>
</gallery>
I'd appreciate any help I can get!
Add Pages To Categories In V3 Muliti Dynamic Gallery
Hi,
I think I have seen this question answered but I can't find the thread.
If someone can give me a link to this or a tut on how I can get this done that would be great.
In the meantime what I am trying to do is:
I have 5 categories.
Each category holds 10 images
If the category has 15 images how do I add a page to that category
Thanks,
ponyack
Help Needed Getting XML Photo Gallery Categories Working
Hi, I searched through the forum and haven't really found a clear cut answer as to how to get categories working with the kirupa xml photo gallery. I read on one of the posts that I should make a "multi-dimensional array" that sorts through the XML file when certain buttons are clicked. I just don't really understand how to go about doing this. I "get" how to setup the XML file for this type of thing, but when it comes to working with the array and possibly removing the thumbnails and larger image off the stage and then reinitializing the loadXML function, I can't seem to figure out how to go about doing it. I've been searching the web to no avail for this same answer. I'd greatly appreciate any help I could get on this issue. Thank you.
Search Arrays, Return Value If Matches Are Found Within Categories
I'm trying to build a flash script for a class project, but I'm not sure where to start. I'm fairly new to actionscript, and have yet to do any complex stuff with it.
For my project, I want the user to type in 10 musical artists they like, and it will display what percentage of their total music interest is with the three top recording companies (for example the results would be: 30% sony bmg, 20% universal records, 10% warner music, 40% independent). I have txt files for each company containing a list of all their signed artists. I think I know how to make these into arrays in flash. How can I get Flash to search for each of the 10 artists, return what array they are in, and make a variable for each?
I'm capable of displaying the info when it gets generated, but I haven't found an example of an array search that searches multiple arrays and brings back the array in which the value is found.
Any help with this is appreciated. If anyone has an interest in this project (making a personal map of the corporate connections with music), I'd like to collaborate with someone who's able to script it in Flash (if heavy coding is involved), and will give credit where it's due.
Many thanks
Richard
XML Help With Adding Categories To Gallery With Thumbnails And Larger Pictures
Hi, I was looking at http://www.kirupa.com/developer/mx2004/thumbnails.htm tutorial, This tutorial Almost has exactly what I want.
But being new to XML and the action script associated with it, I'm a bit lost when it comes to adding new things. Basically i want to have Album categories the same way the thumbnails work so their is a mask limiting 4 categories on screen and when you click < or > arrows next to the categories it shows the next 4 categories that you would be able to choose from.
Then I would want it to load whatever category you selected into the thumbnails and the larger pic.
Does anyone know how to do this ? Or if their is another tutorial that would show me how to add categories into something like a gallery with thumbnails?
Apologies for being stupid and the poor grammar
I've been searching everywhere to find out how i can add in some categories and still have it linked to the thumbnail scroller and larger images, but i haven't found any luck at all I just want it so you could add in as many thumbs and categories as you wanted and have those masked and scrollable rather then a dropdown.
I paid for some silly pdfs to explain it better to me but they did it in a way that I didn't like and turned out just to be a waste of money. Learnt my lesson and signed up here to ask the pros! Hope you can help me out. I want to create something that can be updated from just an xml file.
I also Added a quick jpg to kind of illustrate what i want to have happen :/
Any information or direction you can provide is highly appreciated.
Xml-Gallery 'multi Categories', Cant Remove-reload Thumbs
Hi, im desperated, its 4 days im in troumble
Basicly im tempting to modify a xml gallery with just 1 category in a "2 or more" (multi) Category the same xml gallery
First thing i've added at the Xml a node (splitted in 2 categories)
At frame 9 is the Xml loading, where i let load the first category (0) :
//******************* frame "load xml" (9) *******************************
var imgArray:Array = new Array();
var myImages:XML = new XML();
myImages.ignoreWhite = true;
//
function loadGallery(whichGallery) {
rootNode = myImages.firstChild.childNodes[whichGallery].childNodes;
var totalMenu:Number = rootNode.length;
// Informazioni da nodo "set"
s_thumbWidth = int(rootNode[0].attributes.thumbWidth);
s_thumbHeight = int(rootNode[0].attributes.thumbHeight);
s_pausecountdown = int(rootNode[0].attributes.pauseCountdown);
s_slideSpeed = rootNode[0].attributes.slideSpeed;
s_autoStart = rootNode[0].attributes.autoStart;
s_imageScale = rootNode[0].attributes.scaleImageToFit;
// Le immagini
imgArray = new Array();
for (i=1; i<totalMenu; i++) {
m_big = rootNode[i].childNodes[1].firstChild.nodeValue;
m_small = rootNode[i].childNodes[2].firstChild.nodeValue;
m_title = rootNode[i].childNodes[0].firstChild.nodeValue;
m_desc = rootNode[i].childNodes[3].firstChild.nodeValue;
imgArray.push([m_big, m_small, m_title, m_desc]);
}
gotoAndStop("done");
}
//
myImages.onLoad = function(success) {
loadGallery(0); // first category
};
myImages.load("_xml/gal1.xml");
//************************************************** *****************
After, at frame "done" (17) the restant function to create thumbs, navigation etc. and 2 test buttons to "switch" the 2 categories
Here the actionscript with (i think) more important parts (all should be too long)
//******************* frame "done" (17) *******************************
// start
.............. cont .................
//
var root:MovieClip = this;
var totalItems:Number = imgArray.length;
var autoStart:String = s_autoStart;
var imageScale:String = s_imageScale;
var mvSec:Number = s_slideSpeed;
var mvEase:Object = mx.transitions.easing.Regular.easeOut;
var totalRounds:Number = 5*1000/50;
var timerInc:Number = 100/totalRounds;
var leftrightgap:Number = 100;
var gapinmyCP:Number = 6;
var curImage:Number = 0;
//
.............. cont .................
//
var image:MovieClip = root.createEmptyMovieClip("image", root.getNextHighestDepth());
var imageHolder:MovieClip = image.createEmptyMovieClip("imageHolder", image.getNextHighestDepth());
var imageHolderDone:MovieClip = image.createEmptyMovieClip("imageHolderDone", image.getNextHighestDepth());
var mainpre:MovieClip = root.attachMovie("pre", "mainpre", root.getNextHighestDepth());
trace("mainpre: "+mainpre);
var buttons:MovieClip = root.myCP.t_hol.createEmptyMovieClip("buttons", root.myCP.t_hol.getNextHighestDepth());
var mask:MovieClip = root.myCP.t_hol.attachMovie("mask", "t_mask", root.myCP.t_hol.getNextHighestDepth());
mask.cacheAsBitmap = true;
buttons.cacheAsBitmap = true;
buttons.setMask(mask);
root.myCP.swapDepths(root.getNextHighestDepth());
root.myInfo.swapDepths(root.getNextHighestDepth()) ;
root.lil_img.swapDepths(root.getNextHighestDepth() );
root.imageHolder._alpha = 0;
root.imageHolderDone._alpha = 0;
//
root.lil_img.t_img._x = root.lil_img.t_msk._x=5;
root.lil_img.t_img._y = root.lil_img.t_msk._y=5;
root.lil_img.t_msk._width = root.s_thumbWidth;
root.lil_img.t_msk._height = root.s_thumbHeight;
root.lil_img.t_bg._width = root.s_thumbWidth+9;
root.lil_img.t_bg._height = root.s_thumbHeight+10;
root.lil_img.t_pointer._y = root.lil_img.t_bg._y+root.lil_img.t_bg._height;
root.lil_img.t_pointer._x = root.s_thumbWidth/2;
root.lil_img._alpha = 0;
//
for (i=0; i<totalItems; i++) {
var th:MovieClip = root.lil_img.t_img.createEmptyMovieClip("t"+i, root.lil_img.t_img.getNextHighestDepth());
var img:MovieClip = th.createEmptyMovieClip("img", th.getNextHighestDepth());
var pre:MovieClip = th.attachMovie("pre", "pre", th.getNextHighestDepth());
//img.loadMovie(root.imgArray[i][1]);
//trace(img);
myLoader.loadClip(root.imgArray[i][1], img);
th._x = (root.s_thumbWidth+5)*i;
pre._x = (root.s_thumbWidth+5)/2;
pre._y = (th._y+root.s_thumbHeight)/2;
pre._alpha = 0;
//
var b:MovieClip = buttons.attachMovie("button", "b"+i, buttons.getNextHighestDepth());
if (i<9) {
b.txt.text = "0"+(i+1);
} else {
b.txt.text = i+1;
}
b._x = (b._width+gapinmyCP)*i;
b.no = i;
b.onRollOver = rollIn;
b.onRollOut = b.onReleaseOutside=rollOt;
b.onRelease = showImage;
}
root.totalbtnwidth = b._x+b._width;
root.myCP.t_hol.attachMovie("inv", "buttonsbg", buttons.getNextHighestDepth());
root.myCP.t_hol.buttonsbg.onRollOver = moveLilImg;
root.myCP.t_hol.buttonsbg._y -= root.myCP.t_hol._y-root.myCP.t_bg11._height;
root.myCP.t_hol.buttonsbg._height = root.myCP.t_bg._height;
root.myCP.t_hol.buttonsbg._width = root.totalbtnwidth;
root.myCP.t_hol.buttonsbg._alpha = 0;
//
showImage(root.curImage);
listner.onResize();
// end
//************************************************** *****************
"switching" with 2 buttons
//************************************************** *****************
root.bottone_cat_1.onRelease = function() {
loadGallery(0);
showImage(0);
};
root.bottone_cat_2.onRelease = function() {
loadGallery(1);
showImage(0);
};
//************************************************** *****************
The problem is that the "switching" by categories from the xml data works, but the thumbnails still the first loaded at the start
I tryied to make some function with delete, unloadMovie(), removeMovieClip() .. to, when there is the categories-change , remove the old thumbs and recreate the news one, but...nothing ... its 4 days im trying ...
Xml-Gallery 'multi Categories', Cant Remove-reload Thumbs
Hi, im desperated, its 4 days im in troumble
Basicly im tempting to modify a xml gallery with just 1 category in a "2 or more" (multi) Category the same xml gallery
First thing i've added at the Xml a node (splitted in 2 categories)
At frame 9 is the Xml loading, where i let load the first category (0) :
//******************* frame "load xml" (9) *******************************
var imgArray:Array = new Array();
var myImages:XML = new XML();
myImages.ignoreWhite = true;
//
function loadGallery(whichGallery) {
rootNode = myImages.firstChild.childNodes[whichGallery].childNodes;
var totalMenu:Number = rootNode.length;
// Informazioni da nodo "set"
s_thumbWidth = int(rootNode[0].attributes.thumbWidth);
s_thumbHeight = int(rootNode[0].attributes.thumbHeight);
s_pausecountdown = int(rootNode[0].attributes.pauseCountdown);
s_slideSpeed = rootNode[0].attributes.slideSpeed;
s_autoStart = rootNode[0].attributes.autoStart;
s_imageScale = rootNode[0].attributes.scaleImageToFit;
// Le immagini
imgArray = new Array();
for (i=1; i<totalMenu; i++) {
m_big = rootNode[i].childNodes[1].firstChild.nodeValue;
m_small = rootNode[i].childNodes[2].firstChild.nodeValue;
m_title = rootNode[i].childNodes[0].firstChild.nodeValue;
m_desc = rootNode[i].childNodes[3].firstChild.nodeValue;
imgArray.push([m_big, m_small, m_title, m_desc]);
}
gotoAndStop("done");
}
//
myImages.onLoad = function(success) {
loadGallery(0); // first category
};
myImages.load("_xml/gal1.xml");
//************************************************** *****************
After, at frame "done" (17) the restant function to create thumbs, navigation etc. and 2 test buttons to "switch" the 2 categories
Here the actionscript with (i think) more important parts (all should be too long)
//******************* frame "done" (17) *******************************
// start
.............. cont .................
//
var root:MovieClip = this;
var totalItems:Number = imgArray.length;
var autoStart:String = s_autoStart;
var imageScale:String = s_imageScale;
var mvSec:Number = s_slideSpeed;
var mvEase:Object = mx.transitions.easing.Regular.easeOut;
var totalRounds:Number = 5*1000/50;
var timerInc:Number = 100/totalRounds;
var leftrightgap:Number = 100;
var gapinmyCP:Number = 6;
var curImage:Number = 0;
//
.............. cont .................
//
var image:MovieClip = root.createEmptyMovieClip("image", root.getNextHighestDepth());
var imageHolder:MovieClip = image.createEmptyMovieClip("imageHolder", image.getNextHighestDepth());
var imageHolderDone:MovieClip = image.createEmptyMovieClip("imageHolderDone", image.getNextHighestDepth());
var mainpre:MovieClip = root.attachMovie("pre", "mainpre", root.getNextHighestDepth());
trace("mainpre: "+mainpre);
var buttons:MovieClip = root.myCP.t_hol.createEmptyMovieClip("buttons", root.myCP.t_hol.getNextHighestDepth());
var mask:MovieClip = root.myCP.t_hol.attachMovie("mask", "t_mask", root.myCP.t_hol.getNextHighestDepth());
mask.cacheAsBitmap = true;
buttons.cacheAsBitmap = true;
buttons.setMask(mask);
root.myCP.swapDepths(root.getNextHighestDepth());
root.myInfo.swapDepths(root.getNextHighestDepth()) ;
root.lil_img.swapDepths(root.getNextHighestDepth() );
root.imageHolder._alpha = 0;
root.imageHolderDone._alpha = 0;
//
root.lil_img.t_img._x = root.lil_img.t_msk._x=5;
root.lil_img.t_img._y = root.lil_img.t_msk._y=5;
root.lil_img.t_msk._width = root.s_thumbWidth;
root.lil_img.t_msk._height = root.s_thumbHeight;
root.lil_img.t_bg._width = root.s_thumbWidth+9;
root.lil_img.t_bg._height = root.s_thumbHeight+10;
root.lil_img.t_pointer._y = root.lil_img.t_bg._y+root.lil_img.t_bg._height;
root.lil_img.t_pointer._x = root.s_thumbWidth/2;
root.lil_img._alpha = 0;
//
for (i=0; i<totalItems; i++) {
var th:MovieClip = root.lil_img.t_img.createEmptyMovieClip("t"+i, root.lil_img.t_img.getNextHighestDepth());
var img:MovieClip = th.createEmptyMovieClip("img", th.getNextHighestDepth());
var pre:MovieClip = th.attachMovie("pre", "pre", th.getNextHighestDepth());
//img.loadMovie(root.imgArray[i][1]);
//trace(img);
myLoader.loadClip(root.imgArray[i][1], img);
th._x = (root.s_thumbWidth+5)*i;
pre._x = (root.s_thumbWidth+5)/2;
pre._y = (th._y+root.s_thumbHeight)/2;
pre._alpha = 0;
//
var b:MovieClip = buttons.attachMovie("button", "b"+i, buttons.getNextHighestDepth());
if (i<9) {
b.txt.text = "0"+(i+1);
} else {
b.txt.text = i+1;
}
b._x = (b._width+gapinmyCP)*i;
b.no = i;
b.onRollOver = rollIn;
b.onRollOut = b.onReleaseOutside=rollOt;
b.onRelease = showImage;
}
root.totalbtnwidth = b._x+b._width;
root.myCP.t_hol.attachMovie("inv", "buttonsbg", buttons.getNextHighestDepth());
root.myCP.t_hol.buttonsbg.onRollOver = moveLilImg;
root.myCP.t_hol.buttonsbg._y -= root.myCP.t_hol._y-root.myCP.t_bg11._height;
root.myCP.t_hol.buttonsbg._height = root.myCP.t_bg._height;
root.myCP.t_hol.buttonsbg._width = root.totalbtnwidth;
root.myCP.t_hol.buttonsbg._alpha = 0;
//
showImage(root.curImage);
listner.onResize();
// end
//************************************************** *****************
"switching" with 2 buttons
//************************************************** *****************
root.bottone_cat_1.onRelease = function() {
loadGallery(0);
showImage(0);
};
root.bottone_cat_2.onRelease = function() {
loadGallery(1);
showImage(0);
};
//************************************************** *****************
The problem is that the "switching" by categories from the xml data works, but the thumbnails still the first loaded at the start
I tryied to make some function with delete, unloadMovie(), removeMovieClip() .. to, when there is the categories-change , remove the old thumbs and recreate the news one, but...nothing ... its 4 days im trying ...
Xml Multi-categories Gallery W/t Masked Images Sequence
I'm trying to do somenthing similar at this site with some adding :
http://www.shiroganeya.co.jp/main_en.html
, but lately i decided to release free full source (I dont know if will be usefull to someone..), a sort of 'open-source', because my AS skillfull has limits ... the collettive can help.
Just, ... if someone can optimize or improve it, or find some bugs, just the correctness to release it at attention of the forum.
Its a gallery generated from xml, use Caurina Tweener , As2 Player 8, (naturally to test it better see it online or with the test Movie).
Basically i didnt improved yet the moving part (passage from a gallery to another), that its not my main goal, but im trying to optimize all the other functionality.
Some parts i trying to improve are:
1 - Some problems with stopping and restarting the automatic-slideshow (with the buttons Stop/Play Slideshow or/and clicking on thumbs) (the clock react strange ... to check better)
2 - Clicking on thumbs when the mask over the image still moving, reacts not so smootly, should be better that after click, the mask over the image finish to slide, and at the end load the new image? or other solutions? ...
Example : Link
All file are here: Link
About Caurina Tweener : Link
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I see also sometime a little bug ... at the start or when theres a gallery change, at the first image opening, the mask open in strange way ... open for 15 - 20 %, then return at 0 %, then re-open normally to 100 % (or 50 + 50 if doble is 1..)
Just a question ... someone can help me to optimize this applications ? ... also if i have to pay a fee for that, please contact me ... im getting crazy to make it stable ...
XML Categories And An Infinite Gallery Problems: Source Files And KITTENS
Hi all,
I'm new, obviously, and unfortunately I need to make my entrance by asking a question since I am quite stumped.
I saw the resizing image gallery thread, and found it amazingly helpful. Here is the thing: I am trying to make a gallery that loads from an XML file that has 5 categories of pictures (much like the 'V3 with thumbs scrolled' version that was posted). However, I am trying to make the menu an infinite instead of a scroll.
Obviously, since each category of images has a different length, the infinite menu needs to reload each time and be of a different length. I thought I had done this correctly, but apparently not. Because it just sits there.
Oh, and I've switched out all the pictures for pictures of kittens. Just because.
Any help would be highly appreciated!
Here is the link to the zip file
Save External File, Print External File
from within a FlashMX interface....how do I use actionscript to call a file (powerpoint) and save it?
also, how would I call a Word file and print it?
any ideas welcome and appreciated.
Thank You!
andrea
Drop Down Menu PROBLEM-Down State For Sub-menu Item Linked To External SWFs?
Hi nice to meet everyone. The drop down menu I'm referring to is located in the main movie. The menu is a movie clip with the buttons inside and I have each button as 'track as menu item' in the properties. The buttons are linked to external swfs that load in the empty movie clip on the main movie stage. Everything loads perfectly no problem. I can't seem to figure out the right code to put on the sub-menu items/buttons in the drop down menu to show the 'down' state when the corresponding movie is loaded (i.e., about-main button, philosphy(menu item). When the 'philosphy' swf loads how do I get the 'philosphy' button that is in the main movie to show the 'down' state until another button is pressed on the menu? I hope I explained myself clear enough without confusing anyone!
Below is a sample of the code that I currently have on the the regular buttons that DO NOT sub-menu items:
on (release) {
gotoAndStop("home");
_root.contents.loadMovie("home.swf");
}
And here is the code that I currently have on the main buttons that have sub-menu items:
on (release) {
_root.contents.loadMovie("philosphy2.swf");
setProperty("_root.home", _visible, "0");
}
I have searched everywhere on the net, tutorials and still can't find the answer, I've been working on this for almost a week now and I just can't get it right.
Thanks again your help is greatly appreciated!
Drop Down Menu-Down State For Sub-menu Item Linked To External SWFs?
Hi nice to meet everyone. The drop down menu I'm referring to is located in the main movie. The menu is a movie clip with the buttons inside and I have each button as 'track as menu item' in the properties. The buttons are linked to external swfs that load in the empty movie clip on the main movie stage. Everything loads perfectly no problem. I can't seem to figure out the right code to put on the sub-menu items/buttons in the drop down menu to show the 'down' state when the corresponding movie is loaded (i.e., about-main button, philosphy(menu item). When the 'philosphy' swf loads how do I get the 'philosphy' button that is in the main movie to show the 'down' state until another button is pressed on the menu? I hope I explained myself clear enough without confusing anyone!
Below is a sample of the code that I currently have on the the regular buttons that DO NOT sub-menu items:
ActionScript Code:
on (release) {
gotoAndStop("home");
_root.contents.loadMovie("home.swf");
}
And here is the code that I currently have on the main buttons that have sub-menu items:
ActionScript Code:
on (release) {
_root.contents.loadMovie("philosphy2.swf");
setProperty("_root.home", _visible, "0");
}
I have searched everywhere on the net, tutorials and still can't find the answer, I've been working on this for almost a week now and I just can't get it right.
Thanks again your help is greatly appreciated!
Http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=15&catid=194&CFID=49663705&CFTOKEN=514ef5869ab79ed6-
Hello to anyone who might help...
I am creating a completely dynamic flash site (example problem: http://www.playdown.com/testing/testing.swf) that's pulling all of its information from xml files. Everything was lovely until I tested it in Firefox and Safari. They don't load the images!?! I went into preferences for the browsers and made them as friendly as possible but still no luck. By visiting http://www.playdown.com/testing/testing.swf you'll see what's happening. It doesn't make any sense to me. Sometimes when I reload the page it works.
Do Mozilla and Safari have known xml issues?
Any help in this matter would be greatly appreciated!!
|