Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Local Loadmovie Ok / Online Loadmovie Bad



I'm at my wit's end with this one. I have an swf that's loading fine locally but refuses to be loaded online. Here's the script. It's in the first frame of the root mc ....
code:
_root.createEmptyMovieClip("slideshow", this.getNextHighestDepth());
_root.slideshow.createEmptyMovieClip("container_mc ", 0);
slideshow_btn.onRelease = function() {
this._visible = 0;
this.gotoAndStop(1);
_root.slideshow.container_mc.loadMovie("temp.swf") ;
};


Loads no problem locally. Nothing when I upload it. I have lockroot set to true in the same frame as the above script. I also tried a simple test with ....
code:
_root.slideshow.loadMovie("temp.swf");

.... in a simple mc containing only a 'slideshow' mc. Works if I access the URL directly, doesn't if I put it in an html page. What mistake could I be making?

thanks
mark



FlashKit > Flash Help > Flash ActionScript
Posted on: 06-23-2005, 07:16 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Loadmovie From Local File
Am I doing something wrong, or isnt Actionscript allowing to loadMovie a file from my harddrive?
I have as folows (piece of code, not full):

Code:
var MC: MovieClip = _root["day"+owner].createEmptyMovieClip("loader", -16382);
MC.loadMovie(file);
While testing from the Harddrive it works fine, but when it's online it stops working.

Any kind of info on this is greatly appreciated.

Loadmovie Local Files
how can one with loadmovie (or another command) load local (on the users harddisk) files into an already loaded flashmovie within the browser? say i have a simple movie with a button:

uploadButton.onRelease = function() {
this.loadMovie("C:hello.jpg");
}

i upload this movie to the server together with the html page and load it into my browser by http. why doesn't this work?

Loadmovie Online Prob..
hi!
i just tested my site online,the problom is that one of my load movie dosnt work.
the start is a animation of the main page,which in the end load a movie to the main screen,in my computer it is all working good,but online it has a problom.
all the other loadmovie(9 movies) working well online as well.

any help?
Thank's...

[F8] LoadMovie - FLV's Not Playing Online
Hello,

I am trying to play an FLV file, by using the loadMovie function. The flv is embedded within a .swf - which is what I load by using the code blow:

loadMovie("loadmovie/anticamo/anticamo.swf", Container2anticamo);

When I test my code / movie file offline, everything works as intended and the .swf is loaded, and subsequently plays my FLV. However, when I upload this and attempt to test it online, the .swf that I call fails to load and subsequently my FLV does not load.

Can anyone please help me with an answer as to why the anticamo.swf will load and play my FLV offline, but when I test the same code online it fails to load or even display the .swf. Of course also, if possible, a suggested fix for this problem would be ideal.

I have noticed, that when I view the frame that should load the .swf, that the browser is attempting to contact the server / download information.

Any help would be greatly appreciated as this is very frustrating and I trying to build a portfolio at the moment which would greatly utilize both loadMovie and FLV's.

Thankyou,
Cx

LoadMovie Not Loading Online
HI. Can somebody help me figure out why this is happening? I have several swfs that I am loading into my main swf. The external SWFs are aniamted image montages fading in and out. I am loading them on a button command. For Example:

on(release){
_root.montages.backgroundContainer.loadMovie("portfoliosBackground.swf");
}

I've used loadMovie many times on other parts of the site successfully to load jpgs and other swfs. I did a test using a simple animation of a rectangle and it loads fine. There is something about these particular montage swfs that is wrong and I just can't think of what it could be. It is probably something really simple. I thought maybe it is the size of the file? Because some are relatively large with large jpgs in them. Could it be a memory issue? But one of them is only 12kb (it is a vector aniamtion - not a jpg montage) and that one doesn't load either. All the files are in the same folder. And it works fine on locally on my computer. I am going crazy. I was just finishing up my site trying to make the initial download time shorter by making these montages external.

I would be so grateful for help.

LoadMovie Not Working Online
I have a flash CS3 / as2 website with a page in it that is using a frame script

loadMovie("video", "mc");
where "mc" is the name of a blank movie object

It works just fine offline, but I cannot get it to work online.

The video.swf is loading online, but it will not load the video.flv while on the webserver.

I have many other flash videos on this server, so its not a mime problem with the server.
There is just some quirk I am not seeing.

Would love it if anyone has any insights, tests to run, etc...

Thanks

Rob

LoadMovie() Is Not Working Online
Hi,

I have a main swf movie and calling some other different swf in some layers. Everything is working offline. It's not working when i upload.

btn_big.onRollOver = function(){
_root.arrow_holder.loadMovie ("arrow.swf", 3);
_root.holder.unloadMovie ("text.swf", 2);
}

Anybody can help?

Please Help LoadMovie Works On Local But Not When Uploaded.
I am currently developing my first ever Flash site and it has been a steep learning curve. I am pleased with my efforts but am struggling on uploading the files.

I have created the main site, then have 5 other .swf files that load into a specific section of the page. When I test the movie locally everything is fine - the .swfs load into the correct target, and the text boxes update correctly with the .txt file.

However when I upload it to my server nothing loads when it should unless I put the full path in each section. As this means editing about 30 different actions and pasting the full path (around loads of different clips and frames) it becomes a bit hard work. It also means I cant test locally then unless connected to the net - obviously I am now fed up of swapping the paths from relative to absolute.

Any tips on what I can do?

As an example I have a MC called Text Boxes. Within this are the text boxes for each hover action. Each labeled frame of the MC has the following:

