PDA

View Full Version : loading .swf can't find url?????


rita1608
02-04-2005, 01:14 AM
Hello,
I building gallery with combobox and scroll pane.
My combo box is supposed to load external swf.files into the scrolling pane but I keep getting the output error
"Error opening URL "file:///F|/Web//flash/MyPhotoGallery/gallery1"
although this gallery1. swf is definetely located at this location..
here's the script for the combobox

onClipEvent (load)
{
var n = 0;
class_lv = new LoadVars();
class_lv.onLoad = function ()
{
var class_name = new Array();
var class_id = new Array();
var i = 0;
while (i < this.number)
{
class_name = this.classname.split("|");
class_id = this.classid.split("|");
i++;
} // end while
var i = 0;
while (i < this.number)
{
_root.class_mc.addItem(class_name[i], class_id[i]);
i++;
} // end while

};
and this is script for the scrolling pane

/ set constants
var myContent = myScrollPane.getScrollContent();
var imageWidth = 67;
var imageHeight = 100;
var imageWidth1 = 400;
var imageHeight1 = 601;

system.usecodepage = true;

_root.img.horizontal._visible = false;
_root.img.vertical._visible = false;

function clickCheckA()
{
_root.attachMovie("img_mc", "img_mc", 1);
_root.img_mc.filename = _root.class_mc.getValue();
_root.button_img.setScrollContent(img_mc);
_root.button_img.refreshPane();
} // End of the function
loadVariablesNum("http://localhost/text/images/gallery1.swf", 0);

Where is my mistake?
Any ideas?
Thanks
Rita

black
02-04-2005, 03:36 AM
try domain name instead, eg the path like this: domain is: http://www.mydomain.com/text/images/gallery1.swf

rita1608
02-04-2005, 05:58 AM
hey black,
Thank you for suggestion but it doesn't seem to work either ....
Thanks anyway,
Rita

glasses248
02-04-2005, 08:34 AM
I think....
loadVariablesNum("http://localhost/text/images/gallery1.swf", 0);

should be...
loadVariablesNum("text/images/gallery1.swf", 0);

Assuming that the file is sitting on the htdoc folder and the gallery1.swf is buried in text/images folder.

You might want to check your gallery1.swf file and make sure it has variables within it.

Otherwise....
Make sure your file and gallery1.swf is sitting in the same folder. Than you can juse use...
loadVariablesNum("gallery1.swf", 0);
to directly access the variables in the gallery1.swf.

I hope this helps.

Programatorul
02-04-2005, 01:51 PM
is your currently playing file in the exact same domain as the SWF file?

dont know if helps but look at this (extracted from Help):


In SWF files running in a version of the player earlier than Flash Player 7, url must be in the same superdomain as the SWF file that is issuing this call. For example, a SWF file at www.someDomain.com can load variables from a SWF file at store.someDomain.com, because both files are in the same superdomain of someDomain.com.

In SWF files of any version running in Flash Player 7 or later, url must be in exactly the same domain (see Flash Player security features). For example, a SWF file at www.someDomain.com can load variables only from SWF files that are also at www.someDomain.com. If you want to load variables from a different domain, you can place a cross-domain policy file on the server hosting the SWF file that is being accessed. For more information, see About allowing cross-domain data loading.

rita1608
02-04-2005, 07:40 PM
Thank you so much both of you guys,
Actually, at this stage I don't deal with domain name yet, only my local testing server.
I tried this:
loadVariablesNum("gallery1.", 0);
in this case I get the same mistake just by clicking test the movie

"Error opening URL "file:///F|/Web//flash/MyPhotoGallery/gallery1"
and then additionally clicking on the combobox tab gallery 1 I get another error like this, the original error i used to get.
"Error opening URL "file:///F|/Web//flash/MyPhotoGallery/gallery1"
ugh, I wish i knew what's going on...lol
gallery1 is just a movieclip of lots of thumbnails that scrollpane holds...

Any ideas that it can be???
Thanks all of you,
Rita

CyanBlue
02-04-2005, 08:04 PM
Howdy... :)

If you could post a sample, I'll take a look...
But, are you really wanting to load the SWF file via loadVariablesNum() function not loadMovie() function??? loadVariablesNum() function could load TXT file that contains the data, but not SWF file...

UncleML
02-04-2005, 08:05 PM
I don't know whether I can help you or not as I'm trying to figure out what you meant "gallery1 is just a movieclip of lots of thumbnails that scrollpane holds...". Are you trying to say that all the thumbnails are imported into movieclips (already in your fla library) and not loaded externally during runtime?

rita1608
02-05-2005, 04:56 AM
Thank you CyanBlue and UncleML for trying to help me,
I appreciate it so much, :)

