Need dynamic Photo Gallery
Hi
I am new, not expert in flash. Knows only basic flash action
scripting, can any body guide me about dynamic flash photo gallery.
How can import images in flash from database.
please help me, I need that urgently, all suggestions are
welcome.
Regards
Harish
Hey harish ... unfortunately, developing with flash has some
serious trade-offs. The benefit is making a rich user experience.
However, data integration can often be a much more involved
process. Here are some suggestions for you.
With .net you could publish a webservice. Flash has built a
built in component for consuming webservices.
Your .net guy should know what a webservice is and how to
implement it.
Alternatively, you could have a server side script that, when
called, spits back an xml representation of the data you want to
put into flash.
for example:
<root>
<pic1 title="pic1Title" uri="/pics/pic1" ... />
<pic2 ... />
</root>
or however you want to form your xml.
Flash has built in support for consuming xml in this way
through the xmlconnector component or even just the xml
class.
It would be nice if there was a built in way to communicate
directly with databases.
Flash wanted to make their product vendor nuetral so as far
as I know, there is no way to make a connection directly with a
database with flash out of the box.
I know there are third party addons you can purchase that
will help you do that as another option as well.
One thing that has worked well for me in situations similar
to what you are discussing is using the apache xindice database
combined with the xml class in flash.
The xindice database is an open source project.
It is a database designed specifically to store xml
documents.
http://xml.apache.org/xindice/
I use java and xindice is built in java, but it has two
api's. One for developers writing in javaee and one for developers
writing in other languages.
Or hey, you could always drop a few grand on coldfusion :-)
Probably not the answers you want, but I hope it helps
anyway.
Similar Messages
-
Hi,
I am creating an iPad app using AS3. The app contains three sections.
One of those sections (chocolate sources)contains Dynamic Photo Gallery using XML. The photos, thumbnails, and text in this section are loaded from XML.
I faced may issue when I tried to run this app:
The gallery photos didn't show up
The thumbnails (buttons to navigate the photo gallery) didn't show up at all. (The thumbnails should show up under the photo gallery box.)
The text doesn't show up (the text should be in every photo as describtion)
I want to include Swipe in the photo gallery, how can I do that?
When I click on "Chocolate Sources" button, the photo gallery appears in every section, here are print screens describe what I mean:
The photo gallery covers the home screen too.
Here is my XML:
<?xml version="1.0" encoding="utf-8"?>
<sources>
<section>
<details>
Cocoa tree exists in the tropics area, such as Central and South America.
</details>
<image>
<url>coca1.jpg</url>
</image>
</section>
<section>
<details>
Cocoa is supplied in many countries such as Indonesia, Ghana, Brazil, Ecuador and Cameroon.
</details>
<image>
<url>coca2.jpg</url>
</image>
</section>
<section>
<details>
Dark chocolate helps to relax and reduce the stress and blood pressure because it has antioxidants elements, which helps in vasodilatory process.
</details>
<image>
<url>coca3.jpg</url>
</image>
</section>
<section>
<details>
Chocolate provides energy and hyperactive sometimes because it contains high level of caffeine and sugar.
</details>
<image>
<url>coca4.jpg</url>
</image>
</section>
<section>
<details>
Chocolate could be mixed with many different flavors, such as mint, strawberry, orange, banana, vanilla, hazelnut, almond, coconut, and etc.
</details>
<image>
<url>coca5.jpg</url>
</image>
</section>
<section>
<details>
Chocolate is expressing of well hospitality and good time due to its lovely taste.
</details>
<image>
<url>coca6.jpg</url>
</image>
</section>
</sources>
And here is my Action Script for "Chocolate Sources" section:
stop();
function Choco1(evt:MouseEvent): void {
gotoAndStop('16');
choco_btn.addEventListener(MouseEvent.CLICK,Choco1);
function Souc1 (evt:MouseEvent): void {
gotoAndStop ('31');
souc_btn.addEventListener(MouseEvent.CLICK,Souc1);
function ShopIn1 (evt:MouseEvent):void {
gotoAndStop('46');
shops_btn.addEventListener(MouseEvent.CLICK,ShopIn1);
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.display.MovieClip;
import flash.display.Loader;
import fl.motion.MotionEvent;
import flash.events.MouseEvent;
import flash.sampler.NewObjectSample;
import flash.text.TextFormat;
var xmlLoader: URLLoader = new URLLoader (new URLRequest("sources.xml"));
xmlLoader.addEventListener(Event.COMPLETE, finishedXmlLoader);
var xmlFile:XML;
var xextend:int = 10;
var gal:galary = new galary ();
gal.x = 85;
gal.y = 165;
addChild(gal);
var txfe: TextField = new TextField ();
txfe.x = 25;
txfe.y = 45;
var tformat:TextFormat = new TextFormat ();
tformat.bold = true;
tformat.color = 0xFFFFFF;
tformat.size = "18";
tformat.font = "Arial";
txfe.defaultTextFormat = tformat;
addChild(txfe);
function finishedXmlLoader (e:Event): void{
xmlFile = new XML (xmlLoader.data);
var leng:int = xmlFile.image.length();
txfe.text = xmlFile.image.details[0];
for (var i:int = 0;i<leng;i++){
var b:thumbs = new thumbs ();
b.x = xextend;
b.y = 480;
b.buttonMode = true;
b.details = (i+1).toString();
addChild(b);
b.addEventListener(MouseEvent.MOUSE_OVER, theMosover);
b.addEventListener(MouseEvent.MOUSE_OUT, theMosout);
b.addEventListener(MouseEvent.CLICK, onMosClick);
var bloader:Loader = new Loader();
bloader.load(new URLRequest("thumbs/" + (i+1) + ".jpg"));
b.addChild(bloader);
xextend += b.width + 50;
var loader:Loader = new Loader ();
loader.load(new URLRequest ("pictures/coca1.jpg"));
gal.addChild(loader);
function theMosover(m:MotionEvent):void{
m.currentTarget.alpha = 0.5;
function theMosout (m:MouseEvent):void{
m.currentTarget.alpha = 1.0;
function onMosClick(m:MouseEvent):void{
var loader:Loader = new Loader();
loader.load(new URLRequest("pictures/" + m.currentTarget.details + ".jpg"));
gal.addChild(loader);
txfe.text = xmlFile.image.details[int(m.currentTarget.details) -1];
I need an urgent help to fix the errors and make this section work well.
thanks.try:
txfe.text = xmlFile.section[int(m.currentTarget.details) -1].details;
instead of
txfe.text = xmlFile.image.[int(m.currentTarget.details) -1];
and add your thumbs to gal, not the stage. when you're done with the gallery, remove gal. -
Dynamic Photo Gallery with Static Links
The Dynamic Photo Gallery has a Dynamic List Menu generated from the galleries.xml file.
I would like to load the Dynamic Galleries with a link if possible. Currently I have 3 Galleries.... China, Eqypt & Paris
Dynamic Code:
<select name="gallerySelect" id="gallerySelect" onchange="dsGalleries.setCurrentRowNumber(this.selectedIndex);" spry:repeatchildren="dsGalleries" spry:choose="choose">
<option spry:when="{ds_RowNumber} == {ds_CurrentRowNumber}" selected="selected">{sitename}</option>
<option spry:default="default">{sitename}</option>
</select>
I am using some code from V1 that generates a Gallery List as follows:
<ul spry:repeatchildren="dsGalleries">
<li><a href="#{ds_RowNumber}" onclick="dsGalleries.setCurrentRowNumber(this.href.replace(/\#/g,''));">{sitename}</a></l i>
</ul>
This works to display the dynamic Galleries but, the links do not connect to the specific galleries.
Can anyone please help with this?
Thank you,
W BellSorry for not beeing to respond to your issue sooner, but i'm having some deadlines that needed to be worked on.
This works to display the dynamic Galleries but, the links do not connect to the specific galleries.
Can anyone please help with this?
Can you resend me the url again, as i needed clear my inbox because i reached maximum amount of messages. -
superb post for a Dynamic photo gallery using a xml generated flex application http://flexlearner.wordpress.com/2009/09/04/dynamic-photo-gallery-in-flex/
try:
txfe.text = xmlFile.section[int(m.currentTarget.details) -1].details;
instead of
txfe.text = xmlFile.image.[int(m.currentTarget.details) -1];
and add your thumbs to gal, not the stage. when you're done with the gallery, remove gal. -
1.6 Dynamic Photo Gallery
I previously used the 1.5 version to make a Photo Gallery and
added the following piece of code to show captions to the photos:
<div id="picture">
<div id="mainImageCaption"
spry:detailregion="dsPhotos">{@caption}</div>
<div id="mainImageOutline" style="width: 0px; height:
0px;"><img id="mainImage" alt="main image" /></div>
This does not appear to work in the new 1.6 Dynamic version
of the Gallery, which I wish to use as a much more efficient
method. Any ideas how to add this feature (do gallery_init.js,
gallery_xds.js or screen.css need adapting)?Hi,
I was able to get the caption to show up with a few minor
changes to few of the files. The changes I made do not make the
caption appear on only the first image when in slideshow mode.
After the first image, they'll appear. Also, If you click on the
thumb, they'll show up. Find the changes with the file names below:
================== index.html =================
1) in the div with id thumbnails, add the following to the
<a> tag: id="{ds_RowID}"
2) In the div with id picture, add another div with id
captionText:
<div id="picture">
<div id="captionText"></div>
<div id="mainImageOutline"><img id="mainImage"
alt="main image" src=""/></div>
</div>
================== gallery_init.js ===============
1) modify the signature of InitializeGallery function to take
in the dataset as a parameter:
function InitializeGallery(ds)
2) replace the gThumbViewer.addObserver with the following:
gThumbViewer.addObserver(function(notificationType,
notifier, data)
if(!data)
return;
if (notificationType == "onSelect")
gImageViewer.setImage(data.href);
var row = ds.getRowByID(data.id);
Spry.$('captionText').innerHTML =
row['photos/photo/@caption'];
========================= gallery_xds.js =================
change the call to InitializeGallery function (line 86) by
passing in the data set:
InitializeGallery(dsPhotos);
======================= XML files ==================
add in your caption text as an attribute of the photo tag,
just like path, thumbpath, etc are.
====================== SpryThumbViewer.js ==========
in the Spry.Widget.ThumbViewer.prototype.select function,
modify the calls to notifyObservers to accpet 'a' instead of
'a.href':
if (a)
//this.notifyObservers("onSelect", a.href);
this.notifyObservers("onSelect", a);
if (img == imgs[0])
this.notifyObservers("onFirstSelect", a);
if (img == imgs[imgs.length - 1])
this.notifyObservers("onLastSelect", a);
I think that's about it. Give it a try and let me know if
there are any other problems. -
Dynamic photo gallery script?
Can anyone suggest a good photo gallery script?
My client is a photographer and needs a user-friendly system
where he can
create galleries, upload images. He also needs to assign
usernames/passwords
to each gallery. I was going to use Coppermine, but it has
too many bells
and whistles. I need to keep it very simple.
Thanks for you help.
J.P. Luisi
Lulu Digital Design
Making You Stand Out Online!
www.luludigital.com
905-832-2428Sorry for not beeing to respond to your issue sooner, but i'm having some deadlines that needed to be worked on.
This works to display the dynamic Galleries but, the links do not connect to the specific galleries.
Can anyone please help with this?
Can you resend me the url again, as i needed clear my inbox because i reached maximum amount of messages. -
Hi,
I downloaded a applet for a rotating flash photo gallery.
However, I can't see any instructions for how to modify the
actionscript...There are a few comments, but they dont seem to be
sufficient.
Here is the script a part of the gallery:
// prototype function for fixing the scaling and position of
images
movieclip.prototype.do_me = function () {
var w = 540;
var h = 400;
var k = this._width / this._height;
if (k > 1.35) {
this._width = 540;
this._yscale = this._xscale;
this._y=0-(this._height/2);
this._x=0-(this._width/2);
} else {
this._height = 400;
this._xscale = this._yscale;
this._y=0-(this._height/2);
this._x=0-(this._width/2);
var ap="{parameterstorage}";
var ts="{timestamp}";
var panel=parseInt("{panel}",10);
var radius=parseInt("{radius}",10);
var ysens=parseInt("{ysens}",10);
var xsens=parseInt("{xsens}",10);
var mousespeed=parseInt("{mousespeed}",10);
var minspeed=parseInt("{minspeed}",10);
var breakfactor=parseInt("{breakfactor}",10);
var zoomtime=parseInt("{zoomtime}",10);
var zoomamount=parseInt("{zoomamount}",10);
var sbg = parseInt("{sbg}",10);
var square = parseInt("{square}",10);
var urls="{urls}";
var target="{target}";
var cmode = parseInt("{cmode}",10);
var backgroundcolor=parseInt("{backgroundcolor}");
var bgi="{backgroundimage}";
var width=parseInt("{width}",10);
var height=parseInt("{height}",10);
var maxitems=parseInt("{maxitems}",10);
var ts=-1;
var maxitems=5;
var panel=22;
var radius=250;
var ysens=100;
var xsens=10;
var mousespeed=60;
if (minspeed<=0) {
minspeed=5;
minspeed/=100;
if (Math.abs(breakfactor)>10) {
breakfactor=10;
breakfactor/=10;
if (zoomtime<0) {
zoomtime=2;
zoomtime*=50;
var zoomamount=2;
var urls="
http://www.mandomartis.com/|http://www.effectmaker.com|http://www.yahoo.com||";
var target="_self";
var backgroundcolor=0xffffff;
var width=640;
var height=480;
var lm = "{lm}"; var lmxy = "{lmxy}";
var lm = lm.split("|");
var lmxy = lmxy.split("|");
for (i=0; i<lm.length; i++) if (lm
.length>3) {
attachMovie("lom", "lm" add i, i+6+maxitems);
var xy = lmxy.split(",");
setProperty("lm" add i, _x, xy[0]);
setProperty("lm" add i, _y, xy[1]);
eval("lm" add i).loadMovie(lm
function initApplet() {
moviearea._x=width/2;
moviearea._y=height/2;
activated=true;
var today=new Date();
activated=true;
//url's initialisation
urls=urls.split("|");
// bgnd activation
bgnd._x=-width/2
bgnd._y=0;
bgnd._width=width;
bgnd._height=height;
bgndColor=new Color(bgnd);
bgndColor.setRGB(backgroundcolor);
if (sbg>0) bgnd._visible = true; else bgnd._visible =
false;
if (bgi.length>0)
bgholder._x=-width/2;
bgholder._y=0;
bgholder.backgroundimage._width=width;
bgholder.backgroundimage._height=height;
bgnd._visible=false;
// duplicating main clip
for (var a=0;a<maxitems;a++) {
newarea = "area"+a;
duplicateMovieClip ("moviearea", newarea, a+5);
this[newarea].item_num=a;
this[newarea].theta = a*360/maxitems;
this[newarea].panel = panel;
this[newarea].radius = radius;
this[newarea].gotoAndPlay(2);
if (square==0) this[newarea].control._alpha=0;
// moviearea._x = -1000;
// moviearea._visible = false;
moviearea.gotoAndPlay (2);
this._x = (width/2);
initApplet();// prototype function for fixing the scaling and
position of images
movieclip.prototype.do_me = function () {
var w = 540;
var h = 400;
var k = this._width / this._height;
if (k > 1.35) {
this._width = 540;
this._yscale = this._xscale;
this._y=0-(this._height/2);
this._x=0-(this._width/2);
} else {
this._height = 400;
this._xscale = this._yscale;
this._y=0-(this._height/2);
this._x=0-(this._width/2);
var ap="{parameterstorage}";
var ts="{timestamp}";
var panel=parseInt("{panel}",10);
var radius=parseInt("{radius}",10);
var ysens=parseInt("{ysens}",10);
var xsens=parseInt("{xsens}",10);
var mousespeed=parseInt("{mousespeed}",10);
var minspeed=parseInt("{minspeed}",10);
var breakfactor=parseInt("{breakfactor}",10);
var zoomtime=parseInt("{zoomtime}",10);
var zoomamount=parseInt("{zoomamount}",10);
var sbg = parseInt("{sbg}",10);
var square = parseInt("{square}",10);
var urls="{urls}";
var target="{target}";
var cmode = parseInt("{cmode}",10);
var backgroundcolor=parseInt("{backgroundcolor}");
var bgi="{backgroundimage}";
var width=parseInt("{width}",10);
var height=parseInt("{height}",10);
var maxitems=parseInt("{maxitems}",10);
var ts=-1;
var maxitems=5;
var panel=22;
var radius=250;
var ysens=100;
var xsens=10;
var mousespeed=60;
if (minspeed<=0) {
minspeed=5;
minspeed/=100;
if (Math.abs(breakfactor)>10) {
breakfactor=10;
breakfactor/=10;
if (zoomtime<0) {
zoomtime=2;
zoomtime*=50;
var zoomamount=2;
var urls="
http://www.mandomartis.com/|http://www.effectmaker.com|http://www.yahoo.com||";
var target="_self";
var backgroundcolor=0xffffff;
var width=640;
var height=480;
var lm = "{lm}"; var lmxy = "{lmxy}";
var lm = lm.split("|");
var lmxy = lmxy.split("|");
for (i=0; i<lm.length; i++) if (lm.length>3) {
attachMovie("lom", "lm" add i, i+6+maxitems);
var xy = lmxy.split(",");
setProperty("lm" add i, _x, xy[0]);
setProperty("lm" add i, _y, xy[1]);
eval("lm" add i).loadMovie(lm);
function initApplet() {
moviearea._x=width/2;
moviearea._y=height/2;
activated=true;
var today=new Date();
activated=true;
//url's initialisation
urls=urls.split("|");
// bgnd activation
bgnd._x=-width/2
bgnd._y=0;
bgnd._width=width;
bgnd._height=height;
bgndColor=new Color(bgnd);
bgndColor.setRGB(backgroundcolor);
if (sbg>0) bgnd._visible = true; else bgnd._visible =
false;
if (bgi.length>0)
bgholder._x=-width/2;
bgholder._y=0;
bgholder.backgroundimage._width=width;
bgholder.backgroundimage._height=height;
bgnd._visible=false;
// duplicating main clip
for (var a=0;a<maxitems;a++) {
newarea = "area"+a;
duplicateMovieClip ("moviearea", newarea, a+5);
this[newarea].item_num=a;
this[newarea].theta = a*360/maxitems;
this[newarea].panel = panel;
this[newarea].radius = radius;
this[newarea].gotoAndPlay(2);
if (square==0) this[newarea].control._alpha=0;
// moviearea._x = -1000;
// moviearea._visible = false;
moviearea.gotoAndPlay (2);
this._x = (width/2);
initApplet();
sorry for the long post; basically I fairly new to flash and
not familair with actionscript at all. I figure that most of what
is need is number signifing the speeds. Which i added by removing
the curly brackets and adding a number,
i.e var maxitems=parseInt("10",10);
but I dont know how to insert my images....I've tried
various things but i only end up with empty spinning boxes.
If someone could start me off with where i put the images i
may be able to complete it myself , but the more help the better
really as I dont really have a clue and I dont know where to look
for basic knowledge on actionscript language.
Thanks alot in advance,
LizHave you tried in Acrobat: Tools->Print Production->Convert Color?
-
Dynamic photo gallery with XML
My photo gallery works fine when I test movie in gallery.fla
I have a thumbnail scroller that moves the thumbnails right
when you move mouse left and left when you move mouse right.
When you click on a thumb a larger picture is displayed. This
all works fine in gallery.swf
But when I load gallery.swf to main.swf in an empty movie
clip using loadMovie
it loads put the scroller doesnt work. Everything else works
but when I move mouse left or right the thumbnails dont move.
Any suggestions?This is the code for the scroller
function scroller() {
if (this._ymouse>mcScroller._y &&
this._ymouse<mcScroller._y+mcScroller._height) {
var scrollSpeed = (this._xmouse-Stage.width/2)/10;
if (Math.abs(scrollSpeed)<1) {
scrollSpeed = 0;
mcScroller._x -= scrollSpeed;
if (mcScroller._x>0) {
mcScroller._x = 0;
} else if (mcScroller._x<Stage.width-mcScroller._width) {
mcScroller._x = Stage.width-mcScroller._width;
} -
I'm working on a website right now, and I've run across a
particular style of photo gallery that I'd like to duplicate. This
is the page:
http://www.reubenrogers.com/photos.htm
There are thumbnail images that you click on to view the
larger image, and when you click - instead of opening a new HTML
document, the background dims and the picture appears above
everything else. I know it's not flash, I'm guessing XHTML? I've
tried copying the code and putting in my own images to see if I can
make the action occur, but I haven't been able to get it to work
like this page. Looking at the source code it looks like it might
have been created with some kind of template, which I've tried to
investigate but I've gotten no where. I'm not having trouble
setting something like this up design-wise, it's the code to make
the action occur. Any thoughts?It' s being done with ajax. You will find these link helpfull
for you:
http://www.huddletogether.com/projects/lightbox/ -
1.6 Dynamic Photo Gallery - alt and title attributes from xml file?
Hi!
I would like to attach information to my gallery images from
the XML-file used by the gallery.
Especially the alt and title attributes for the "img
id="mainImage"-tag would add a bit more user friendliness.
I found
this
example about adding caption to images very help full and
everything worked just fine, thanks to clear information!
(http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=602&threadi d=1306782&enterthread=y)
Could someone come up with an example of adding title/alt
attributes values from XML file?
I'm sure there are quite a few out ther who would like to see
a solution to this ;)You need to add your info to the XML.
So something like:
<photo
path = "travel_01.jpg"
width = "263"
height = "350"
title="my title"
alt_text="Alt Text"
thumbpath = "travel_01.jpg"
thumbwidth = "56"
thumbheight = "75">
</photo>
Then in your detailregion:
<img src="{dsData::large/@base}{@path}" alt="{@alt_text}
title="{@title}" />
I am using
http://www.adobe.com/devnet/dreamweaver/articles/spry_photo_album.html
as the source of my samples...
So, just add the data to the XML and then you will have these
attributes available as data references.
Hope this helps.
Don -
Photo Gallery with captions?
Hey folks
I've added the new version of the dynamic photo gallery to my
site. It works great! But, I'd like to be able to have a caption
under each photo.. can anyone help?
I made a div under it, added a style, it displays just fine
and in the right place, I just can't get it to read the captions
from the XML file.
The HTML is basically just
<div>{name}</div>
And then my XML looks like this..
<photos id = "images">
<photo
path = "1.jpg"
width = "400"
height = "320"
thumbpath = "1-t.jpg"
thumbwidth = "100"
thumbheight = "80"
name = "pic1">
</photo>
<name>Pic1</name>
<photo
path = "2.jpg"
width = "343"
height = "400"
thumbpath = "2-t.jpg"
thumbwidth = "86"
thumbheight = "100">
</photo>
<name>Pic2</name>
</photos>
But it's not showing the text inside the <name> tag..
can anyone help me get this working? I'm really stuck
:(the SEARCH option does miracles
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=602&threadid =1298486&highlight_key=y&keyword1=caption -
How to make a photo gallery?
hello every body
let me make it simple.
i need a photo gallery like this:
www.albertsoncreative.com
and i use flash cs3
plz explain completely and easily
I really am a noob!
Thank uI just finished making my first photo gallery and it was
really hard - because it was my first project in flash - Ive been
using this website - they have video tutorials - check out the
gallery on this page and if its what u want, click on "watch"
below.
http://www.tutvid.com/tutorials_pages_subs/FLASH/photogallery1.html -
Goof-proof photo gallery for client?
I have a web client, for whom I have created a website, who wants to be able to upload photo documentation of projects they are doing for their clients' review. My client is completely without a clue - so I need a Photo Gallery I can install on their site, but that THEY can administer through a web-based form - no ftp access or anything like that. They'd also like to be able to password-protect the individual albums on the site so that they are only accessible to the particular client the album pertains to.
Any suggestions?I'm afraid you are overestimating my client's abilities. I need something with a simple html-based form for them to upload their photos, with captions, so that THEIR clients can then go to a "secret" link, enter a password, and see their own project's photos.
I've come to the conclusion that anything I could add to their website would be out of the reach of their web development budget. I think I will suggest they try a pbase account with password protected albums, then try to customize the appearance of the pages for them to mimic their website as closely as possible.
Thanks for the comments, perhaps I didn't make my dilemma clear enough. -
Advanced photo gallery - need help with MCs
Hello all. I have a photo gallery I am creating that can
contain up to 120 images. Rather than create buttons and movie
clips for each, I am hoping to dynamically build it with 1 movie
clip. But I am having trouble with my code. Here's what I am trying
to do:
Duplicate a movie clip on the stage with an instance name of
e1, giving each successive MC an instance name of e[i+1]
load external images into each movie clip representing images
e1 through e120
set the alpha of the movie clip to 50%
then onRollOver:
Set alpha to 100%, resetting to 50% onRollOut
onPress
assign a variable equal to the image loaded (e1 - e120)
pop up a box and pass the variable into it, which will then
load a larger version of the same image being called from a
different folder.
That being said, here's my flawed code
var i:Number;
for (i = 0; i < 119; i++) {
this.holder.duplicateMovieClip; //duplicates the MC holder
already on the stage
this._name = "e"+i;
this["e"+i]_x = _x + 50;
this["e"+i]._alpha = 50;
this.loadMovie("images/thumbnails/e" + i + ".jpg");
This code is not working on anything other than the first MC.
Here is the code for mouseover functions:
var i:Number;
for (i = 0; i < 119; i++) {
this["e"+i].onRollOver=function() {this["e"+i]._alpha=100};
this["e"+i].onRollOut=function() {this["e"+i]._alpha=50};
this["e"+i].onPress=function() {
_root.myVar = ["e"+i];
_root.myLargeImage.gotoAndPlay(2)
The problem with this section of code is that the dynamically
loaded movie clips do not accept any event commands (onRollOver,
onPress, etc). It is fine before I load external jpegs, but not
noce they are loaded
Any help would be GREATLY appreciated.
ThanksYou rollover code doesn't work because you are assigning the
functions
before you load the images. The loaded images remove your
code. You should
not use loadMovie and use the MovieClipLoader class instead.
Then, in its
onLoadInit method you can assign your functions - so that
they are assigned
after the clip is loaded. Also, I'd either just create empty
clips, on the
fly, to load into or attach from the library. And
duplicateMovieClip is not
a property it is a method - calling like you are doing will
not work. If
you'd look in the Help you'll see that duplicateMovieClip can
accept an init
object, and also returns a ref to the new clip... So your
code can be much
simplified:
this.holder.duplicateMovieClip; //duplicates the MC holder
already on the
stage
this._name = "e"+i;
this["e"+i]_x = _x + 50;
this["e"+i]._alpha = 50;
To:
this.holder.duplicateMovieClip("e" + i,
this.getNextHighestDepth(),
{_x:theX, _alpha:50});
And you can't set _x to _x + 50 like that... for one you'd
need to use more
like this._x = this._x + 50 or this._x += 50. But it still
won't work here
since all the new clips are going to be created at x=0. You
need to
increment a variable... or base the spacing on your loop
variable, i - like
i *50.
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ -
Magnify effect in photo gallery, need help...
Heya,
So if you visit
http://www.hookmedia.biz/cabinet_source/v4_f
and navigate to the "Gallery" page you'll see that, below the area
the large photo is displayed, there is a "film strip" of thumbnail
photo's. I need these photos to be magnified when you mouseover
them but I'm unsure of exactly how to do that. Can anyone help?
You can download the entire .fla via this link:
http://www.hookmedia.biz/cabinet_source/v4_f/index/fla
Once downloaded, double click on the main content area
(titled content_mc) and navigate to the second frame and open the
"photo_gallery" or "gallery" folder where you'll find the first
layer is actionscript for the photo gallery.
Thanks!You rollover code doesn't work because you are assigning the
functions
before you load the images. The loaded images remove your
code. You should
not use loadMovie and use the MovieClipLoader class instead.
Then, in its
onLoadInit method you can assign your functions - so that
they are assigned
after the clip is loaded. Also, I'd either just create empty
clips, on the
fly, to load into or attach from the library. And
duplicateMovieClip is not
a property it is a method - calling like you are doing will
not work. If
you'd look in the Help you'll see that duplicateMovieClip can
accept an init
object, and also returns a ref to the new clip... So your
code can be much
simplified:
this.holder.duplicateMovieClip; //duplicates the MC holder
already on the
stage
this._name = "e"+i;
this["e"+i]_x = _x + 50;
this["e"+i]._alpha = 50;
To:
this.holder.duplicateMovieClip("e" + i,
this.getNextHighestDepth(),
{_x:theX, _alpha:50});
And you can't set _x to _x + 50 like that... for one you'd
need to use more
like this._x = this._x + 50 or this._x += 50. But it still
won't work here
since all the new clips are going to be created at x=0. You
need to
increment a variable... or base the spacing on your loop
variable, i - like
i *50.
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/
Maybe you are looking for
-
How to remove App from iPhone, but not iPad
I have an App that I would like to keep in my iTunes library, but only Sync to my iPad -- not my iPhone. Right now, the App has been 'deselected' from my iPhone, but the associated file size did not decrease. My iPhone still has 1GB more than I wou
-
Is it possible to transfer an apple dev account from one apple id to a different apple id?
I am 15 years old and I am thinking about setting up a apple dev account, but I can't do it on my apple ID since you have to be above the legal age of majority. So what I am wondering is that when I become the age of majority is it possible to transf
-
Please help me choose a 42" plasma
Hi - I've got basic cable, a TIVO Series 2, a BOSE 3-2-1 (dvd/movie sound), a WII, and actually a VHS (because the family doesn't want to part with or replace a collection) all run through a once-decent SONY. Nothing hooks up with HDMI. I'd like to
-
Auto Distribution of Event Registration
Part 1. Can I distribute my event form (as part of the Outlook email or as an attachment) using an excel database of email addtresses? Part 2. Is FormsCentral capable of tracking registrants and sending reminders only to non-registered attendees? **S
-
Problem export pdf table to excel spreadsheed
Hi, my name is Marco. Last month a customer has bought a copy of Adobe Acrobat Professional 9 in my computer shop for edit some pdfs files. After some days he told me that he need to export a table to excel's spreadsheet but the function "open table