LoadMovieNum(profile.swf,_root.mcHolder)

Therefore when a user hovers over the Profile button it loads the movie Profile.swf into mcHolder which sits on level_0.

Please help as it is hindering the completion of my site.

Scooby

Local Loadmovie Command From A Cd For Presentation
Ok, so heres the deal, I produced a site for a client in flash. www.edinburghembroidery.co.uk

I now have to give a presentation for them using a laptop that's not connected to the internet. Ill be using it from the desktop or cd. Anyway, On the site I have loadmovie commands saying:

on (release) {
loadMovieNum("http://www.edinburghembroidery.co.uk/flash/example1.swf", 2);

Now, what happens is that this opens a file on the net (for all u actionscript gurus out there), but as this laptop is not connected to teh net, I need it to open a file WITHIN THE SAME DIRECTORY. All the flash files, will be held together.

Any ideas what command I should put it? Im jsut useless at this sort of thing

LoadMovie Differs From Local To Live
hello everyone :)

i've got me a little test .fla here. it contains just 3 things:

an MC called _loader; and
a textfield called _debug; and
the attached code (please read it):



nice and simple, great. now when i run this locally after my external swf is loaded the contents of _debug is this:

xtraColors : [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
rgbs : 0,51,102,153,204,255
hex : 00,33,66,99,CC,FF
setMyColor : [type Function]
ColorBoxClass : [type Function]
killColorFocus : [type Function]
setColorFocus : [type Function]
_editor : _level0._loader._editor

which is great, just what i want. however, once i put it online after my external swf is loaded the contents of _debug is this:



as in: nothing, zip, nada.

que?

(attached code follows...)









Attach Code

stop();

System.security.allowDomain( "http://www.myWebsite.com" );

_loader.loadMovie("http://www.myWebsite.com/folder/folder/folder/movieToBeLoaded.swf");

this.onEnterFrame = function(){
var s="";
for (var p in _loader) s+=(p+" : "+_loader[p]+"
");
_debug.text = s;
}

LoadMovie Help Anyone? Works Fine On PC, But Not Online
Hey everyone,

Trying to use LoadMovie on a button to load a SWF (just a picture) into a MC called Preview. My code looks like this right now:

on (rollOver) {
loadMovie("files/Movie4.swf", Preview);
}
on (rollOut) {
loadMovie("files/Blank.swf", Preview);
}
on (release) {
getURL("documents/resume.pdf", "_blank");
}


This works great on my PC. Once I put in the webspace, the SWF (Movie4.swf) does not load into the MC (Preview). I can still click on the button and go to the PDF, but the loadmovie doesn't work.

Any help would be appreciated.

Loadmovie Works In Test But Not Online
I'm sure it's probably something simple. The loadmovie funtion works when I test the movie localy but not when I try it online. It does not load. The main and ext. movies are both in the same www directory.
Any ideas?
Here is my script;
loadMovie("whatever_movie.swf", "holder");

Trouble With LoadMovie When Viewing Online
Hey all,

Ok, I am doing a site which has a bunch of images being loaded into a movieclip as thumbnails of the images are clicked. The site works great offline, but once I upload to the server, the images don't appear when clicked. I can see the background, but it's as if the loadMovie function isn't working. Example of code:

phighfashion.onPress = function() {
loadMovie("/swf/hfbtn.swf", "_root.btnholder");
};

I know I have a /swf directory on the server where the images are being held. I have heard that sometimes this path needs to be the whole url ie.

phighfashion.onPress = function() {
loadMovie ("http://www.servername.com/swf/hfbtn.swf", "_root.btnholder");
};")

Is this the case, or is there another problem that I'm not aware of? I have tried this just in case, and it doesn't seem to work either. Any ideas?

Rick

Loadmovie Doesn't Load Online
Well my friends, I thought this was simple, but I've tried a several times and nothing.

I have a movie clip that loads other movie clips: I do that with a empty movie clip palced in one Parent's movie clip frame and my code in that frame is:

code:
loadmovie("My_other_movie.swf","Empty_movie_instan ce");
stop();


but when I put both swf files in my page just work for one of the swf (the first) and not with the others. It works in my local drive, what happens?

Thank you.

an example here: http://www.jgavalos.com/cv.html
try to press one of the buttons below

Huge Problem With LoadMovie Online... :(((
Hello to all,

I never had problems with loadMovie, but now i do.
I made a full flash site which is enormous in content, and so i needed to slice it up into smaller pieces of stuff for the surfers to choose what they want to see so they dont have to wait for a long time.

BUT,
although the files work perfectly locally they dont work at all online!
The structure is as follows :



The main movie located in the root does load mc1 fine.
My problem is that, when mc1 tried to load the content that will be placed into mc2, it just loads in a second (from 0% to 100%) and no file is loaded at all.

I know that the codebase is always the place where the html file lies, and thats why i always use the path from the html file to the swf files i want to load (instead of just the relative one between the 2 mcs). But even if a relative path from mc2's folder is used, a full path (http://...) or the correct one which is from the html file's folder to the other swfs, it still wont do anything!!!

I am getting really mad about it right now, and this is some serious work i cant just throw away and create using another way.
If someone can help please do so!

thanks

george

[F8] LoadMovie Works Locally, But Not Online...
I have the following command on a frame:

holder_mc.loadMovie("/NF/mp3player.swf");

When independently launching the .SWF, or when testing the movie in Flash, the "holder_mc" loads the "mp3player.swf" just fine. But when posted online (or even testing locally inside a browser), it doesn't load at all. I have copied the directory structures from my local hard drive to my online server EXACTLY...

Any ideas???...

LoadMovie Works Locally, But Not Online...
I have the following command on a frame:

holder_mc.loadMovie("/NF/mp3player.swf");

When independently launching the .SWF, or when testing the movie in Flash, the "holder_mc" loads the "mp3player.swf" just fine. But when posted online (or even testing locally inside a browser), it doesn't load at all. I have copied the directory structures from my local hard drive to my online server EXACTLY...

Any ideas???...





























Edited: 11/11/2006 at 12:31:32 PM by DIY_Lobotomy

Movie Size Online - LoadMovie...
Hey All, hopefully someone can help me. I'm designing a website which has one main MC in the timeline. This main MC totals about 650 frames with text and pictures for each page (65 pages) This when published into a .swf, was 172KB. However, the download time was huge, almost 45 seconds. The intro page works fine, which I then use a loadMovie to bring in the main .swf with navigation bar, etc. So, I took this large .swf and split it into 3 smaller .swf's, 50, 111 and 85KB, for each. Now when live online, this too, seems too large and almost 30 seconds to download.

Any suggestions, can I optimize in any way or should I just again split the 3 movies into maybe, 5 movies? What is the 'best' size for each .swf that will be published online? You can see the link yourself at www.erfanidmd.com.

thanks, dave. :phil:

LoadMovie With Query String On Local Machine...
Hey Guys,

I've been given a bit of a dog to work on. I'm upgrading a flash presentation that runs via an xml feed. I've added several dynamic flash graph generators external swfs through this data feed but can't seem to pass a query string to the flash presentation via this xml feed. This query string provides an alternate XML datasource for the graph generator.s

I would really like to be able to pass this query string as the current flash graph generators are running off a hardcoded xml filename and I would like to offer some flexibility. I've investigated further and the main presentation loads these extra "slides" with the loadMovie AS which should accept query strings but NOT locally. Is there a workaround to make loadMovie work with query strings locally? I can't run the presenation on a server!!

For example. This XML works locally with the flash presentation;

<slide>
<name>Chart 1</name>
<bullet>chart01.swf</bullet>
</slide>

But this doesn't work locally but does work when running off server;

<slide>
<name>Chart 1</name>
<bullet>chart01.swf?datasource=chart05.xml</bullet>
</slide>

My head hurts.

Thanks in advance for any advice. Even a straightforward "It won't work locally" will help.

Steven.

LoadMovie With Query String On Local Machine...
Hey Guys,

I've been given a bit of a dog to work on. I'm upgrading a flash presentation that runs via an xml feed. I've added several dynamic flash graph generators external swfs through this data feed but can't seem to pass a query string to the flash presentation via this xml feed. This query string provides an alternate XML datasource for the graph generator.s

I would really like to be able to pass this query string as the current flash graph generators are running off a hardcoded xml filename and I would like to offer some flexibility. I've investigated further and the main presentation loads these extra "slides" with the loadMovie AS which should accept query strings but NOT locally. Is there a workaround to make loadMovie work with query strings locally? I can't run the presenation on a server!!

For example. This XML works locally with the flash presentation;

<slide>
<name>Chart 1</name>
<bullet>chart01.swf</bullet>
</slide>

But this doesn't work locally but does work when running off server;

<slide>
<name>Chart 1</name>
<bullet>chart01.swf?datasource=chart05.xml</bullet>
</slide>

My head hurts.

Thanks in advance for any advice. Even a straightforward "It won't work locally" will help.

Steven.

My Loadmovie Works On My Hard Drive But Not Online
please help...

i've tried both:
loadMovie("needtoload.swf", target);
target.loadMovie("needtoload.swf");

both work fine when i publish and test localy but when i upload to my actual site it fails to load my swf...

i made sure that the target movie has an instance name and that everything is in the right directories so i don't know what else to try!

LoadMovie And MovieClipLoader Work Always Locally, But Only 80% Online
I have tried both loadMovie and MovieClipLoader to get swf's to load into other swf's. It works perfect locally, but online, it only works about 80% of the time, also the swf's that won't load changes each time. When I look at the temp internet files, the swf that didn't load is there, but it is corrupt and is only 1K when it should be 20K.

Here is the code that I'm using if it's MovieClipLoader
var myMCL = new MovieClipLoader();
function loadNew(movie, frame){
myMCL.unloadClip(frame);
myMCL.loadClip(movie, frame);
}

Here is the code that I'm using if it's loadMovieFrame

this.attachMovie("loadMovieFrame",1);
function loadNew(movie, frame){
unloadMovie(frame);
loadMovie(movie, frame);
}

This is an example of what is being passed to the function loadNew

loadNew("logout.swf", "loadMovieFrame");

Any Ideas?

LoadMovie Doesn't Work When Publish Online
Hy!

I really have a very big problem:

I have one swf that loads another swf, but if i upload these swfs to my webserver and want to test it the second swf isn't loadet.
all files in the same directory.

the local version works fine.

have tried several versions of loadmovie:
_root.mc_videoplayer.loadMovie("main.swf");
_root.mc_videoplayer.loadMovie("./main.swf");
_root.mc_videoplayer.loadMovie("/main.swf");

have tried the same thing with loadmovieNUM

also checked the classpaths in publish-settings because I'm using a few own Classes, but they work very well...

only loading external swf is my problem.

have anyone heard about such a problem?
realy need help on this!

thanx
emacs

Loadmovie Jpeg Loads Locally, But Not Online
so i have an empty movie clip on the stage that loads an external jpeg. on my computer, i have the jpegs in the same folder as the swf/fla file. i had it load:

on(release){
_root.emptypic.loadMovie("attention_MED.jpg");
_root.emptytext_mc.gotoAndPlay("attention");
}

i uploaded it with the swf in the same directory as the rest of the jpegs, but they didn't load. then i changed the "attention_MED.jpg" to http://site.com/attention_MED.jpg and it still wouldn't load.

and yes, i made sure the jpegs aren't progressive. the weird thing is, they load fine when i'm testing the swf on my computer. they just don't work after i've uploaded them? i don't know what to do!

it seems like i should have an easy answer to this but i can't figure out anything. if anyone could help, i would be the happiest amateur flash person ever!

Loadmovie Jpeg Loads Locally, But Not Online
so i have an empty movie clip on the stage that loads an external jpeg. on my computer, i have the jpegs in the same folder as the swf/fla file. i had it load:

on(release){
_root.emptypic.loadMovie("attention_MED.jpg");
_root.emptytext_mc.gotoAndPlay("attention");
}

i uploaded it with the swf in the same directory as the rest of the jpegs, but they didn't load. then i changed the "attention_MED.jpg" to http://site.com/attention_MED.jpg and it still wouldn't load.

and yes, i made sure the jpegs aren't progressive. the weird thing is, they load fine when i'm testing the swf on my computer. they just don't work after i've uploaded them? i don't know what to do!

it seems like i should have an easy answer to this but i can't figure out anything. if anyone could help, i would be the happiest amateur flash person ever!

Loadmovie Using Multiple Jpg Files Works On Hd But Not Online
I am new to actionscripts and I am quite sure I am overlooking the obvious but here goes:

I have created a flash file to load external jpgs using the loadmovie command. Works fine on my computer but not when I upload it. So, I know I am screwing up the path but I don't know how. The jpgs are in a subdirectory called "image/" The movie runs but it does not load the jpgs.

On keyframe one I have the following actionscript:

url='image/' + wimg + '.JPG'

On keyframe two I have:

loadMovie (url, "bitmap");


I would like to use an absolute url....so assuming my url is www.website.com how would I get the script to access the jpgs that are located in the subdirectory /image ?

Thanks for any help you migh offer.

Orion99

Loadmovie Works Local, But Not When Files Are Uploaded On Server
Subject says it all really... I build an interface in which I load multiple other swf's, works fine, but (since today? ) when I upload all my files to my hosting, and open the interface there, the other swf's won't load.

Any ideas? Ways to figure this one out? tnx in advance - a long time no flash but back in the game newbie

How To Loadmovie The Place Iwant? I Have Loadmovie But It Just Take All The Screen
i load a swf and it just take all the space
and my buttoms and others are all been covered
here is how i do it

onClipEvent (enterFrame) {
ifFrameLoaded (1) {
loadMovieNum ("first.swf", 0);
}
}


i put this in the layer called middle where i have put a instance of a w700 h270 movieclip so i can try to loadmovie the same size of it but it just failed
did i miss anything else? i know i did
please tell me~~~~~~~~~~~~~~~~~~~~~

XML - Local Vs Online
My XML seems to be loading in when I test locally, although won't for some reason when I load it up online.


Code:
quoteXML.ignoreWhite = true;
quoteXML.load("http://www.quotedb.com/quote/quote.php?action=quote_of_the_day_rss");
quoteXML.onLoad = function(success) {
debug.text = "XML: "+success;
if (success) {
}
};
http://www.fireflyinc.com/index_dev.html

You can see that it's not pulling the XML, although when ran locally, it does so correctly. Any thoughts? Server side issue?

LoadMovie Target Vs. LoadMovie Level
can someone please explain to me why when I load an external movie as a target, the action scripting in the loadedmovie doesn't work.
But if i load the movie into a level it works fine. I want to load into a target beacuse I want it positioned in a specific co-ordinate.

thanks

LoadMovie Calling MC With LoadMovie Problem
I am loading a movie clip into a target MC on my timeline and it works fine, but the movie clip that I'm loading in is also using loadMovie to load a movie into a MC on it's own timeline. For some reason, the MC that is getting loaded doesn't load the MC it is calling on it's own timeline. It works fine when I test it out on it's own, but as soon as I load it in using the first MC, the loaded MC doesn't call the movie clip it's supposed to load.

Any suggestions?

-k

(I said "load" way too many times!)

LoadMovie/loadMovie From Loaded Movie?
I know I know .. messed up heading .. but ..

I have a button that loads a swf into an empty mc (sliderContainerMC)

(release) {
_root.sliderContainerMC.loadMovie("http://www.justinsteiger.com/flash/anims/sliderOpen.swf");
}

That works as advertised. The difficulty comes when I tell the button on that swf to load a new swf into the same MC (sliderClose.swf). Since the swf in the MC (sliderOpen.swf) isn't the same swf (loading into a MC in justinsflashsite.swf) do I need to change the path? Say to include something telling it to load the swf into the parent swf?

Eventually the swf that's called into the empty MC is going to have buttons that are supposed to call up other swf's that load in other empty MC's around the site. HELP?!

Thanks,
Justin
http://www.justinsteiger.com/flash/justinsflashsite.fla (Is the parent swf)

Loadmovie Inside Loadmovie Problem?
Hi,

I have a main movie which use's the loadmovie function to load up an external SWF. But then inside that SWF there is another loadmovie function to load another external SWF into that.

But the problem is that when the first movie is loaded all of its loadmovie commands are disabled.

Is there something i could do to rectify this?

Thanks,
T

[F8] Need To Change A Variable In A LoadMovie Mc While In Another LoadMovie Mc
So I have a shell mc that has 2 mc's loaded into it with loadMovie (let's call them project1 and project2). While I'm in project1...how do I change a variable in project2 to be true instead of false?

I thought I could do it like this (in Project1...):
myBtn.onPress = function()
{
_parent.dropZone_project2.myVar = false;
}

Nothing seems to be working. Any insight would be greatly appreciated.

Resize LoadMovie Container, Not LoadMovie?
I've searched and searched but haven't found what I'm looking for.

I'm wanting to load different sized .swf into the same field and I want the field to adjust (preferably some smooth transitions for the size change) to fit the size of each different .swf loaded. I've seen it done on quite a few sites but I haven't been able to find a tutorial of any kind addressing this specifically. Can anyone help?

I'm keeping it simple, i.e. thumbnails with titles above or off to the side; click one; the field where the .swf will play adjusts itself; .swf loads and plays. When completed, user can click another thumbnail and the previous .swf will "unload" then the field adjusts for the new .swf and the new one loads. Follow me? Just any tutorial you guys may know of would be great.

Here's the closest example I could find... cool site too. http://www.pollenation.org

Loadmovie Over Prev Loadmovie And Positioning Jpg
Hello, a little question and i have the feeling i am very close.

i use loadmovie to load an image into an movieclip.
that movieclip goes to the position x and y of the movieclip - the loaded image width/2

my problem is that when i load a new image the position is not correct.

my code:
--------------------------------------------------------------------------------------------------------------------
function nextImage1()
{
if (p < total - 1)
{
++p;
if (loaded == filesize)
{
trace(p);
trace("x van inst0"+litlimg_instance.ltlimgmc_instance0._x);
trace("y van inst0"+litlimg_instance.ltlimgmc_instance0._y);
litlimg_instance.ltlimgmc_instance0._alpha = 0;
litlimg_instance.ltlimgmc_instance0.holder.loadMovie(image[p], 1);

var maxWidth = 250;
var maxHeight = 200;

var myWidth = litlimg_instance.ltlimgmc_instance0._width;
var myHeight = litlimg_instance.ltlimgmc_instance0._height;
// Calculate percentage by which image will need to change to fit
if (myWidth > maxWidth){
var xscalePercent = (myWidth*100)/maxWidth;
}
if (myHeight > maxHeight){
var yscalePercent = (myHeight*100)/maxHeight;
}
// Multiply both height and width by the bigger percentage
if (xscalePercent>yscalePercent) {
litlimg_instance.ltlimgmc_instance0._width /= (xscalePercent/100);
litlimg_instance.ltlimgmc_instance0._height /= (xscalePercent/100);
} else {
litlimg_instance.ltlimgmc_instance0._width /= (yscalePercent/100);
litlimg_instance.ltlimgmc_instance0._height /= (yscalePercent/100);
}
var test=litlimg_instance._x-(litlimg_instance.ltlimgmc_instance0._width/2);
trace("width img:"+litlimg_instance.ltlimgmc_instance0._width);
trace("width:2 :"+litlimg_instance.ltlimgmc_instance0._width/2);
trace("x position must be:"+test);
trace("x position is:"+litlimg_instance.ltlimgmc_instance0._x);
trace("----------------------------------------------------");

litlimg_instance.ltlimgmc_instance0._x=litlimg_instance._x-(litlimg_instance.ltlimgmc_instance0._width/2);
litlimg_instance.ltlimgmc_instance0._y=litlimg_instance._y-(litlimg_instance.ltlimgmc_instance0._height/2);
slideshow();
} // end if
} // end if
} // End of the function


function slideshow()
{
function pause_slideshow()
{
clearInterval(myInterval);
if (p == total - 1)
{
p = 0;
firstImage1();
}
else
{
nextImage1();
} // end else if
} // End of the function
myInterval = setInterval(pause_slideshow, 4000);
} // End of the function

p = 0;
--------------------------------------------------------------------------------------------------------------------

what i do is i have an array with the image links.
on a interval i load an image. and if p has reached the number of loaded images i start over again.

i traced the following while testing a bunch of images:
-------

1
x van inst0-125
y van inst0-93.55
width img:250
width:2 :125
x position must be:-125
x position is:-125
----------------------------------------------------
2
x van inst0-125
y van inst0-93.55
width img:258.05
width :2 :129.025
x position must be:-129.025
x position is:-125
----------------------------------------------------
3
x van inst0-129
y van inst0-93.55
width img:140.3
width :2 :70.15
x position must be:-70.15
x position is:-129
----------------------------------------------------
4
x van inst0-70.15
y van inst0-93.55
width img:243.2
width :2 :121.6
x position must be:-121.6
x position is:-70.15
----------------------------------------------------
1
x van inst0-125
y van inst0-93.55
width img:250
width :2 :125
x position must be:-125
x position is:-125
----------------------------------------------------

It looks like he takes the position of the prev image or something like that.

Please some help here.

Greetz. Jacob

Ps: this was some code i posted.. i would like to know how you put it into such a nice code block on the forum so it becomes more readable.

Set LoadMovie Time, UnloadMovie, LoadMovie
in that order-

Put simply-
can anyone guide me to any resources that would explain how to do this?

1. Load 2 swf's into empty mc's (this part is already done)
2. Have those 2 swf's be on the stage for 3 seconds.
3. Unload those 2 swf's.
4. Then load a completely new swf once those have been unloaded.

Local Or Online Detection
Hi,

when I develop locally flash projects with external XML, I use a xml link like this :

file.load('xml/home.xml');

But, when I put the project online, I don't want to have the XML file in cache so I use this line instead :

file.load('xml/home.xml?nocache=' + random(65000));

So my question is, is it possible to detect if I'm calling the flash locally or online???? So this way, I would not need to change manually the path

thank

turb

Works Local,not Online
Hi I made this mp3 player.With a combo box to switch between tracks.I named the combo box cobo.This works great locally but i I put it on line and choose a song it plays,but if I choose another song and come back to the other one nothing happens.I can play it as many times as I want locally though.I don't understand it a bit.

ActionScript Code:
var curTrackNum:Number = 0;
var totalTracks:Number = 41;
var mySound:Sound;
var list:Object = new Object();
list.change = function(){
    curTrackNum = cobo.selectedIndex
    gg = cobo.value
    playMusicFunc();
       
}
cobo.addEventListener("change",list);
                                      
function playMusicFunc(){
mySound = new Sound();
mySound.loadSound(("mp3-" + curTrackNum + ".mp3"),false)
mySound.onLoad = function(){
   
mySound.start(0,9999)

}
}

Open Online Swf If Local Is Not There
Hi

I am working on projector file running locally
there is link that open a swf file in projector.

I want to know how can i tell that link
if the swf file is not availabe locally then open it from web.

Something like this

function openLocal (){
loadMovie("test.swf",3)}

function openWeb (){
loadMovie("http:domain.com/test.swf",3)}

if (openLocal == Error)then openWeb.

something like that

Thanks

Correct Local Display, Not Online?
Hello, i got a little trouble here

I have a mc with a button.
Till then, all is normal hopfully

When the button is pressed it should send vars to a php page which will display the var.

So i use this in as:
on(release){
Imp = new LoadVars();
Imp.ref =_root.Detail.Ref;
Imp.send("http://blabla.com//imprime.php","POST");
//where blabla is the webpage of course
}

And in php:
$Ref=$ref;
echo "DETAILS
";
echo urldecode($Ref);
?>


So, what do we have here?..
When i press Ctrl+Enter to see the results, it works! i see another page displaying
DETAILS
H95
where h95 is the Ref..
But when I press Ctrl+F12 to see as html, it displays only DETAILS, not the ref..
Same thing if i publish the page online...
Where am i wrong??

Loading Local Files Into Online Movie?
ok, this is a rather long one:

I have an online player which loads swf-slides in movie clips. On every slide there are placed several linking buttons which go to a next slide and preload the slides of the respective link into hidden clips. You only get to see the next slide as soon as all of the possible linking slides are loaded.
It works OK online, as long as the user has a good connection: With every link there are 18k (average) to preload. I tested with different systems and browsers at 28k and 56k.

But, as usual, some of the visitors with a slow, instable connection are a little upset, because they get the slide too late or not at all, which breaks the storyline. I built in a movie to keep the connection alive, but waiting longer than 20 secs for the next possible user interaction doesn't seem to make them really happy...
If there were not more than say 120k in total i would preload all the slides at once before playing, with a nice loading blablah effect, but it is a total of more than 200 slide files (>1.6MB).

So i think i could make an option when starting the online player, asking people with a slow connection to download the slides to their local drive before the show.
- I could make the files cached, and ask users not to clean the cache. But the users with a slow speed i know are usually the ones that think 'cache' is a french insurance company, and explaining them the browser options doesn't make it less complicated.
- I could ask them for a download path, and save the local path in a cookie, telling them to enable cookies and to extract the movies from a zip or sit: makes it even more difficult to explain to a newbie user.
- I could leave out the cookie thing and ask them for the local path for the files (same as above^2)
- I could say 'sorry my friend, your connection speed is not my problem' (I would not like that)

Is there a good, simple offline->online solution?
What is your opinion?

Script Works On Local Disk But Not Online
The script below works absolutely perfect when executed from my hardrive, but once i upload it, it encounters problems. There are thumbnails which when clicked on load up a larger image, which has a resizing border depending on the dimensions of the image. If the .jpg is not in the users cache, the resizing border fails and shrinks in size and the the jpg loads up in a weird position. But now that the .jpg is in the cache, if the thumbnail is clicked again, it loads up perfect.

My guess is that the resize code should only function once the jpg has fullyy loaded in the memory but can't figure the code out.

Any suggestions?

heres the code:

code: spacing = 10;
containerMC._alpha = 0;

MovieClip.prototype.loadPic = function(pic){
_root.containerMC._alpha = 0;
this.loadMovie(pic);
_root.onEnterFrame = function(){
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1){
var w = containerMC._width + spacing, h = containerMC._height + spacing;
border.resizeMe(w, h);
delete _root.onEnterFrame;
}
}
};
MovieClip.prototype.resizeMe = function(w, h){
var speed = 5;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._width-w)<1){
this._width = w;
this._height = h;
_root.containerMC._x = this._x - this._width/2 + spacing/2;
_root.containerMC._y = this._y - this._height/2 + spacing/2;
_root.containerMC._alpha = 100;
delete this.onEnterFrame;
}
}
};