Yes, UncleLM, gallery1.swf is a movie clip with lots of thumbnails which is held by the scrolling pane.
I have a combobox that has 6 labels, (gallery1,gallery2,gallery3 etc..)
Each gallery is external movieclip that each has a certain number of thumbnails. I put them all on my testing server(Is this the right location for them?)
my plan is to make the combobox load each of those galleries into the scroll pane (this is where I am stuck right now)and eventually I am planning to make the thumbnails from the galeries load the big image on the main loading screen of the stage.
Dear CyanBlue, please take a look at the script
this is the script for my combobox(instance class_mc):

onClipEvent (load)
{
var n = 0;
class_lv = new LoadVars();
class_lv.onLoad = function ()
{
var class_name = new Array();
var class_id = new Array();
var i = 0;
while (i < this.number)
{
class_name = this.classname.split("|");
class_id = this.classid.split("|");
i++;
} // end while
var i = 0;
while (i < this.number)
{
_root.class_mc.addItem(class_name[i], class_id[i]);
i++;
} // end while
class_lv.load (........ class_lv, "GET");
}

I have a data base where I assign each gallery a class id ad each picture
and id to each picture in a certain gallery, I have this done in Ms Ascess, how do I load it into the script?


Here's the script for my scrollpane

// set constants
var myContent = myScrollPane.getScrollContent();
var imageWidth = 67;
var imageHeight = 100;
var imageWidth1 = 400;
var imageHeight1 = 601;

system.usecodepage = true;

_root.img.horizontal._visible = false;
_root.img.vertical._visible = false;

function clickCheckA()
{
_root.attachMovie("img_mc", "img_mc", 1);
_root.img_mc.filename = _root.class_mc.getValue();
_root.button_img.setScrollContent(img_mc);
_root.button_img.refreshPane();
} // End of the function
loadVariablesNum(....0); // *.....not sure which variable to load here,


Please could you help me out with it,
Also CyanBlue, are you planning to make tutorials on more complicated galleries in the nearest future? I would really appreciate if I could find something like this in a tutorial where it explains the steps and their meaning, just like you did with the 101 Gallery
Thanks,
rita

sketch
02-05-2005, 05:29 AM
need more info on this or can u post ur fla to check ur code.. :confused:

test the swf file in locally rather than in ur local server as virtual directory.

test it as normal swf file calling the gallery.swf in it. :)

regards
sketch
:)

CyanBlue
02-05-2005, 11:54 AM
Hey, Rita... You do need to post some sample cuz what you have posted does not mean much...

Also, you might want to make sure that you use correct function calls to load the SWF files as I have mentioned earlier...

As for the tutorial... Yeah... I sure will write one or two more that will add some more stuff like the scrollPane or comboBox on top of what I have so that I can show you how to advance the progress, but not any time soon...

UncleML
02-05-2005, 01:14 PM
Rita, I've read your postings and I admire your attitude and politeness. You may send your source file .fla to my email address (loveanitamui100@yahoo.com) so that I can try my best to to help you out for the URL problem you encountered.

rita1608
02-05-2005, 10:01 PM
Dear sketch, CyanBlue and UncleML,
Thanks for trying to help me. I appreciate it so much...
Here's the source file. (I was not the one who created this code, it was some great guy who did it)I just found it and it's very similar to what I want to do so I was trying to learn how he build it and was trying to modify in in correspondence with my needs. Hovewer, I got stuck since I keep having this url problem.
Please take a look at it and would be glad to hear your comments,suggestions/corrections.
Thanks again,
Rita
P.S. Here's the original source file I was working with, the difference is that I am dealing with testing server on my computer and I have 6 galleries in the combobox: gallery1,gallery2,gallery3,etc....
http://www21.brinkster.com/cheefong/index.asp
thanks

UncleML
02-06-2005, 02:40 AM
Rita, the problem arose from your own source that you modified from the original source. Without your own source file for our checks, it's not a smart move to advise you what had gone wrong, because we don't know what have you modifed.

I've done a rough check on the original source and I would have to say that it's too advanced a feature for you to follow through should you have no basic understanding on the external loading of files, let alone something like asp. Why not you start from the very basic code, like loading external jpg file where you define the link within the swf file you're working on? As you get familiar with that, do a basic scrollpane and load your images into it.

This program actually pull the image link via the formatting taken from the asp file and load the external jpg into the attached movieclip with linkage "symbol81". From your earlier postings, it seems that you're actually embed your images into a "gallery.swf" file. This is different concept from the original source in which all the images are loaded externally from the given link, and when the thumbnail is clicked, it will do the animation for that loaded image in a larger size.

Some of the asp files missing like "coolfusion.asp", "flashconfig.asp", and the sound file "sound.swf". But anyway, it's not the problem, somehow I managed to download them from the link you mentioned. The problem with yours has something to do with whether you truly understanding the concept of this program especially on the part of how the images are extracted and loaded.

