# Trouble with when I try to upload flash website

**URL:** <https://forum.kirupa.com/t/trouble-with-when-i-try-to-upload-flash-website/261960>\
**Category:** flash\
**Created:** [June 2, 2008, 5:23am UTC](https://forum.kirupa.com/t/trouble-with-when-i-try-to-upload-flash-website/261960 "2008-06-02T05:23:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivank](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@ivank](https://forum.kirupa.com/u/ivank)\
**Post date:** [June 2, 2008, 5:23am UTC](https://forum.kirupa.com/t/trouble-with-when-i-try-to-upload-flash-website/261960/1 "2008-06-02T05:23:32Z")

</div>

Hey everyone,

I am working on a website, however, it only works locally. I was wondering if anyone could help me out here. I am using Actionscript2. Here is the URL for the test site location:

[http://www.techgogreen.org/everite/everite\_products.swf](http://www.techgogreen.org/everite/everite_products.swf)

For some reason the images wont show up. Here is the code for it:. Everything works except when I call the firstImage function, I guess it cannot find the images and I don’t know why. I tried it with and without the fade in preloader. I’m hoping its just a syntax error from changing from a local address to an online address. Thanks in advance

globvar=0;  
\_global.item=0;  
\_global.product=0;  
var menuButtons:Array = [“Products”];

var chosenMenu:Array = new Array();  
var subMenuOpened:Boolean = false;  
var whichSubMenu:Number = new Number();  
var currentPosition:Number = new Number();

var menuSpeed:Number = 6;  
var menuDown:Button = menuDown\_btn;  
var menuUp:Button = menuUp\_btn;  
var firstLook:Boolean = true;  
menuUp.\_alpha = 0;  
menuUp.enabled = false;  
galleryMask.\_height = 280;  
var menuButtonsMC:MovieClip = galleryMenu\_mc.buttonsHolder\_mc;  
var descMC:MovieClip = descMenu\_mc.descHolder\_mc;  
var galleryMask:MovieClip = galleryMenu\_mc.galleryMask\_mc;  
var scrollHeight:Number;

var movedOver:Boolean = false;  
var tester:Boolean = true;  
var mouseListener:Object = new Object();

var my\_events = new Object();  
my\_events.target = my\_mc;  
Mouse.addListener(my\_events);

descMenu\_mc.descHolder\_mc.info\_txt.width = 190;  
descMenu\_mc.descHolder\_mc.info\_txt.autoSize = true;

function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
productname = [];  
description = [];  
thumbnails = [];  
rounds = [];  
color = [];  
subMenu = [];  
total = xmlNode.childNodes[0].childNodes.length;  
loadMenu();  
generateMenu();

```
    loadpictures();
    
    for(i=0; i&lt;subMenu.length; i++) {
        rounds* = 0;
    }
    
    menu_fn();
    firstImage(item);
    scrollHeight = descMenu_mc.descHolder_mc._height;
    scrolling(scrollHeight);
} else {
    content = "file not loaded!";
}

```

}

xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“gallery.xml”);

/////////////////////////////////////  
listen = new Object();  
RollClipListener = 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();  
};  
/////////////////////////////////////  
p = 1;  
this.onEnterFrame = function() {  
filesize = picture\_mc.getBytesTotal();  
loaded = picture\_mc.getBytesLoaded();  
preloader.\_visible = true;  
if (loaded != filesize) {  
preloader.preload\_bar.\_xscale = 100\*loaded/filesize;  
} else {  
preloader.\_visible = false;  
if (picture\_mc.\_alpha\<100) {  
picture\_mc.\_alpha += 10;  
}  
}  
};

```
this.createEmptyMovieClip(RollClip, 1);
this.RollClip._x = 20;
this.RollClip._y = 110;
this.RollClip._height = ((xmlNode.childNodes.length) * 32)+60;
this.RollClip._width = 160;

```