*edit: added AS tags for clarity.
gparis

Picture Gallery Works Local But Not Online
Hey there all you pro´s in Actionscript.

I want to built a Picturegallery. So now I´m at the Point that the big picture is loaded out of a XML-File... well at the moment not so clean beacuse I have to get the thumbs as well out of the XML-File... well thats just a little Explanation...

well on my computer everything works fine... but when I upload it to a Server it doesn´t work. I see my thumbs and I can klick them but the bigger pictuer is not displayed.
I tried to change _root. with this.
Maybe I have a timing Problem? I´m a lil bit stuck right now. maybe you have an Idea.
Here is the code so far. remember I´m in the process so its not so clean .


PHP Code:



//Slider  www.flashstar.de
this.onEnterFrame = function() {
    if (_ymouse<=20 && _ymouse>=20 ) {
        if (_xmouse<350 ) {
            slider._x += (375-_xmouse)*0.005;
        }
        if (_xmouse>400) {
            slider._x += (375-_xmouse)*0.005;
        }
    } else {
        // wäre für eine Rechtsbewegung
        slider._x += (375-_xmouse)*0.02;
    }
    slider_r._x = slider._x+slider._width;
    slider_l._x = slider._x-slider._width;
    if (slider._x>750+slider._width*0.5) {
        slider._name = "temp";
        slider_l._name = "slider";
        temp._name = "slider_l";
    }
    if (slider._x<0-slider._width*0.5) {
        slider._name = "temp";
        slider_r._name = "slider";
        temp._name = "slider_r";
    }
};
movieclip.prototype.blend = function(obj, faktor) {
    if (obj.hitTest(_root._xmouse, this._ymouse, true)) {
        obj._alpha = obj._alpha+(100-obj._alpha)/faktor;
    } else {
        obj._alpha = obj._alpha+(50-obj._alpha)/faktor;
    }
};

