Protecting A Xml Based Gallery From Being Locally Run
Hi guys and girls, been up all night, having troubles thinking logically so bare with me..
My question is in relation to an image gallery I have. Users have to register before they can gain access to this gallery through a registration system I have setup. Now that all works fine, but Im wondering whether my login strategy is the safest option and most logical. You see currently a user logs in by filling in a Flash based form (login.swf), which if valid after quering the mysql db then in-turn loads the gallery.swf file which contains the image gallery. Now of coarse due to the caching of the gallery.swf file, and the fact this gallery runs off an xml file any user can run the gallery locally, which is good for useabiloty but terrible for security
Any ideas? Should I put the login form into gallery.swf? and do away with login.swf?
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 05-18-2005, 06:02 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Protecting A Xml Based Gallery From Being Locally Run
Hi guys and girls,
been up all night, having troubles thinking logically so bare with me..
My question is in relation to an image gallery I have. Users have to register before they can gain access to this gallery through a registration system I have setup. Now that all works fine, but Im wondering whether my login strategy is the safest option and most logical. You see currently a user logs in by filling in a Flash based form (login.swf), which if valid after quering the mysql db then in-turn loads the gallery.swf file which contains the image gallery. Now of coarse due to the caching of the gallery.swf file, and the fact this gallery runs off an xml file any user can run the gallery locally, which is good for useabiloty but terrible for security
Any ideas?
Should I put the login form into gallery.swf? and do away with login.swf?
Help My Gallery Works Locally But Not On Web?
I created a simple slide show that uses MovieClipLoader to load thumbnails into a clip at the bottom of the stage and then cycle through the full-size images on the main stage. It works fine at home (even when loading the files from the web since I hard-coded the URLs for the images).
When I post the swf file, nothing none of the images show up.no errors, nothing. Please tell me there is a simple solution. I am about to lose this client over this and I really need some help.
Thanks in advance,
jase.
XML Gallery Loads Locally But Not Online
I'm brand, brand new to flash and have built this site primarily copying and pasting different sections of code. To a certain extent I understand what I'm doing with the Actionscript I'm using, but in this case the code is beyond me. I copied the general idea from the gallery_tween.swf in the samples folder of Flash 8 help.
The swf loads jpgs from a folder using an xml file. I have a few galleries that all use similar code. All load 100% locally on my computer. Now that I've uploaded them to the server some load 100%, some load 90%, some load 50% etc.
So what is a full gallery locally shows up online as random pics with gaps. I can't figure out what is causing particular conflicts with the pics that are missing.
I've seen this post come up a few times, but the solution is usually to check spelling, capitalization, relative folder location, etc. which I've double and triple checked for accuracy.
The issue can be seen at www.richandroyal.com in the Gallery section. The Magnum section loads as it does on my computer locally and the other sections, Beckman, Amanda, and Promotional have the gaps I'm referring to.
Is the movie stopping for finishing the load? Has anyone come across and fixed this problem before?
Xml-Gallery From Tutorial Does Not Load Images In Www But Work On Pc Locally
Hello!
I did the tutorial of the gallery that loads images from a xml-file. It works fine on my pc but when i put it into the web problems appear. The swf loads but the content not - means that you get the preloader bar for the images but nothing appears.
Does anyone know why? What can it be? I mean, it works locally so whats the problem? A file name or what?
Any help is greatly appreciated.
Greetings,
Evia
AS3 XML Based Gallery
Hey, I'm trying to build an XML based image gallery in AS3. However, I'm having some troubles. Are there any quality tutorials that explain it pretty much from scratch? Everything I can find is fairly geared towards one specific gallery that you are supposed to make, and the code is very hard to turn into what I want.
Thanks for your help,
Overshee
Looking For Xml Based Photo Gallery
Can anyone give me an .fla to a simple xml based photo gallery or link me to one. I'm looking for something specific:
xml file that has caption copy
main image path
thumbnail path
main image size can be customized.
thumb size can be customized
fla. should allow user to scroll through thumbs with mouse
layout should be main image on top
optional captions below main image
thumbs in a horizontal row below caption and can be scrolled through by moving mouse left to right.
that's pretty much the gist of it
i've seen stuff for sale but nothing that fits the bill perfectly at a good cost.
Can anyone help? Maybe customize something for me. I can work in flash but I am not strong on the AS. Oh yea, i've seen stuff in titorials but I don't have the time now.
Thx
Image Gallery Xml Based
Hi All,
I'm trying to create a image gallery that has next and previous buttons as well as direct buttons. eg. click on #15 and it will show #15. pretty simple, i guess...
here's what I have, the next, previous works, but the direkt thing doesnt. Thanks for your help,
mucho
--
images_xml = new XML();
images_xml.onLoad = startImageViewer;
images_xml.load("xml/images.xml");
images_xml.ignoreWhite = true;
function startImageViewer(success) {
if (success == true) {
rootNode = images_xml.firstChild;
totalImages = rootNode.childNodes.length;
firstImageNode = rootNode.firstChild;
currentImageNode = firstImageNode;
currentIndex = 1;
updateImage(firstImageNode);
}
}
function updateImage(newImageNode) {
imagePath = newImageNode.attributes.imgURL;
targetClip.loadMovie(imagePath);
imageCount = "Viewing image " + currentIndex + " of " + totalImages;
}
next_btn.onRelease = function() {
nextImageNode = currentImageNode.nextSibling;
if (nextImageNode == null) {
break;
} else {
currentIndex++;
updateImage(nextImageNode);
currentImageNode = nextImageNode;
}
};
back_btn.onRelease = function() {
previousImageNode = currentImageNode.previousSibling;
if (previousImageNode == null) {
break;
} else {
currentIndex--;
currentImageNode = previousImageNode;
updateImage(previousImageNode);
}
};
button01.onRelease = function() {
previousImageNode = imageNode01;
if (previousImageNode == null) {
break;
} else {
currentIndex--;
currentImageNode = previousImageNode;
updateImage(previousImageNode);
}
};
button02.onRelease = function() {
nextImageNode = currentImageNode.nextSibling;
if (nextImageNode == null) {
break;
} else {
currentIndex++;
updateImage(nextImageNode);
currentImageNode = nextImageNode;
}
};
button03.onRelease = function() {
nextImageNode = imageNode03;
if (nextImageNode == null) {
break;
} else {
currentIndex++;
updateImage(nextImageNode);
currentImageNode = nextImageNode;
}
};
the XML file
<?xml version="1.0"?>
<IMAGES>
<imageNode imgURL="images/01.jpg" />
<imageNode imgURL="images/02.jpg" />
<imageNode imgURL="images/03.jpg" />
</IMAGES>
<IMAGESDIRECT>
<imageNode01 imgURL="images/01.jpg" />
<imageNode02 imgURL="images/02.jpg" />
<imageNode03 imgURL="images/03.jpg" />
</IMAGESDIRECT>
How Do I Create An XML Based Gallery?
Hi,
my portfolio site has been updated several times this past month.
and since it was a pretty "static" portfolio, I had to add each work manually,
link it to the site, create an animation for the button... a complete mess.
anyway,
I want to create a dynamic gallery using XML (or arrays in Flash, whichever is better)
the XML should contain for each work the following details:
- the gif filename which represents the work (which should turn to color on rollover and to B/W or rollout )
- the URL
- a description of the work.
where do I start?
Thanks.
Gallery Based On Xml Like In Tutorial, But....
Hi
I try to make galery based on xml, just like in tutorial http://www.kirupa.com/developer/mx20...otogallery.htm , but i wanna, that preloading will be not before every picture, bu t just one in start. First load all jpg from xml, and then start to looking at it.
Could someone help me with this? I'm begginer in AS, so plese, help.
Sorry if my english isn't as wel, as it should.
Image Gallery Xml Based
Hi All,
I'm trying to create a image gallery that has next and previous buttons as well as direct buttons. eg. click on #15 and it will show #15. pretty simple, i guess...
here's what I have, the next, previous works, but the direkt thing doesnt. Thanks for your help,
mucho
--
images_xml = new XML();
images_xml.onLoad = startImageViewer;
images_xml.load("xml/images.xml");
images_xml.ignoreWhite = true;
function startImageViewer(success) {
if (success == true) {
rootNode = images_xml.firstChild;
totalImages = rootNode.childNodes.length;
firstImageNode = rootNode.firstChild;
currentImageNode = firstImageNode;
currentIndex = 1;
updateImage(firstImageNode);
}
}
function updateImage(newImageNode) {
imagePath = newImageNode.attributes.imgURL;
targetClip.loadMovie(imagePath);
imageCount = "Viewing image " + currentIndex + " of " + totalImages;
}
next_btn.onRelease = function() {
nextImageNode = currentImageNode.nextSibling;
if (nextImageNode == null) {
break;
} else {
currentIndex++;
updateImage(nextImageNode);
currentImageNode = nextImageNode;
}
};
back_btn.onRelease = function() {
previousImageNode = currentImageNode.previousSibling;
if (previousImageNode == null) {
break;
} else {
currentIndex--;
currentImageNode = previousImageNode;
updateImage(previousImageNode);
}
};
button01.onRelease = function() {
previousImageNode = imageNode01;
if (previousImageNode == null) {
break;
} else {
currentIndex--;
currentImageNode = previousImageNode;
updateImage(previousImageNode);
}
};
button02.onRelease = function() {
nextImageNode = currentImageNode.nextSibling;
if (nextImageNode == null) {
break;
} else {
currentIndex++;
updateImage(nextImageNode);
currentImageNode = nextImageNode;
}
};
button03.onRelease = function() {
nextImageNode = imageNode03;
if (nextImageNode == null) {
break;
} else {
currentIndex++;
updateImage(nextImageNode);
currentImageNode = nextImageNode;
}
};
the XML file
<?xml version="1.0"?>
<IMAGES>
<imageNode imgURL="images/01.jpg" />
<imageNode imgURL="images/02.jpg" />
<imageNode imgURL="images/03.jpg" />
</IMAGES>
<IMAGESDIRECT>
<imageNode01 imgURL="images/01.jpg" />
<imageNode02 imgURL="images/02.jpg" />
<imageNode03 imgURL="images/03.jpg" />
</IMAGESDIRECT>
An XML Based Flash Photo Gallery
Hi everyone,
Here is an XML flash photo gallery that I made. It is just a simple one but flash beginners can learn many things about action scripts. You can download and learn all source codes. Hope that would be useful to you.
Loading An External Gallery Based On Xml
im trying to load an external movie clip named gallery.swf (which is based on xml) to be loaded into my main movie...
it seems my external movie clip is replacing the main movie.
i want it to be loaded inside it not in place of it.
here is the code of the gallery.swf:
[code]var imageArray = new Array();
imageXML = new XML();
imageXML.onLoad = function ()
{
var __reg3 = undefined;
var __reg4 = undefined;
__reg4 = this.firstChild;
this.loadThumbsAtOnce = int(__reg4.attributes.loadthumbsatonce);
this.bgColor = __reg4.attributes.bgcolor;
this.pnlColor = __reg4.attributes.pnlcolor;
this.picBgColor = __reg4.attributes.picbgcolor;
this.showCaption = int(__reg4.attributes.showcaption);
this.captionBgColor = __reg4.attributes.captionbgcolor;
this.layoutType = int(__reg4.attributes.layout);
this.loadBarBgColor = __reg4.attributes.thumbloadbarcolor;
this.thumbLoadDelay = int(__reg4.attributes.thumbloaddelay);
this.roundRect = int(__reg4.attributes.roundrect);
this.roundPix = int(__reg4.attributes.roundpix);
this.captionColor = __reg4.attributes.captioncolor;
this.shadowWidth = int(__reg4.attributes.shadowwidth);
this.drawShadows = int(__reg4.attributes.drawshadows);
this.shadowAlpha = int(__reg4.attributes.shadowalpha);
this.showSelected = int(__reg4.attributes.showselected);
this.selectionColor = __reg4.attributes.selectioncolor;
this.shadowColor = __reg4.attributes.shadowcolor;
this.showPrintBtn = int(__reg4.attributes.showprintbtn);
this.animPageBtns = int(__reg4.attributes.animpagebtns);
this.titleColor = __reg4.attributes.titlecolor;
this.pageBtnColor = __reg4.attributes.pagebtncolor;
this.popupLink = int(__reg4.attributes.popuplink);
this.smoothScroll = int(__reg4.attributes.smoothscroll);
if (this.layoutType != 1 && this.layoutType != 2 && this.layoutType != 3 && this.layoutType != 4) {
this.layoutType = 1;
}
var __reg6 = __reg4.childNodes.length;
__reg3 = 0;
while (__reg3 < __reg6)
{
var __reg5 = new Array();
__reg5.push(__reg4.childNodes[__reg3].attributes.thumb);
__reg5.push(__reg4.childNodes[__reg3].firstChild.nodeValue);
++__reg3;
__reg5.push(__reg4.childNodes[__reg3].firstChild.nodeValue);
++__reg3;
__reg5.push(__reg4.childNodes[__reg3].firstChild.nodeValue);
__reg5.push(__reg4.childNodes[__reg3].attributes.popupwidth);
__reg5.push(__reg4.childNodes[__reg3].attributes.popupheight);
imageArray.push(__reg5);
++__reg3;
}
this.gallery_mc.initCanvas();
}
;
imageXML.ignoreWhite = true;
if (this.xmlFile == undefined) {
this.xmlFile = "gallery.xml";
}
imageXML.load("xyz/"+this.xmlFile);
Problem With XML Based Image Gallery
This is driving me nuts! I based this off a tutorial that I saw posted in the forum.(http://www.kirupa.com/developer/mx2004/thumbnails.htm)
Anyway, I cannot get all my images to show up, and when I do, I only get a few I am not a Flash developer, but am somewhat forced to do this.
The code isn't complete, as I am striving to fix this problem. I have the images separated into categories, and I will eventually want the user to be able to change the categories via a comboBox. When the movie loads, I see my XML data... but problems with the images!
Right now my goal is to find out what's going on with my images. In my fashion array, the only images that are showing up are on the last 2. I have set the default category to 'fashion' so I can demonstrate this.
http://www.schmidtstudio.com/imagegallery.html
http://www.schmidtstudio.com/imagegallery.fla [flash file]
Any help, advice is greatly appreciated! If I haven't explained myself good enough, just let me know.
EDIT: The XML code
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<commercial>
<pic>
<image>http://www.schmidtstudio.com/images/fashion/02.jpg</image>
<caption>Commercial 1</caption>
<thumbnail>http://www.schmidtstudio.com/images/fashion/thumbnails/02.jpg</thumbnail>
</pic>
<pic>
<image>http://www.schmidtstudio.com/images/fashion/02.jpg</image>
<caption>Commercial 2</caption>
<thumbnail>http://www.schmidtstudio.com/images/fashion/thumbnails/02.jpg</thumbnail>
</pic>
</commercial>
<fashion>
<pic>
<image>http://www.schmidtstudio.com/images/fashion/01.jpg</image>
<caption>Fashion 1</caption>
<thumbnail>http://www.schmidtstudio.com/images/fashion/thumbnails/01.jpg</thumbnail>
</pic>
<pic>
<image>http://www.schmidtstudio.com/images/fashion/02.jpg</image>
<caption>Fashion 2</caption>
<thumbnail>http://www.schmidtstudio.com/images/fashion/thumbnails/02.jpg</thumbnail>
</pic>
<pic>
<image>http://www.schmidtstudio.com/images/fashion/03.jpg</image>
<caption>Fashion 3</caption>
<thumbnail>http://www.schmidtstudio.com/images/fashion/thumbnails/03.jpg</thumbnail>
</pic>
<pic>
<image>http://www.schmidtstudio.com/images/fashion/04.jpg</image>
<caption>Fashion 4</caption>
<thumbnail>http://www.schmidtstudio.com/images/fashion/thumbnails/04.jpg</thumbnail>
</pic>
<pic>
<image>http://www.schmidtstudio.com/images/fashion/05.jpg</image>
<caption>Fashion 5</caption>
<thumbnail>http://www.schmidtstudio.com/images/fashion/thumbnails/05.jpg</thumbnail>
</pic>
<pic>
<image>http://www.schmidtstudio.com/images/fashion/06.jpg</image>
<caption>Fashion 6</caption>
<thumbnail>http://www.schmidtstudio.com/images/fashion/thumbnails/06.jpg</thumbnail>
</pic>
<pic>
<image>http://www.schmidtstudio.com/images/fashion/07.jpg</image>
<caption>Fashion 7</caption>
<thumbnail>http://www.schmidtstudio.com/images/fashion/thumbnails/07.jpg</thumbnail>
</pic>
</fashion>
<portrait>
<pic>
<image>http://www.schmidtstudio.com/images/wedding/01.jpg</image>
<caption>Portrait 1</caption>
<thumbnail>http://www.schmidtstudio.com/images/wedding/thumbnails/02.jpg</thumbnail>
</pic>
<pic>
<image>http://www.schmidtstudio.com/images/wedding/01.jpg</image>
<caption>Portrait 2</caption>
<thumbnail>http://www.schmidtstudio.com/images/wedding/thumbnails/02.jpg</thumbnail>
</pic>
</portrait>
<wedding>
<pic>
<image>http://www.schmidtstudio.com/images/wedding/01.jpg</image>
<caption>Wedding 1</caption>
<thumbnail>http://www.schmidtstudio.com/images/wedding/thumbnails/01.jpg</thumbnail>
</pic>
<pic>
<image>http://www.schmidtstudio.com/images/wedding/01.jpg</image>
<caption>Wedding 2</caption>
<thumbnail>http://www.schmidtstudio.com/images/wedding/thumbnails/02.jpg</thumbnail>
</pic>
<pic>
<image>http://www.schmidtstudio.com/images/wedding/01.jpg</image>
<caption>Wedding 3</caption>
<thumbnail>http://www.schmidtstudio.com/images/wedding/thumbnails/03.jpg</thumbnail>
</pic>
</wedding>
</images>
EDIT: Here is the Actionscript for the gallery
Code:
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
}
else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
menuItems = [{label:"Commercial", data: "commercial"},
{label:"Fashion", data: "fashion"},
{label: "Portrait", data: "portrait"},
{label:"Weddings", data: "wedding"}];
this.catSelector.setDataProvider(menuItems);
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("includes/images.xml");
////////////////////////////////
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
//category = this.catSelector.selectedItem.data;
category = "fashion";
image = [];
description = [];
thumbnails = [];
totalCategories = xmlNode.childNodes.length;
for (i=0; i<totalCategories; i++) {
if (xmlNode.childNodes[i].nodeName == category)
{
xmlCategory = xmlNode.childNodes[i];
//trace(xmlCategory);
totalPics = xmlCategory.childNodes.length;
for (j=0; j< totalPics; j++)
{
image[j] = xmlCategory.childNodes[j].childNodes[0].firstChild.nodeValue;
description[j] = xmlCategory.childNodes[j].childNodes[1].firstChild.nodeValue;
thumbnails[j] = xmlCategory.childNodes[j].childNodes[2].firstChild.nodeValue;
thumbnails_fn(j);
}
}
}
firstImage();
}
else {
content = "file not loaded!";
}
}
/////////////////////////////////////
function changeXML() {
images = null;
description = null;
thumbnails = null;
if (category == xmlNode.childNodes[i].nodeName ) {
xmlCategory = xmlNode.childNodes[i];
//trace(xmlCategory);
totalPics = xmlCategory.childNodes.length;
for (j=0; j< totalPics; j++) {
image[j] = xmlCategory.childNodes[j].childNodes[0].firstChild.nodeValue;
description[j] = xmlCategory.childNodes[j].childNodes[1].firstChild.nodeValue;
thumbnails[j] = xmlCategory.childNodes[j].childNodes[2].firstChild.nodeValue;
thumbnails_fn(j);
}
}
}
////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
}
else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
function nextImage() {
if (p<(totalPics-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+totalPics;
}
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;
}
};
}
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+(eval("thumbnail_mc.t"+k)._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
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);
}
[Flash CS3] Loading An External Gallery Based On Xml
im trying to load an external movie clip named gallery.swf (which is based on xml) to be loaded into my main movie...
you can download the files from here:
http://oras.phpwebhosting.com/Flashkit/Archive%202.zip
Please launch shoes-03.swf > then goto Collection > Pre-steps
it will load the external gallery.swf and you will see the error there.
till now i cant find out why im getting that error !!
Pre-loading External Images For XML-based Gallery
I'm working-on an XML-based photo gallery here:
http://www.unionandparkwood.com/demo/flash_gallery/
It works how I want it, except that the first time a thumbnail is clicked for an image, it pauses long enough to skip the fade. If you click-through the images a second time, you'll see that it works smoothly. My guess is that the first time the thumbnail is clicked, the image isn't cached, yet.
I tried to fix this by creating a JavaScript file for the page to pre-load each image and thumbnail:
0003a = new Image;
0003a.src = "images/Down-Range.jpg";
0003b = new Image;
0003b.src = "thumbnails/Down-Range.jpg";
But that didn't work. What would be the best way to do this?
I included a link to "Download ZIP" of the FLA project on this page, too, because it wouldn't be easy for me to describe what's happening. In a nutshell, a thumbnail click launches a function that loads the appropriate image into the main image holder. What seems to be happening the first time is the image isn't loaded before the fade is finished, so the image just appears after a short pause the first time.
Problem With Xml Gallery Based On Kirupa Tutorial
Hi
I want to change code from here http://www.kirupa.com/developer/mx20...togallery2.htm that at the end of photos next_btn will change colour for black, or just set alpha=0. Also With prev_btn at the first photo.
Anyone can help?
thank You
Rafal
Help W/ Multiple Slide Show - Based On Photo Gallery Tut.
Based on Kirupa Photogallery tutorial with the slide show alteration, I have adapted this great concept for my current web project.
-Currently I have a main movie 4 frames (2 preloader / 2 main timeline)
-A movie clip which is a tree style menu with main categories & subcategories etc.
-The first frame of the main is for into text, frame 2 is to load external movies.
The menu sub categories load slide shows (.swf files) that I have succesfully created using the tutorial.
I load them into level 1 , assuming that the main is level 0 and the appear properly at parent frame 4 which is frame 2 on the main timeline but they are being activated from a menu movie clip (silly but you guys have seen this before)
Ok, now the problem, When I use the slide show in an On Release situation where it can be activated as many times as you hit the button, it goes haywire and throws of the delay if you it is multiple times. or try to load a different slide show movie clip. What ever the last one playing was will be rapidly loading images, sometimes out of order, depending on how fast you pressed the button.
Here is an example of my button code which pulls the movie with the slide show from a different directory. Unloading the movie doesn't seem to work:
////////////////////
on (release) {
unloadMovieNum(1);
_parent.gotoAndStop(4);
loadMovie("sld/brindle.swf",1);
}
////////////////////
any help is greatly appreciated. I would really like to use this code in a multiple instance scenario.
Actionscript For Adding Sound To An XML Based Photo Gallery
I was wondering how I could add sound to a gallery that is driven by xml.
I have a gallery that loads the picture, Title and description. the gallery is downloadable here. http://www.flashmo.com/prev...o_133_fisheye
The regular gallery loads a web page when the picture is clicked. I am trying to make each picture load a different mp3.
I have the general Idea of how it would be done but I don't know how put it to actionscript.
I figured you would basically create a sound object that loads the specific mp3 from the xml file when the picture is clicked from the gallery.
Can Anyone help me with this?
I think I might have some what of the idea right but I get an error everytime I load the swf file.
"ArgumentError: Error #2068: Invalid sound.
at flash.media::Sound/play()
at MethodInfo-6()"
If anyone could help me with this I would greatly appreciate it.
Here is the actionscript.
Code:
// Copyright © flashmo.com
// Developed by Min Thu
stop();
import flash.display.MovieClip;
import flash.display.SimpleButton;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import fl.transitions.Tween;
import fl.transitions.easing.*;
var filename_list = new Array();
var url_list = new Array();
var url_target_list:Array = new Array();
var title_list = new Array();
var description_list = new Array();
var song_list = new Array();
var i:Number;
var j:Number;
var tn:Number = 0;
var default_scale:Number = 0.6;
var new_scale:Number;
var center_x:Number = tn_group_mask.x + tn_group_mask.width * 0.5;
var half_of_tn_width:Number = 80;
var current_mc:MovieClip;
var total:Number;
var flashmo_xml:XML = new XML();
var folder:String = "thumbnails/";
var xml_loader:URLLoader = new URLLoader();
xml_loader.load(new URLRequest("flashmo_129_thumbnail_list.xml"));
xml_loader.addEventListener(Event.COMPLETE, create_thumbnail);
var thumbnail_group:MovieClip = new MovieClip();
stage.addChild(thumbnail_group);
thumbnail_group.mask = tn_group_mask;
thumbnail_group.x = tn_group.x;
thumbnail_group.y = tn_group.y;
tn_group.visible = false;
tn_title.text = "";
tn_desc.text = "";
tn_url.text = "";
function create_thumbnail(e:Event):void
{
flashmo_xml = XML(e.target.data);
total = flashmo_xml.thumbnail.length();
for( i = 0; i < total; i++ )
{
filename_list.push( flashmo_xml.thumbnail[i].@filename.toString() );
url_list.push( flashmo_xml.thumbnail[i].@url.toString() );
title_list.push( flashmo_xml.thumbnail[i].@title.toString() );
description_list.push( flashmo_xml.thumbnail[i].@description.toString() );
song_list.push (flashmo_xml.thumbnail[i].@filename.toString() );
load_tn();
stage.addEventListener(Event.ENTER_FRAME, fisheye );
}
function load_tn():void
{
var pic_request:URLRequest = new URLRequest( folder + filename_list[tn] );
var pic_loader:Loader = new Loader();
pic_loader.load(pic_request);
pic_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, on_loaded);
tn++;
}
function on_loaded(e:Event):void
{
if( tn < total )
{
load_tn();
}
var flashmo_bm:Bitmap = new Bitmap();
var flashmo_mc:MovieClip = new MovieClip();
flashmo_bm = Bitmap(e.target.content);
flashmo_bm.x = - flashmo_bm.width * 0.5;
flashmo_bm.y = - flashmo_bm.height * 0.5;
flashmo_bm.smoothing = true;
var bg_width = flashmo_bm.width + 10;
var bg_height = flashmo_bm.height + 10;
flashmo_mc.addChild(flashmo_bm);
flashmo_mc.graphics.lineStyle(1, 0x666666);
flashmo_mc.graphics.beginFill(0xFFFFFF);
flashmo_mc.graphics.drawRect( - bg_width * 0.5, - bg_height * 0.5, bg_width, bg_height );
flashmo_mc.graphics.endFill();
flashmo_mc.name = "flashmo_" + thumbnail_group.numChildren;
flashmo_mc.buttonMode = true;
flashmo_mc.addEventListener( MouseEvent.MOUSE_OVER, tn_over );
flashmo_mc.addEventListener( MouseEvent.MOUSE_OUT, tn_out );
flashmo_mc.addEventListener( MouseEvent.CLICK, tn_click );
flashmo_mc.scaleX = flashmo_mc.scaleY = default_scale;
flashmo_mc.x = thumbnail_group.numChildren * 94;
thumbnail_group.addChild(flashmo_mc);
}
function tn_over(e:MouseEvent):void
{
var mc:MovieClip = MovieClip(e.target);
var s_no:Number = parseInt(mc.name.slice(8,10));
if( s_no > 1 )
thumbnail_group.addChild( thumbnail_group.getChildByName("flashmo_" + (s_no-2) ) );
if( s_no > 0 )
thumbnail_group.addChild( thumbnail_group.getChildByName("flashmo_" + (s_no-1) ) );
if( s_no < thumbnail_group.numChildren - 2 )
thumbnail_group.addChild( thumbnail_group.getChildByName("flashmo_" + (s_no+2) ) );
if( s_no < thumbnail_group.numChildren - 1 )
thumbnail_group.addChild( thumbnail_group.getChildByName("flashmo_" + (s_no+1) ) );
thumbnail_group.addChild( mc );
tn_title.text = title_list[s_no];
tn_desc.text = description_list[s_no];
tn_url.text = url_list[s_no];
}
function tn_out(e:MouseEvent):void
{
tn_title.text = "";
tn_desc.text = "";
tn_url.text = "";
}
function tn_click(e:MouseEvent):void
{
var mc:MovieClip = MovieClip(e.target);
var s_no:Number = parseInt(mc.name.slice(8,10));
var s:Sound = new Sound();
var sc:SoundChannel = s.play();
navigateToURL(new URLRequest(song_list[s_no]));
}
}
function fisheye(e:Event):void
{
thumbnail_group.x -= ( mou*** - center_x ) * 0.05;
if( thumbnail_group.x > tn_group_mask.x + half_of_tn_width )
{
thumbnail_group.x = tn_group_mask.x + half_of_tn_width;
}
else if( thumbnail_group.x < tn_group_mask.x - thumbnail_group.width + tn_group_mask.width )
{
thumbnail_group.x = tn_group_mask.x - thumbnail_group.width + tn_group_mask.width;
}
if( mouseY > tn_group_mask.y && mouseY < tn_group_mask.y + tn_group_mask.height )
{
for( j = 0; j < thumbnail_group.numChildren; j++ )
{
current_mc = MovieClip(thumbnail_group.getChildAt(j));
var distance:Number = Math.sqrt(
Math.pow( Math.abs( stage.mou*** - (current_mc.x + thumbnail_group.x) ) , 2)
+ Math.pow( Math.abs( stage.mouseY - (current_mc.y + thumbnail_group.y) ) , 2)
);
new_scale = 1 - ( distance * 0.002 );
current_mc.scaleX += (new_scale - current_mc.scaleX) * 0.2;
current_mc.scaleY += (new_scale - current_mc.scaleY) * 0.2;
if( current_mc.scaleX < default_scale )
current_mc.scaleX = current_mc.scaleY = default_scale;
}
}
else
{
for( j = 0; j < thumbnail_group.numChildren; j++ )
{
current_mc = MovieClip(thumbnail_group.getChildAt(j));
current_mc.scaleX += (default_scale - current_mc.scaleX) * 0.2;
current_mc.scaleY += (default_scale - current_mc.scaleY) * 0.2;
}
}
}
And here is the XML shortened.
Code:
<thumbnails>
<thumbnail filename="flashmo_128_elegant.jpg" url="http://www.flashmo.com/preview/flashmo_128_elegant" target="_parent._parent"
title="Item No. 1 (128 elegant)"
description="Elegant Design - Flash website template, subpages for products, AS3 contact form"
song="Sound.mp3"/>
<thumbnail filename="flashmo_127_curtain.jpg" url="http://www.flashmo.com/preview/flashmo_127_curtain" target="_parent._parent"
title="Item No. 2 (127 curtain)"
description="Curtain template for making simple Flash websites including ActionScript 3 + PHP contact form"
song="Sound.mp3"/>
<thumbnail filename="flashmo_126_envelope.jpg" url="http://www.flashmo.com/preview/flashmo_126_envelope" target="_parent._parent"
title="Item No. 3 (126 envelope)"
description="Envelope Template with drag N drop Flash photo gallery, ActionScript 3.0"
song="Sound.mp3"/>
</thumbnails>
Help W/ Multiple Slide Show - Based On Photo Gallery Tut.
Based on Kirupa Photogallery tutorial with the slide show alteration, I have adapted this great concept for my current web project.
-Currently I have a main movie 4 frames (2 preloader / 2 main timeline)
-A movie clip which is a tree style menu with main categories & subcategories etc.
-The first frame of the main is for into text, frame 2 is to load external movies.
The menu sub categories load slide shows (.swf files) that I have succesfully created using the tutorial.
I load them into level 1 , assuming that the main is level 0 and the appear properly at parent frame 4 which is frame 2 on the main timeline but they are being activated from a menu movie clip (silly but you guys have seen this before)
Ok, now the problem, When I use the slide show in an On Release situation where it can be activated as many times as you hit the button, it goes haywire and throws of the delay if you it is multiple times. or try to load a different slide show movie clip. What ever the last one playing was will be rapidly loading images, sometimes out of order, depending on how fast you pressed the button.
Here is an example of my button code which pulls the movie with the slide show from a different directory. Unloading the movie doesn't seem to work:
////////////////////
on (release) {
unloadMovieNum(1);
_parent.gotoAndStop(4);
loadMovie("sld/brindle.swf",1);
}
////////////////////
any help is greatly appreciated. I would really like to use this code in a multiple instance scenario.
Gettings XML-Based Thumbnails To Scroll When Photo Gallery Placed Inside A Movie Clip
Hello All!
I've done the tutorial on XML photo gallery and everything works great! However, because I normally program my flash sites to be full browser, I need to place everything inside movieclips so I can manage their positioning through actionscript. Now, When I place the XML Gallery inside a movieclip, the thumbnails no longer scroll for some reason. They only show the masked area and that's it. Again, this only happens when the gallery is placed inside a movieclip which leads me to believe there needs to be a modification to the actionscript code provided by Kirupa.com. If someone could show me how to modify the code, this would be fabulous. Thank you and blessings to all!
Nilros
How To Make The Event Based Block Into Procedure Based
i'd like to do something like this
var a = getXML("xmlfile.xml");
However, the xml component is event based. I only get data when onLoad is fired.
How to wrap this kind of event based function into my custom function?
Protecting FLA's
Hi All,
Could somebody please tell me how I can protect my FLA files. I want to submit some new work to FK, but you need to upload the fla file. I want FKers to be able to view the fla but not edit it or copy stuff from it.
Is this possible?
Protecting My Swf
there are many SWF decompilers that can show the actionscript of SWF file. how can i protect my files?
Protecting Your SWF
I have a customer that has a Flash project wrapped in a Director app. Its activated by a hardware key, well my customer wants to make the application web based, but they do not want any one to reverse engineer the application. Has anyone found a way to protect the swf? Like not downloading to temp files or compiling it with a third part tool?
Protecting Swf's
I am wondering what the best way to protect a swf is. I have heard director could use flash swf's. Is there a way to get the swf out of director? Thanks.
Protecting Your Movie...
Hi All
I have gotten some Flash presentations (say 1.swf) when I try to open them in Flash it says it can't open it.
Obviously they have protected it somehow. Does anyone know how to protect your work from being open in Flash?
I know there are tutorials that protect your work from being played on another server.
Thanks
Digital Editor
Protecting SWFs
Hi!!!
Does anyone out theree know how to disable the right button menu on the player?
I do not want people messing with those settings, so I wanted to block that menu.
If anyone knows help would be much appreciated.
Thanks.
Protecting My Rights
Hi everybody,
I've a quit complicating client that I cannot trust really. Still I want to finish my work (a homepage for is agency). How can I build in a protection in my swf-file, so that I can e.g. black the whole swf-file constantly, if he won't pay me after half a year or so. I guess I have to work with variables, that are connected via php but I'm not sure. I know how to do it with the html page, but I guess it will be quite easy for him, to find the problem in the index.html. So I want to build it in my swf-file.
Can anybody help me or tell me, how you would solve a problem like this? (Apart from filling out a contract what I did of course).
Thanx in advance @@@
Protecting A Movie
how can i protect movie.... like when some one downloads my movie and trys to open it with flash.. how can i protect it and when they try to open the movie they wont be able to
Actionscript For Protecting Swf?
Hey... I know theres a actionscript to do this but i'm not 100% sure what it is. Basicly if the swf is downloaded or put somewhere else, it gets taken to a page that says something like STOLEN, etc and if it is hosten on the correct site, it continues the movie. I want to do this to my site and anyone know the actionscript for it?
Thanks in advance
Protecting Files
Hi
Ive created a cdrom project. Is there a way of protecting it from import appart from on the publishing settings as there are programs out there that can crack it.
Is there a way of preventing people of copying the cd with the files on?
Thanks
Neel
Protecting Your Work
hi all!
I was wondering if anyone knew of a way to protect your swf files on a CD?
Im producing a CD ROM for this big company and they need to know that no-one can copy the materials they are using!!
ANY IDEA???
Protecting Your Movie
Is "Protect from import" enough to block people from downloading and manipulating my swf? I know that, by creating a link to my file, someone could get the swf. Along those lines, do I need to upload my fla to the web? Or just the swf?
Thanks
Protecting SWF Files
Hey I wanted to know if it is possible to protect SWF files from being downloaded, I know once they are loaded they are in the client's browser cache. Is there a way to keep a person from cacheing your SWF files? Or is there any way to really protect ur stuff?
Protecting Script
Is there some script which would protect swf from decompiling it with SWF Decompiler? Or at least protect AS from viewing it.
P.S. I'm using Flash MX
Protecting My .swf Files?
Newbe here! can any body help me protect my swf files?
i want the files to be downloaded but i don't want them to be opened and fiddled with!(edited)
someone, anyone HELP!
Protecting SWF Files, How To?
Hi folks, I need your help:
I am creating a site where people need to log in to view the content. Now, protecting the pages is easy. But, if they wish, they can simply type in the path to the swf file and it will load up.
Question:
Is there a way to protect swf files from being loaded directly using this way (without having the user having to enter a password just to start the flash movie)?
Or, is there a way to protect a directory from being accessed by simply typing in the path in the browser window? (P.S. Ive already set the directory so that it has no index file (did that in C-panel) so that a person cannot see a list of the files in that directory).
Or, is there a way to pass php session variables to a swf file?
Or, is there a way (other than javascript) to disable the right mouse button on a browser?
Any one of these methods would work to achieve what Im looking for.
TIA, sorry for the long post
Stahler
Protecting Flash
I just found a decompiler that decompiles all flash and shows all of the actionscripts.
It even opened up my movies which were supposed to be "write protected" ...
Is there any EASY TO USE program out there that will make my flashes secure? I want to encrypt my flash! ANYONE CAN STEAL IT?
Danny
Protecting My Pictures
Hello everybody,
After using "get URL" for opening my pictures in a new (_blank) window,
1) how can i protect my pictures from been downloaded to viewers hard drive? (do i need to turn all *.jpg to *.swf ?)
2) and how do i make the new window to open in the picture size, let say 240x160?
Any help will be very-much appreciated
Thanks
Micfaber
Protecting SWF Files.....
How can I protect the URL of my SWF from being decompiled.....is there a way? Also, anything else that protects SWF files would be appreciated (including software, tips, tutorials [if there are any] ect...).
Thanks,
Sportzguy933
Protecting My Swf Files
Hi
Here is what I want to do.
I would like to add a script to my swf file so that if someone saves my file off of the internet, and click on it, that it shows a page with a notice that this is my file along with my url and that this is an attempt to use my file iligally.
How do I do this?
Thanks
Ecinele
Protecting SWF File
Hi guys,
I've got a question, how to make my flash file to be played online(from my website) only?
Any ideas/suggestions are welcome, thanks!
Protecting SWF From Decompilers
Not sure if I'm posting in the right place but I was wondering if anyone can help. When I export my flash movie I select the protect from import checkbox and then enter a password further down. Would this protect my files from decompilers or do I need to use something else?
Thanks
Protecting Images
Ok, this maybe a really stupid question. Is it possible for people to link to a persons images within a flash swf from another site essencially eating up my bandwidth?
I really don't know.
thanks
Protecting SWF From Decompilers
Can anyone help. When I export my flash movie I select the protect from import checkbox and then enter a password further down. Would this protect my files from decompilers or do I need to use something else?
Thanks
Protecting SWF Files.
Hi guys. I have a question. How can we protect SWF files? Because now there is a program called ActionScriptViewer... This program is so scary...
Is there a way that SWF just streamly play? I mean it doesn't show up in Temporary Internet Files...
If there is any way Please help me.
Thanks.
Protecting A Multimedia Cd
Hi everybody,
I'm working hard on building a multimedia CD using flash-xml interaction. It will be pretty complex, multi leveled, and will have a lot of various content (pictures, 360 panoramas, sounds and so on). Right now, as things are begining to take shape, I'm concerned about the protection of my final product. Is there any (fast) way to protect my cd as a whole, while keeping it functional for the user ? I'm pretty far from being a security expert but I don't think that leaving my files the way they are now and burning them on disc would be the right thing to do. Anyone can just browse through my xml files, decompile my .swf and God knows what else..
So what I'm hoping for is a solution to embed all of the files into one big .exe file that everybody can use but very few can break into.
Thank you all.
Protecting You Work.
I was so impressed by JK Rowlings site recently that I tried to have a look at several of the swf files in the cache. However, when I attempted to open them the context menu displayed 'Movie not loaded', even though some of the files are 100/200K in size.
What's that all about and how do apply the same to protect my own work?
Cheers.
http://www.jkrowling.com
|