function nextImage() {  
if (p\<(totalimages)) {  
p++;  
if (loaded == filesize) {  
picture\_mc.\_alpha = 0;  
picture\_mc.loadMovie(“gallery/” + subMenu[product] + “/” + productname[item] + “/” + p + “.jpg”);  
desc\_txt.text = productname[item];  
color\_txt.text = color[p-1];  
descMenu\_mc.descHolder\_mc.info\_txt.text = description[item];  
picture\_num();  
}  
}  
}  
function prevImage() {  
if (p\>1) {  
p–;  
picture\_mc.\_alpha = 0;  
picture\_mc.loadMovie(“gallery/” + subMenu[product] + “/” + productname[item] + “/” + p + “.jpg”);  
desc\_txt.text = productname[item];  
color\_txt.text = color[p-1];  
descMenu\_mc.descHolder\_mc.info\_txt.text = description[item];  
picture\_num();  
}  
}  
function firstImage(item) {  
if (loaded == filesize) {  
picture\_mc.\_alpha = 0;  
picture\_mc.loadMovie(“gallery/” + subMenu[product] + “/” + productname[item] + “/” + 1 + “.jpg”);  
desc\_txt.text = productname[0];  
color\_txt.text = color[0];  
descMenu\_mc.descHolder\_mc.info\_txt.text = description[item];  
picture\_num();  
}  
if (Round[product] != true) {  
picture\_mc.\_alpha = 0;  
picture\_mc.loadMovie(“gallery/” + subMenu[product] + “/” + productname[item] + “/” + 1 + “.jpg”);  
desc\_txt.text = productname[0];  
color\_txt.text = color[0];  
descMenu\_mc.descHolder\_mc.info\_txt.text = description[item];  
picture\_num();  
}  
}  
function picture\_num() {  
current\_pos = p;  
pos\_txt.text = current\_pos+" / "+ totalimages;  
}  
function thumbNailScroller() {  
// thumbnail code!  
this.createEmptyMovieClip(“tscroller”, 1000);  
scroll\_speed = 6;  
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\<=(hit\_left.\_x+40)) && (thumbnail\_mc.hitTest(hit\_left))) {  
thumbnail\_mc.\_x += scroll\_speed;  
}  
} else {  
delete tscroller.onEnterFrame;  
}  
};  
}  
function thumbnails\_fn(k) {  
k++;  
thumbnail\_mc.createEmptyMovieClip(“t”+k, thumbnail\_mc.getNextHighestDepth());  
tlistener = new Object();  
tlistener.onLoadInit = function(target\_mc) {  
target\_mc.\_x = -69+((target\_mc.\_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);  
thumbnaillocation = “gallery/” + subMenu[product] + “/” + productname[item] + “/thumbs/” + k + “.jpg”;  
image\_mcl.loadClip(thumbnaillocation, “thumbnail\_mc.t”+k);  
}

function menu\_fn() {  
for (i=0; i\<xmlNode.childNodes[product].childNodes.length; i++) {  
currentGalleryButton = galleryMenu\_mc.buttonsHolder\_mc.attachMovie(“menu section button”, “galleryButton”+i, galleryMenu\_mc.buttonsHolder\_mc.getNextHighestDepth());  
currentGalleryButton.\_x = 0;  
currentGalleryButton.\_y = 35_i;  
currentGalleryButton.sectionTitle\_txt.text = xmlNode.childNodes[product].childNodes_.childNodes[0].firstChild.nodeValue;  
}  
numberOfGalleries = i;  
enableButtons(numberOfGalleries);

}  
function enableButtons(numberOfGalleries:Number):Void {  
for (i=0; i \< numberOfGalleries; i++) {  
pressedButton = galleryMenu\_mc.buttonsHolder\_mc[“galleryButton”+i];  
pressedButton.onRollOver = function():Void {  
this.gotoAndPlay(2);  
};  
pressedButton.onRollOut = function():Void {  
this.gotoAndStop(1);  
};  
pressedButton.onPress = function() {  
currentitem = item;  
currentitemgallery = “t”;  
clickedGallery = Number(this.\_name.substr(13));  
item = clickedGallery;  
picture\_mc.unloadMovie();  
for (j=0; j \< xmlNode.childNodes[product].childNodes[currentitem].childNodes[2].childNodes.length+1; j++) {  
currentitemgallery = “t”+j;  
thumbnail\_mc[currentitemgallery].unloadMovie();  
}  
p = 1;  
loadpictures();  
firstImage(item);  
descMenu\_mc.descHolder\_mc.\_y = 0;  
scrollHeight = descMenu\_mc.descHolder\_mc.\_height;  
thumbnail\_mc.\_x = 213;  
scrolling(scrollHeight);

```
    };
    
}
enableGalleryNavigation();

```

}  
function loadMenu() {  
for (i=0; i\<xmlNode.childNodes.length; i++) {  
subMenu\* = xmlNode.childNodes\*.attributes.title;  
}  
}  
function loadpictures() {  
totalimages = xmlNode.childNodes[product].childNodes[item].childNodes[2].childNodes.length;  
productname[item] = xmlNode.childNodes[product].childNodes[item].childNodes[0].firstChild.nodeValue;  
description[item] = xmlNode.childNodes[product].childNodes[item].childNodes[1].firstChild.nodeValue;  
for (i=0; i\<totalimages; i++) {  
color\* = xmlNode.childNodes[product].childNodes[item].childNodes[2].childNodes\*.firstChild.nodeValue;  
thumbnails\_fn(i);  
};  
}

function generateMenu() {

```
    menuButton.onRollOver = function():Void {
        currentPosition = menuButton._x;
        if (!subMenuOpened) {
            subMenuOpened = true;
            openSubMenu(currentPosition);
        } else {
            closeSubMenu();
            openSubMenu(currentPosition);
        }
    };
    
    
    ////////// SLAVA EDIT START //////////
    menuButton.onRollOut = function():Void
    {
        movedOver = true;
    };
    ////////// SLAVA EDIT END //////////

```

}  
function openSubMenu(currentPosition):Void {  
chosenMenu = eval(“subMenu”);

```
for (j=0; j&lt;chosenMenu.length; j++) {
    this.createEmptyMovieClip("subMenuHolder_mc", this.getNextHighestDepth());
    if(j == chosenMenu.length-1){
        subMenuHolder_mc.attachMovie("menu button end", "subMenuButton"+j, this.getNextHighestDepth());
    }
    if(j != chosenMenu.length-1){        
        subMenuHolder_mc.attachMovie("menu button", "subMenuButton"+j, this.getNextHighestDepth());
    }
    subMenuHolder_mc["subMenuButton"+j]._x = currentPosition;
    subMenuHolder_mc["subMenuButton"+j]._y = 140+(j*30);
    subMenuHolder_mc["subMenuButton"+j].label_txt.text = chosenMenu[j];
    subMenuHolder_mc["subMenuButton"+j].num = j;
    var subMenuStartColor:Color = new Color(subMenuHolder_mc["subMenuButton"+j].bkgColor_mc);
    subMenuStartColor.setRGB(0x0C74B8);
        
    

    // _________________________________________________________
    // Release & ReleaseOutside event handler
    // _________________________________________________________
    subMenuHolder_mc["subMenuButton"+j].onRelease = subMenuHolder_mc["subMenuItem"+j].onReleaseOutside=function ():Void {
        currentitem = item;
        currentproduct = product;
        clickedGallery = Number(this._name.substr(13));
        picture_mc.unloadMovie();
        for (i=0; i &lt; xmlNode.childNodes[currentproduct].childNodes[currentitem].childNodes[2].childNodes.length+1; i++) {
            currentitemgallery = "t"+i;
            thumbnail_mc[currentitemgallery].unloadMovie();
        }
        for (i=0; i &lt; xmlNode.childNodes[product].childNodes.length+1; i++) {
            currentitemgallerytmp = "galleryButton"+i;
            removeMovieClip(galleryMenu_mc.buttonsHolder_mc[currentitemgallerytmp]);
        }

                p = 1;
                product = this.num;
                item = 0;
                rounds[product]++;
                descMenu_mc.descHolder_mc._y = 0;
                scrollHeight = descMenu_mc.descHolder_mc._height;
                thumbnail_mc._x = 213;
                scrolling(scrollHeight);
                
        
        loadpictures();
        menu_fn();
        firstImage(item);
        descMenu_mc.descHolder_mc._y = 0;
        scrollHeight = descMenu_mc.descHolder_mc._height;
        scrollTrack._y = 165;

        scrolling(scrollHeight);
        closeSubMenu();
    };
    // _________________________________________________________
    // RollOver event handler
    // _________________________________________________________
    subMenuHolder_mc["subMenuButton"+j].onRollOver = function():Void {
        var subMenuRollOverColor:Color = new Color(this.bkgColor_mc);
        subMenuRollOverColor.setRGB(0x58B6F3);
        //movedOver = true;
        
        
        
        ////////// SLAVA EDIT START //////////
        movedOver = false;
        ////////// SLAVA EDIT END //////////
    };
    // _________________________________________________________
    // RollOut event handler
    // _________________________________________________________
    subMenuHolder_mc["subMenuButton"+j].onRollOut = function():Void {
        var subMenuRollOutColor:Color = new Color(this.bkgColor_mc);
        subMenuRollOutColor.setRGB(0x0C74B8);
        //movedOver = false;
        
        ////////// SLAVA EDIT START //////////
        movedOver = true;
        ////////// SLAVA EDIT END //////////

        
    };
}

```

}  
function enableGalleryNavigation():Void {  
menuDown.onPress = function() {  
if (firstLook) {  
menuUp.\_alpha = 100;  
menuUp.enabled = true;  
firstLook = false;  
}  
var menuTop:Number = menuButtonsMC.\_height-Math.abs(menuButtonsMC.\_y);  
if (menuButtonsMC.\_y\<=0 && menuTop\>=galleryMask.\_height) {  
var targetPos:Number = menuButtonsMC.\_y-galleryMask.\_height;  
menuDown.enabled = false;  
menuUp.enabled = false;  
menuButtonsMC.onEnterFrame = function():Void {  
menuButtonsMC.\_y += (targetPos-menuButtonsMC.\_y)/menuSpeed;  
if (menuButtonsMC.\_y\<=(targetPos+0.8)) {  
menuButtonsMC.\_y = Math.round(targetPos);  
delete menuButtonsMC.onEnterFrame;  
menuDown.enabled = true;  
menuUp.enabled = true;  
}  
};  
}  
};  
menuUp.onPress = function() {  
var menuTop:Number = menuButtonsMC.\_height-Math.abs(menuButtonsMC.\_y);  
if (menuButtonsMC.\_y\<0 && menuTop\>0) {  
var targetPos:Number = menuButtonsMC.\_y+galleryMask.\_height;  
menuDown.enabled = false;  
menuUp.enabled = false;  
menuButtonsMC.onEnterFrame = function():Void {  
menuButtonsMC.\_y += (-menuButtonsMC.\_y+targetPos)/menuSpeed;  
if (menuButtonsMC.\_y\>=(targetPos-0.8)) {  
menuButtonsMC.\_y = Math.round(targetPos);  
delete menuButtonsMC.onEnterFrame;  
menuDown.enabled = true;  
menuUp.enabled = true;  
}  
};  
}  
};  
}  
function closeSubMenu():Void {  
removeMovieClip(subMenuHolder\_mc);  
}  
var mouseout = new Object();

mouseout.onMouseMove = function() {  
if(!(this.RollClip.hitTest(\_root.\_xmouse, \_root.\_ymouse, true)))  
if(movedOver == true) {  
{  
// we’re outside the x/y width/height bounds of the menu  
closeSubMenu();  
trace(‘movedOver’);  
movedOver = false;  
}  
}  
}

Mouse.addListener(mouseout);

function scrolling(Height) {  
var scrollHeight:Number = scrollTrack.\_height;  
var contentHeight = Height;  
var scrollFaceHeight:Number = scrollFace.\_height;  
var maskHeight:Number = descMenu\_mc.maskedView.\_height;  
var initPosition:Number = scrollFace.\_y=scrollTrack.\_y;  
var initContentPos:Number = descMenu\_mc.descHolder\_mc.\_y;  
var finalContentPos:Number = maskHeight-contentHeight+initContentPos;  
var left:Number = scrollTrack.\_x;  
var top:Number = scrollTrack.\_y;  
var right:Number = scrollTrack.\_x;  
var bottom:Number = scrollTrack.\_height-scrollFaceHeight+scrollTrack.\_y;  
var dy:Number = 0;  
var speed:Number = 10;  
var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight);

```
scrollFace.onPress = function() {
    var currPos:Number = this._y;
    startDrag(this, false, left, top, right, bottom);
    this.onMouseMove = function() {
        dy = Math.abs(initPosition-this._y);
        descMenu_mc.descHolder_mc._y = Math.round(dy*-1*moveVal+initContentPos);
    };
};
scrollFace.onMouseUp = function() {
    stopDrag();
    delete this.onMouseMove;
};
btnUp.onPress = function() {
    this.onEnterFrame = function() {
        if (descMenu_mc.descHolder_mc._y+speed&lt;descMenu_mc.maskedView._y) {
            if (scrollFace._y&lt;=top) {
                scrollFace._y = top;
            } else {
                scrollFace._y -= speed/moveVal;
            }
            descMenu_mc.descHolder_mc._y += speed;
        } else {
            scrollFace._y = top;
            descMenu_mc.descHolder_mc._y = descMenu_mc.maskedView._y;
            delete this.onEnterFrame;
        }
    };
};
btnUp.onDragOut = function() {
    delete this.onEnterFrame;
};
btnUp.onRelease = function() {
    delete this.onEnterFrame;
};
btnDown.onPress = function() {
    this.onEnterFrame = function() {
        if (descMenu_mc.descHolder_mc._y-speed&gt;finalContentPos) {
            if (scrollFace._y&gt;=bottom) {
                scrollFace._y = bottom;
            } else {
                scrollFace._y += speed/moveVal;
            }
            descMenu_mc.descHolder_mc._y -= speed;
        } else {
            scrollFace._y = bottom;
            descMenu_mc.descHolder_mc._y = finalContentPos;
            delete this.onEnterFrame;
        }
    };
};
btnDown.onRelease = function() {
    delete this.onEnterFrame;
};
btnDown.onDragOut = function() {
    delete this.onEnterFrame;
};

if (contentHeight&lt;maskHeight) {
    scrollFace._visible = false;
    btnUp.enabled = false;
    btnDown.enabled = false;
} else {
    scrollFace._visible = true;
    btnUp.enabled = true;
    btnDown.enabled = true;
}

```

};

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 2, 2008, 8:57am UTC](https://forum.kirupa.com/t/trouble-with-when-i-try-to-upload-flash-website/261960/2 "2008-06-02T08:57:26Z")

</div>

I can only assume the address in the xml is wrong.

plus try placing your code in code brackets it helps get replies 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 2, 2008, 12:20pm UTC](https://forum.kirupa.com/t/trouble-with-when-i-try-to-upload-flash-website/261960/3 "2008-06-02T12:20:51Z")

</div>

uh, yeah, what randomagain said is right. You should have described your problem, then attached the code. :thumb:

---

<div class="post-metadata">

**Author:** ![ivank](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@ivank](https://forum.kirupa.com/u/ivank)\
**Post date:** [June 2, 2008, 4:48pm UTC](https://forum.kirupa.com/t/trouble-with-when-i-try-to-upload-flash-website/261960/4 "2008-06-02T16:48:41Z")

</div>

Hello,thanks for the time, Here is the line where I am calling the location if the image. the arrays are the names of the folders where the images are located. I figured this is the best way to keep it robust.

[picture\_mc.loadMovie(“gallery/” + subMenu[product] + “/” + productname[item] + “/” + 1 + “.jpg”);]

the thing is , everything works on my computer locally, but they don’t work online. All the images are in the same directory paths and everything. thanks

-Ivan

---

<div class="post-metadata">

**Author:** ![creatify](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@creatify](https://forum.kirupa.com/u/creatify)\
**Post date:** [June 2, 2008, 8:39pm UTC](https://forum.kirupa.com/t/trouble-with-when-i-try-to-upload-flash-website/261960/5 "2008-06-02T20:39:36Z")

</div>

this is what your site is trying to load and its not finding it on the link you posted:

[![](http://www.techgogreen.org/everite/gallery/Sticky%20Wheels/Coin%20Engine%20Racers/thumbs/3.jpg) ](http://www.techgogreen.org/everite/gallery/Sticky%20Wheels/Coin%20Engine%20Racers/thumbs/3.jpg)

keep in mind that the path that flash uses to load items - is relative to the location of the html page that flash is embedded in, and not the location of the swf.

---

<div class="post-metadata">

**Author:** ![ivank](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@ivank](https://forum.kirupa.com/u/ivank)\
**Post date:** [June 2, 2008, 11:28pm UTC](https://forum.kirupa.com/t/trouble-with-when-i-try-to-upload-flash-website/261960/6 "2008-06-02T23:28:37Z")

</div>

Hello Guys, thanks so much for the help. I figured out the problem from your last reply. It turns out locally, your computer can still find a directory even with incorrect case (meaning uppercase and lowercase), however once online, everything is case sensitive. So basically to fix this I placed this at the end of the dynamic URL “toLowerCase()” and that fixed everything. Thanks to my friend slava for that. I hope this post can also help others