pict_bg_mc._alpha = 0;
pict_bg_mc._visible = false;
pict_bg_mc._height = Stage.height;
pict_bg_mc._width = Stage.width;
pict_load_mc._alpha = 0;
pict_close_mc._visible = false;

//Load bigger Picture
MovieClip.prototype.pict_load = function (pict_clip, pict_target, pict_width, pict_height)
{
    _root.pict_bg_mc._visible = true;
    _root.pict_bg_mc._alpha = 0;
    _root.pict_close_mc._x =  Stage.width-(_root.pict_close_mc._width);
    _root.pict_close_mc._y =  pict_close_mc._height/2;  
    

    var _loc2 = new Object();
    _loc2.mcLoader = new MovieClipLoader();
    _loc2.mcLoader.addListener(_loc2);
    _loc2.mcLoader.loadClip(pict_clip, pict_target);
    _loc2.mcLoader.onLoadProgress = function ()
    {
        var _loc3 = pict_target.getBytesLoaded();
        var _loc2 = pict_target.getBytesTotal();
        var _loc4 = Math.round(_loc3 / _loc2 * 100);
        _root.pict_bg_mc._alpha = _loc4;
    };
    _loc2.mcLoader.onLoadComplete = function ()
    {
        _root.pict_close_mc._visible = true;
        _root.pict_load_mc._x = Math.round(Stage.width / 3 );
        _root.pict_load_mc._y = Math.round(Stage.height / 2  - pict_height / 2 + 2 );
        _root.pict_load_mc._alpha = 100;
        _root.pict_bg_mc._alpha = 90;
    };
};