CyanBlue
02-06-2005, 03:51 AM
I do not have the comboBox set up yet, but here is the one with the ScrollPane if you are interested...
http://tutorials.flashvacuum.com/tutorials/Flash/Gallery102/index.php

I probably need to change things around once I add the comboBox on top of that... (Don't know when it is going to be though...)

rita1608
02-06-2005, 04:22 AM
Hello UncleML and CyanBlue,
Thanks so much for your replies.
You are right UncleML I will go the different way and will try to start from basics, but ideally the example I attached would be something I would like to aspire for....I hope I will be able to make something similar one day.....

Dear CyanBlue, thanks so much for your tutorial and I am very excited to learn everything you mentioned there. I am going to work on this now and see what I will be able to do, It's just a perfect start for me.
THAAAAAAAAAAAAAAANKKKKKKK YOUUUUUUUUUU!!!
:)
Rita
P.S Is adding combo box will need lots of ammendments in the script?
Will I have to use binding component to retrieve the external .swf files???
will be looking forward to your tutorial with combobox addition
thanks again

CyanBlue
02-06-2005, 05:35 AM
Well... Here is the comboBox + scrollPane version...(I do not have any tutorial written for this cuz I did not set any direction yet... No plan or no brain at the moment... Hence Gallery10X... :D)
http://www.flashvacuum.com/~tutorials/tutorials/Flash/Gallery10X/Gallery10X.html
http://www.flashvacuum.com/~tutorials/tutorials/Flash/Gallery10X/Gallery10X.zip

Obviously I do need to add several things in there, but if you can think of anything that's missing, please let me know so that I can revise the file further... (Of course, you'll need to make sure the file works cuz I have not done much testing...)

rita1608
02-06-2005, 06:16 AM
Dear CyanBlue, You are really the best!!!
Thank you so much....
Right now I am working on your 102 Gallery everything works fine I had some problems with scroll pane but I think i figured it out.
I am going to look forward to try my dream version of photo gallery, but I just want to make sure I understand everydetail you mention in your 102 tutorial, so I can move on!!!!
Thanks you so much once again!!!
Have to go back to work :D
Talk to you all soon!!
Rita

CyanBlue
02-06-2005, 06:21 AM
Glad to be of your service... Let me know if you have any question... :)

OUCH... You have to go back to work on Sunday??? (I guess it still is Sunday no matter what part of the Earth you are right now...) Dang...

rita1608
02-06-2005, 06:27 AM
Hi CyanBlue,
LOL, it's me again, (you probably got tired of me already huh :p )
Well, yes I am definetely going to work on Sunday, I just love it I am so anxious to do the last step, I am in Ca right now(I am Russian by the way :) )
You know i did get some strange error doing you 102 tutorial
i managed to put the scroll pane but it says:

**Error** Symbol= ScrollPane, layer=Assets, frame=1:Line 1: The class 'FScrollPaneSymbol' could not be loaded.

Total ActionScript Errors: 1 Reported Errors: 1
where is it asset layer??? what went wrong here?
any suggestions please?
Thanks
Rita

CyanBlue
02-06-2005, 07:09 AM
Hey... :)

Hm... A Russian working in CA??? Hope it's not tha cold in CA... :)

Uh... Do you work on FMX or FMX 2004???

Do you get that error message when you try my own sample or do you only get that error message with your own sample???
The only Assets layer that I can see is within the ScrollPane and ScrollBar component's main timeline...

rita1608
02-07-2005, 10:58 PM
Dear CayanBlue,
i work with FMX2004pro
Thanks so much, Your gallery 103 was a lot of help for me. It's working really great.
I have a question, how do I change the appearance of the components? also how can I do an outline of each of the thumbnails? do I need to change the script or the text file?
I was thiking of adding sound to the gallery as well
should I just creat a different frame in the action layer and add
attachmovie(sound.swf)
Thanks again,
the tutorials are great and they do work !!!
Rita

CyanBlue
02-08-2005, 02:41 AM
Just to let you know... I won't be able to log online for a couple of days... I am not running away... :D

Okay... Component... Check out the Flash manaul... It's got good amount of information on how you can customize the component... and I don't now much about them especially if it is FMX 2004... ;)

Outline... There are variety of ways of doing it... But if I were to do it, I'd just create a function that will draw a square box via drawing API whenever you need to display the outline and erase it whenever you need to hide it...

Sound... I am not quite getting this part... What sort of sound are you talking about??? Are you talking about something like a clicking sound effect or a background music???

At any rate, all those you said sounds like a good ones that you can first start working on the new file and get the functionality working, and then apply to the gallery you have... That might be whole lot easier than fiddling with the current code... Just a thought... ;)