var _xml2 = new XML();
_xml2.ignoreWhite = true;
_xml2.load("fotos.xml.php");


pict_close_mc.onRollOver = function ()
{
    pict_close_mc.gotoAndStop("over");
};
pict_close_mc.onRollOut = function ()
{
    pict_close_mc.gotoAndStop("out");
};
pict_close_mc.onRelease = function ()
{
    pict_bg_mc._visible = false;
    pict_close_mc._visible = false;
    pict_load_mc._alpha = 0;
};
pict_bg_mc.onRelease = function ()
{
};

//Test to load Pictures out of XML-File
_root.slider.bild4_mc.onRelease = function(){
    
    pict_load(_xml2.firstChild.childNodes[0].attributes.pfad, _root.pict_load_mc, _xml2.firstChild.childNodes[0].attributes.xwert, _xml2.firstChild.childNodes[0].attributes.ywert);
    
    
    };
_root.slider_l.bild4_mc.onRelease = function(){
    
    pict_load(_xml2.firstChild.childNodes[0].attributes.pfad, _root.pict_load_mc, _xml2.firstChild.childNodes[0].attributes.xwert, _xml2.firstChild.childNodes[0].attributes.ywert);
    
    
    };
_root.slider_r.bild4_mc.onRelease = function(){
    
    pict_load(_xml2.firstChild.childNodes[0].attributes.pfad, _root.pict_load_mc, _xml2.firstChild.childNodes[0].attributes.xwert, _xml2.firstChild.childNodes[0].attributes.ywert);
    
    
    };
    //
_root.slider.bild5_mc.onRelease = function(){
    
    pict_load(_xml2.firstChild.childNodes[1].attributes.pfad, _root.pict_load_mc, _xml2.firstChild.childNodes[1].attributes.xwert, _xml2.firstChild.childNodes[0].attributes.ywert);
    
    
    };
_root.slider_l.bild5_mc.onRelease = function(){
    
    pict_load(_xml2.firstChild.childNodes[1].attributes.pfad, _root.pict_load_mc, _xml2.firstChild.childNodes[1].attributes.xwert, _xml2.firstChild.childNodes[0].attributes.ywert);
    
    
    };
_root.slider_r.bild5_mc.onRelease = function(){
    
    pict_load(_xml2.firstChild.childNodes[1].attributes.pfad, _root.pict_load_mc, _xml2.firstChild.childNodes[1].attributes.xwert, _xml2.firstChild.childNodes[0].attributes.ywert);
    
    
    }; 




Thanx for any answer!

phily

Shared Objects, Local And Online Access
All,

Is it possible to create a local shared object from an online swf, then read from that shared object with a local projector file?

I'm building an "occassionally-connected" application; the user should be able to save information they produce while they're online, and then retrieve that information later when they're not connected. Seems like a common thing to do. How does one accomplish this?

Many thanks again for any advice or insight!

Cheers,
Matt Stuehler

[F8] Preloading Clips Internally. Working Local But Not Online.
Hi guys.

Im busy with my new site and I have hit a wall.

Im using the following code



Code:
stop();

var image:MovieClip = handleClip;

var mcLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
// trace(target + ".onLoadProgress with " + bytesLoaded + " bytes of " + bytesTotal);
//trace(Math.round((bytesLoaded / bytesTotal)*100));
counter.txt1.text = ((Math.round((bytesLoaded / bytesTotal)*100) + "%") );
}
mcLoader.addListener(listener);
mcLoader.loadClip("quickport.swf", image);


var interval:Object = new Object();
interval.id = setInterval(checkProgress, 100, mcLoader, image, interval);

function checkProgress(mcLoader:MovieClipLoader, image:MovieClip, interval:Object):Void {
//trace(">> checking progress now with : " + interval.id);
var progress:Object = mcLoader.getProgress(image);
//trace("bytesLoaded: " + progress.bytesLoaded + " bytesTotal: " + progress.bytesTotal);
//trace(Math.round((progress.bytesLoaded / progress.bytesTotal)*100));
if(progress.bytesLoaded == progress.bytesTotal) {
clearInterval(interval.id);
counter.gotoAndPlay("out");
}
}


This code calls swf files, jpgs, etc into image holders (blank mc's)

The preloader image is a spinning flower with dynamic text field that shows the % loaded.

Everything work 100% when testing locally with the simulate download feature but once I upload it the preloader shows and then fades out as if the movie is loaded. There is a interval and then the movie shows.

Any ideas.

I have attached a sample file. Just add your own quickport.swf to preload.

If this is not the right way to do internal preloaders then please tell me what is. I want a preloader that I can simply copy and paste into any section of the site. I would prefer to keep the preloader internal so I can use it for sound, images, swf etc.

Thanks

[CS3] Making A Local Flash App (.exe), That Communicates With An Online Server?
Hello there.

I was wondering if this would be possible:

I'd like to make a local flash client application for people to download it (so it should preferably be an .exe file), which can then interact (send/receive data) with an online server where I'll upload stuff.

Do flash player security restrictions allow this to happen?

An example:

Simple application with a couple of text fields where the user enters his login information (username/password). Once he clicks a button, the data is sent to an online .php file, which then compares the values against the ones in a database and returns a response accordingly.

I have already managed to do something similar, the flash file only calls the myLoadVars.load() function to download a .txt file where the values are stored. It seems to work fine without asking for any permissions when I run it as an .exe, but I was wondering if it would be ok when I try to send data to the outside as well.

Also, given that I'd like to make a standalone .exe application, what would be the best approach? I'd like to get rid of any signs of "Flash Player" here and there (including the window caption itself, right click menu, etc.), so that people can't really tell if it's a Flash application or what.

I've searched a bit an found some software called "SWF Studio", but the post was from 2002 so I'm not sure it's feasible now.

Any tips would be much appreciated.

My Server Is Local Host, How Do I Get To Connect From Online Website?
my server is localhost
how do i get it to connect, like say i am on local, and a friend connects from his computer on other side of world through my router's ip address.

it will display every thing needed, but it will not connect to my server. i can and i can see it in the manager, but i do not see him.

so how can i fix this problem?

regards Roman

Externally Loaded Sound Works On Local Machine, But Not Online.
I'm using loadSound to load in external MP3 files and they load and sound great on the local machine but don't work when I upload the files to the web. I'm pretty stumped. The MP3 files are only like 10k and 60k so it can't be a size issue (I'm on a T1 line here at work too).

Here is the site:
http://www.littlefenris.com/v2/

Basically when you walk close to the fire you should hear the fire crackling and it will get louder as you get even closer. Everything works on my PC, just not online.

Any ideas what the issue could be?

Here's the AS code for the fire:


ActionScript Code:
var campFireSFX:Sound = new Sound();//CAMPFIRE SOUND_root.campFireSound_mc.onEnterFrame = function() {    fireXDist = Math.round(this._x-fenris_mc._x);    fireYDist = Math.round(this._y-fenris_mc._y);    campFireDistance = Math.round(Math.sqrt((fireXDist*fireXDist)+(fireYDist*fireYDist)));    if (campFireDistance<200) {        if (breakIt != true) {            campFireSFX.start(0, 9999);            breakIt = true;        }    } else {        breakIt = false;        campFireSFX.stop();    }    campFireSFX.setVolume((maxVolume-campFireDistance)/2);};campFireSFX.loadSound("/sounds/319524_CampFire.mp3");

Copyright © 2005-08 www.BigResource.com, All rights reserved