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




XML Referencing Files--absolute Or Relative



I have gone through the tutorial http://www.kirupa.com/developer/mx20...otogallery.htm
and I have the slideshow.swf loaded into the main movie, start.fla.
The only problem is start.fla is in the parent directory. I can get the UI to come
up with no problem, but when I try to load the XML file, start.fla or slideshow.swf is looking in the parent and not the child directory.

start.fla-------
images/slideshow.swf
images/images.xml

In my start.fla I have this
loadMovieNum("slideshow.swf", 50);
Why am I having this problem, and how can I fix it?
Thanks.



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 10-19-2004, 11:35 AM


View Complete Forum Thread with Replies

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

XML Referencing Files--absolute Or Relative
I have gone through the tutorial http://www.kirupa.com/developer/mx20...otogallery.htm
and I have the slideshow.swf loaded into the main movie, start.fla.
The only problem is start.fla is in the parent directory. I can get the UI to come
up with no problem, but when I try to load the XML file, start.fla or slideshow.swf is looking in the parent and not the child directory.

start.fla-------
images/slideshow.swf
images/images.xml

In my start.fla I have this
loadMovieNum("slideshow.swf", 50);
Why am I having this problem, and how can I fix it?
Thanks.

::relative Or Absolute::
in action scripting is relative path, or absolute path? In html you use relative and its easier, but in flash is it any better?

Thanks
n

sorry ill stop with the dumb quesions soon!

Absolute, Relative
simple question what is the difference between relative and absolute when chosing movie clip actions for a button instance..... just wondering ive noticed that my buttons will work with one sometimes and sometimes the other??

Absolute Or Relative?
nesting problem
How I could apply a values to the dynamic text located into movie Clip.
When the dynamic text fields nested in button are stationed onto the root (actually button is) they easy accept the values loaded from the text file (loadVariablesNum(“text.txt”, 0); ).
But when the button is nested (converted)in MC; probably, I have to point out explicit where are they located.
I try i.e.
_root.container_mc.name_btn.buttonUp = buttonUp;
But it stays empty.
Thanks for help

Relative URL To Absolute URL
Is there a method in Flash to convert a relative url to the absolute url?

Basically, I need a function like:

relativeToAbsoluteURL("image1.png");

It would return: "http://www.site.com/image1.png".

I would assume it HAS to be in there somewhere undocumented becasue anytime you make a request for a file it's done internally. Check out any IOError. It lists the whole absolute filename.

If not, I'll just have to write a little parser based off of root.loaderInfo.url. :/

Thanks!

Absolute VS Relative
hello! I dont quite understand the difference between absolute and relative paths.
If im not mistaken its just to different ways to show FLASH player were a certain object is. I could not find a tutorial for this.

The way i am used to and understand is:


Code:
_root.mymovieclip.mybutton
is this absolute or relative?
how do the other one work?
what about the conflict when you load a movieclip into another?

Absolute Relative URL
Hi

I'm new to Flash and ActionScript this is my first post.

I've created an animation that contains a command button this I have published in a Web page. This page is called Index.html and lives in a Folder called Animation that lives in a folder called Site.

I have a second page called Frameset.html that lives in a folder called Pages that lives in the same folder as Animation i.e. Site. I need to open Frameset.html by clicking the button on the animation in Index.html.

I can do this by using the absolute URL on the Button's Action to refer to the page I want opened when a user clicks the command button. This works fine Frameset.html loads when the button is clicked.

The problem is that I need to copy the site onto CD and then onto a server and thus the absolute URL I have from my development machine will not work.

Is there any way I could tell Flash to move up and down the hierarchy of nested files, folders which are all contained within the Folder Site and using the Flash getURL instruction use a relative URL to the file ie just call the Folder names and the file name. e.g. getURL(Site/Pages/Frameset.html) in this case.
Thanks
ViRiPuff NoImage = NoSigImageNoImage = NoImageRes

Relative VS Absolute Discovery
my site uses a swf in a frame as navigation which loads pages into the frame above it.

during testing it was discovered that on the windows platform only, using ie 5.x only, the relative path method added an extra 'images/' to the query. i knew that i had another option: absolute paths.

when i tested the absolute version, go figure, it worked on the windows platform only, using ie 5.x only. how could i satisfy both platform/browser requirements without posting both versions of the site and using the javascript sniff technique to send users to the appropriate site?

my solution is crude but it works. i simply duplicated the images folder and placed it inside the original images folder so that window/ie 5.x users found what they needed in the 'images/images/' directory.

has anyone encountered this problem?

check it @ http://www.korditsch.com.

Absolute Vs Relative Paths?
Please Help,

I have a swf move placed into another swf movie using the script
loadMovie ("multimedia_anritsu.swf", "_root.casestudies");

My problem is that my drag and drop action script is not working in the placed swf file after it is loaded into the main movie, see:
http://www.paulcordingley.com/flash/index.htm click on the far left arrow and select anritsu.

I am using the code below to move the icons, but when placed into my main movie it fails to work.

Am I right in thinking it is a problem with Absolute or Relative Paths, or am I completely off the ball and going wrong somewhere else.

I would appreciate anyones help as im becoming giddy going round in circles.

Many thanks,

P


on (press) {
startDrag ("/01");
}
on (release) {
stopDrag ();
if (getProperty("/01", _droptarget) eq "/trigger") {
tellTarget ("/status") {
gotoAndStop (2);
}
setProperty ("/01", _x, "35.1");
setProperty ("/01", _y, "48.6");
} else {
setProperty ("/01", _x, "35.1");
setProperty ("/01", _y, "48.6");
}
}

PHP: Absolute X Relative Path?
Hi!

I have a simple doubt...
If I run the following command, with the full path to the script:

loadVariables ("http://localhost/azul/pegamedidas.php",_root,"GET");

and then trace the variables (e.g. _root.age), I will have the variables sent by the PHP script.


Otherwise, if I run the same script, but this time ommiting the path, it will tell me that the variable is "undefined":

loadVariables ("pegamedidas.php",_root,"GET");



Why it happens????

Relative Vs Absolute Link To PHP
I have a problem when trying to send variables to a PHP script.. when I use an absolute URL it works fine but when making it relative it fails to execute the PHP script, instead it loads the text of the PHP.

Can anyone help???

Relative/absolute Hiearchy
I'm stuck on a problem that seems to be easy to remedy, however, I can't seem to figure out where I'm going wrong!

I'm using an easing menu with the original code coming from the "Easing Menu System" tutorial on this site (here is a link)

I will refer to the easing menu I'm using (found in the tutorial listed above) as "MENU2" as I explain my problem.

In a nut shell, I have a easing menu within another easing menu.

The problem is that I have the MENU2 system within another "zooming and panning, easing menu" (referred to now on as MENU1)...

This means that my BUTTONS (applying to MENU2) cannot be in the _Root. They must be on the layer that contains MENU 1. This way the user activates a button on MENU1 and the window is zoomed in and it pans to the proper X & Y coordinates revealing the BUTTONS for MENU2 (which will now pan within the current zoomed state of MENU1)

The action script available in the tutorial has the button "onRelease" events within the main script (not directly attached to a button)

It looks like this:

_root.buttoninstancename.onRelease = function() {
endX = 0;
endY = 0; }

EVERYTHING works fine when my buttons for MENU2 are in the root, BUT if they are in the root they do not zoom/pan with MENU 1 (and this is crucial for my layout).

I tried removing the absolute style of actionscript (_root) and used a relative method (_Parent.instancename.menuname, etc) BUT this doesn't work. All the functionality of Menu2 is lost.

I also tried to break the code up and place the onRelease commands directly to the buttons (but then the buttons are moving with the X, Y coords INSTEAD of my real menu system)

I'm really frustrated trying to solve this issue. It is so simple, but becoming very hard for me. I hope this all makes sense--- if you look over the tutorial listed above it will clarify how MENU2 operates.


Any help would be greatly appreciated! THANKS

Absolute And Relative Links
Hi all,

I'm designing a fairly large scale site that includes a flash header. While I certainly want to incorporate the flash header, I also my site to be very well organized. So, I would like to be ale to link to pages by absolute reference without getting a security warning. Any ideas?

EriK

Absolute And Relative Paths
if any of you guys can be so kind, may i have a plain english explaination of absolute and relative paths

Absolute And Relative Paths
if any of you guys can be so kind, may i have a plain english explaination of absolute and relative paths

Relative Path Vs. Absolute
if i use a .as file for my scripting what would my path be to my movieclip that is on the root timelina and is inside the mc clip in the root timeline'

is this correct.


ActionScript Code:
_root.mcClip._parent.mcClipInside.

Absolute And Relative Filepaths, Help
How can I define an absolute or relative path when I want to load an external file? I currently building a website with at least three levels, but from the second level forward, the swf loaded, instead of fetching the pictures on it's own folder, is looking for it on the main site folder (and i'm using "loadMovie("picture.jpg",loader_mc );") , so I don't get it, i have to insert there the whole path ("loadMovie("/submenu/images/picture.jpg",loader_mc );" ... can i get around this ?

Thanks a lot.

Relative / Absolute Get URL Problem..... Very Easy
okay. I know this is extremely easy, but for some reason it just wont get through. heres my problem:

I'm doing a page. there are two frames. 1 frame is the title and there is only 1 pictur, no swf. the bottom frame named "_body" has a small swf menu.

Heres my problem.
Everything right now is set to relative path, all my .html pages are using the following: "../" and "/" so my question is this.

on (release) {
getURL ("/public/forms/permit_ec.html");
}

now, is that even possible? I have the swf file right below the public folder (in the main folder)

i've tried many possiblities but i keep getting nothing when i click on the button that has this code. are relative paths welcomed in the GETURL, even when just testing...? (its not hosted yet, so thats why i'm not using absolute entries)

Thanks!

danny~!

Relative Vs Absolute Scaling Effects?
What is the difference between relative and absolute scaling effects? What I think it is, is when you manually scale an object versus scaling it in the transform panel...

Relative And Absolute Paths In Actionscript
_root.placeholder3.square1.button1._visible = false;

turns off the visibility of a button.

The problem is this:

When developing the code, I use:

_root.square1.button1._visible = false;

because i need to be able to see what is happening as i go along BUT

the final .swf file goes into an empty placeholder movie clip called placeholder3 so i have to change the code to:

_root.placeholder3.square1.button1._visible = false;

This I understand.

How do i use _parent and/or this to create relative paths so i don't have to muck about changing the code?

Absolute And Relative Path Questions.
Hello FK.
I am trying to organize my files in my root directory that my swfs reside in. I have always just kept all my necessary files in one folder, so I don't have to alter paths. Problem is my site is growing and growing using loadMovie commands and I need to divide an conquer. If I want to break up my root folder into subfolders, how do I target them in actionsript. Here's the breakdown:
root (main folder)
>skeleton_folder (inside root)
>picture_folder (insider root)

Say I have a movie called portfolio.swf located in the folder skeleton_folder. I need a button in the portfolio.swf to load a file called building_pic.swf which is located in the picture_folder.

on(press){
loadMovieNum ("building_pic.swf", 6);
}

Thats basically it, but I need to know how to alter the path.

Absolute URL Works But Relative FAILS :S
Peepz,

i have a small email-form that sends 5 variables to php:


Code:
var contactForm = new LoadVars();

contactForm.naam = this._parent.mcTopFields.mcNaam.txtNaam.text;
contactForm.adres = this._parent.mcTopFields.mcAdres.txtAdres.text;
contactForm.woonplaats = this._parent.mcTopFields.mcWoonplaats.txtWoonplaats.text;
contactForm.email = this._parent.mcTopFields.mcEmail.txtEmail.text;
contactForm.vraag = this._parent.mcVraagHolder.mcVraagHolder.txtVraag.text;

// Send vars to PHP script to send mail
contactForm.sendAndLoad("http://www.testurl.biz/includes/contact.php",contactForm,"POST");
// == // == // == // == // == // == // == // == // == // == // == // == //
it works fine,

but if i set it online and i use this:

Code:
// Send vars to PHP script to send mail
contactForm.sendAndLoad("includes/contact.php",contactForm,"POST");
// == // == // == // == // == // == // == // == // == // == // == // ==
it won't work :S

can somebody explain why?

thnx peepz!

Absolute And Relative Path With URLRequest
Hi
I have a question concerning the use of URLRequest

When I work on my local server, I have to put the absolute address of the file I am calling with URLRequest (the relative path doesn't work)
For example

Code:
urlRequest:URLRequest = new URLRequest("http://127.0.0.1/www/site/test/call.php");
Then I have to modify this address each time I upload the flash file on the production server!

Whereas I would like to just have to put something like this:

Code:
urlRequest:URLRequest = new URLRequest("call.php");
but then it doesn't work in local

Do you know if it is a flash or php problem? What should I change so that my relative path works?

thanks for your help

Absolute And Relative Path With URLRequest
Hi
I have a question concerning the use of URLRequest

When I work on my local server, I have to put the absolute address of the file I am calling with URLRequest (the relative path doesn't work)
For example

Code:
urlRequest:URLRequest = new URLRequest("http://127.0.0.1/www/site/test/call.php");
Then I have to modify this address each time I upload the flash file on the production server!

Whereas I would like to just have to put something like this:

Code:
urlRequest:URLRequest = new URLRequest("call.php");
but then it doesn't work in local

Do you know if it is a flash or php problem? What should I change so that my relative path works?

thanks for your help

Absolute URL Works But Relative FAILS :S
Peepz,

i have a small email-form that sends 5 variables to php:


Code:
var contactForm = new LoadVars();

contactForm.naam = this._parent.mcTopFields.mcNaam.txtNaam.text;
contactForm.adres = this._parent.mcTopFields.mcAdres.txtAdres.text;
contactForm.woonplaats = this._parent.mcTopFields.mcWoonplaats.txtWoonplaats.text;
contactForm.email = this._parent.mcTopFields.mcEmail.txtEmail.text;
contactForm.vraag = this._parent.mcVraagHolder.mcVraagHolder.txtVraag.text;

// Send vars to PHP script to send mail
contactForm.sendAndLoad("http://www.testurl.biz/includes/contact.php",contactForm,"POST");
// == // == // == // == // == // == // == // == // == // == // == // == //
it works fine,

but if i set it online and i use this:

Code:
// Send vars to PHP script to send mail
contactForm.sendAndLoad("includes/contact.php",contactForm,"POST");
// == // == // == // == // == // == // == // == // == // == // == // ==
it won't work :S

can somebody explain why?

thnx peepz!

Relative Or Absolute Adressing [fmx 2004]
Hi,

Im a bit confused about the adressing of .swf-files loaded into levels of another .swf-file.

The adressing seem to be absolute, ie. if a sub.swf (which is loaded into a super.swf from another location) uses some sort of adressing (for instance, loading an image), that adress must include the path from the super.swf.

Cant you change that somehow, so that sub.swf's can adress other stuff relatively to its own adress?

Can you do that globally (so that relative adressing is used by every .swf)?
Can you set it individually, so that adressing is relative only from the specified swf's?

Thanks

XMLConnector: Absolute Vs Relative URLs
I am running apache on OSX to develop a flash/xml/php/mysql content management system. I use the XMLConnector to pull xml from a php script (that accesses mysql). Running locally on my machine, I have to use absolute URLs in my XMLConnector component. But when I upload it to the server that also runs apache, relative URLs work. I would like to only have to use relative, so I don't have to modify all of my scripts before I upload them. Any suggestions?
thanks
-jeff

Absolute/ Relative Video Linkage?
Hey All,
I'm having some problems with my video linkage. I create a a few .flv videos use the progressive stream import feature in Flash 8. Everything works fine locally on my computer but as soon as I move the folder to another computer or upload the files to my websever the videos aren't there.

I've check the paths over and over again and I can't understand why they are not working when I move the files...

If anyone has some suggestions I would be grateful...

Thank you,
-Dr Red

FileReference.download Must Take Absolute URL (not Relative)?
Im using this code


Code:
var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
var url:String = "images/img1.jpg";
fileRef.download(url, "image.jpg")

However, it doesn't work. It works when I put the full absolute address, instead of simply "images/img1.jpg" . Is there any way to use a relative address?!?!? Probably attach the relative address to the URL property ??

Thanks!

Absolute And Relative Path With URLRequest
Hi
I have a question concerning the use of URLRequest

When I work on my local server, I have to put the absolute address of the file I am calling with URLRequest (the relative path doesn't work)
For example

Code:
urlRequest:URLRequest = new URLRequest("http://127.0.0.1/www/site/test/call.php");
Then I have to modify this address each time I upload the flash file on the production server!

Whereas I would like to just have to put something like this:

Code:
urlRequest:URLRequest = new URLRequest("call.php");
but then it doesn't work in local

Do you know if it is a flash or php problem? What should I change so that my relative path works?

thanks for your help

Relative Or Absolute Adressing [fmx 2004]
Hi,

Im a bit confused about the adressing of .swf-files loaded into levels of another .swf-file.

The adressing seem to be absolute, ie. if a sub.swf (which is loaded into a super.swf from another location) uses some sort of adressing (for instance, loading an image), that adress must include the path from the super.swf.

Cant you change that somehow, so that sub.swf's can adress other stuff relatively to its own adress?

Can you do that globally (so that relative adressing is used by every .swf)?
Can you set it individually, so that adressing is relative only from the specified swf's?

Thanks

XMLConnector: Absolute Vs Relative URLs
I am running apache on OSX to develop a flash/xml/php/mysql content management system. I use the XMLConnector to pull xml from a php script (that accesses mysql). Running locally on my machine, I have to use absolute URLs in my XMLConnector component. But when I upload it to the server that also runs apache, relative URLs work. I would like to only have to use relative, so I don't have to modify all of my scripts before I upload them. Any suggestions?
thanks
-jeff

Absolute And Relative Paths In Actionscript
_root.placeholder3.square1.button1._visible = false;

turns off the visibility of a button.

The problem is this:

When developing the code, I use:

_root.square1.button1._visible = false;

because i need to be able to see what is happening as i go along BUT

the final .swf file goes into an empty placeholder movie clip called placeholder3 so i have to change the code to:

_root.placeholder3.square1.button1._visible = false;

This I understand.

How do i use _ parent and/or this to create relative paths so i don't have to muck about changing the code?

Absolute/ Relative Video Linkage?
Hey All,
I'm having some problems with my video linkage. I create a a few .flv videos use the progressive stream import feature in Flash 8. Everything works fine locally on my computer but as soon as I move the folder to another computer or upload the files to my websever the videos aren't there.

I've check the paths over and over again and I can't understand why they are not working when I move the files...

If anyone has some suggestions I would be grateful...

Thank you,
-Dr Red

Major Confussion Over Paths (relative & Absolute)
Dear all,

I'm having somewhat of a minor panic attack every time i try and tackle this little problem of mine...

I'm pretty sure the problem is do to with paths, Basically i have main movie file called layout.swf which loads a file called newslayout.swf into a container movie clip (on the satge of layout.swf) with an instance name of cont. Inside the newslyaout.swf (the file to be loaded into layout.swf) after a few frame of introduction animation there is some actionscript which loads and parses an xml document, put's that data into an array, translates the data in that array into variables, then (finally) writes those variables to a textfield variable which is nexted inside a clip called blog.

Basically when i test the newslayout.swf independentally it works fine, but when i test layout.swf (which loads newslayout.swf) all of the variables from the xml data are undefined!

I've tried swapping things around a lot switching between relative and absolute paths, but am having noe luck! (also i'm have to write to the text field like so _root.cont.blog.str_display, as if it were already nested, this is the only way i can get the text to output)

I've attached the newslayout.fla file for you guys n gals to have a butchers at, i'm really lost on this one!

Many thanks
x

Targeting Correct Relative/ (absolute) Paths?
flash mx 2004 pro

Just a question about linkage and paths. I kinda figured out how to address movieclips in actionscript by using linkage and when I call the mc, I can alter the properties, ie _alpha by scripting on the buttons. Which is great. It's a simple action, but... it is working. :P Which brings me to the following questions:

here Im going to give you a breakdown of the swfs involved... so I might be clearer, when I ask the questions:
_level0 master.swf (main swf, that loads all content ([trigger.swf (loads- shareLib.swf)], anim.swf,nav.swf, dataBox.swf)

_level5 trigger.swf -> shareLib.swf

_level5 anim.swf - this is an animation that plays thru-out site (loads top/left section)

_level10 dataBox.swf
contents of this swf: holds a movieclip(dataWindowMC) that I applied linkage dentifier:data_mc : export for AS & first frame

movieclip(dataWindowMC) this mc has 3 framelabels: textboxSM, textboxLG, rev_2sml
each label in the timeline has a dynamicText field (for loading external txt content- I have figured out how to import text, YIPEE :P) and each dyntext field has the var name: content, (this way when I import text, I only need to vary the text file to load via ActionScript and I keep the variable the same for all text content (ie: content=bla bla bla)
ie:
code:
stop();
loadVariables("var/contactText.txt",this);


k... question #1. the dynamicText fields refered to above(1 in ea frame label)... do I need to give these instance names? and if I do... how are the instance names used in ActionScript.

I'm a bit unclear on instance names. I understand if I use linkage - I assign an ID at that time (so, I'm not sure where instance names fit in)

_level15 nav.swf - this is the navigation section that contains all buttons to navigate site positioned: (right side of stage) [only the section below the animation and to the left of the navigation changes per user input(button) showing the different text content (ie. about, material, contact ...etc)

I've figured out how to access a mc(_level15.pic_mc) inside a swf(nav), with buttons, (effect a mc inside the swf)

ie: (script frame1 of nav.swf)
code:
stop();
about_btn.onRelease = function() {
trace(pic_mc); // mc inside nav.swf
_level15.pic_mc._alpha = 0; // hides pic_mc element


now... here's the main question:
When a button is selected in the nav.swf, I need to figure out how to access the dataBox.swf mc: data_mc and tell the timeline to go to the specified framelabel (textboxSM, textboxLG, rev_2sml)

code:
stop();
about_btn.onRelease = function() {
trace(pic_mc);
_level15.pic_mc._alpha = 0;
_level10.data_mc.gotoAndPlay ("textboxLG"); // my lame attempt at it - been on this for days... : ()
trace(data_mc);
};


Need to -(effect a mc (data_mc)inside a swf(dataBox) from another swf(nav)- both (dataBox and nav are loaded into the master.swf file)
I'm hoping this will teach me how to path correctly with action script. This has always been a quite confusing process for me, but I still have hope. : ) I think I'm on the verge of an eureka moment.

Any suggestions here is sooooooo appreciated! Please help me out of the hole I've dug. : P

Thanx

Kim

File Downloads: Absolute Vs. Relative Pathways
Hi,

Visitors to my website can download a zip file, which I have specified in flash as a relative url: "download.zip" -- the zip file is located on my server in the same folder as my flash swf and index.html.

Is this perfectly okay, or would it be prudent for any reason to specify the full, absolute url pathway to the zip file?

Thanks,
-Todd

Relative/Absolute Paths And File Managment
Once again...sorry for bothering, but: This has got to be a common problem. I'm setting up a site that's got a usual index.html file and few other .jpegs/.html files, an .html file that contains the main .swf file with a number of smaller .swf files loaded into mc instances inside the main .swf. I want to upload and manage the site with Adobe Golive (but the issue would be the same with Dreamweaver or similar, I think)

Now... the problem is: how shall I reference .swf files for loadMovie?

This is not a purely technical question. I'm just trying to figure out what's the best way to keep the .fla and .swf files managed on the harddisk. How do you keep the .fla file out of the final website folder AND keep it editable and updatable easily? How is this supposed to be done?

loadMovie("minormovie.swf");
-> With the minor .swf files in the same folder as .fla and main .swf. Would work, but I'd have to store the huge .fla file in the same folder as the main .swf, wich would be in the final website folder("web-content"). I think there should be only "webready" files in that folder. Golive would upload the .fla as well.

loadMovie("../web-content/minormovie.swf");
-> With the main .fla outside of the "web-content" folder, in the same directory on the harddisk - works for testing the film, but once exported to the final destination the references in the .swf won't. Can't flash sense those references and change them on exporting?

loadMovie("file:///Harddisk/folderX/folderY/minormovie.swf")
-> Works for testing and the .fla can be anywhere, also after exporting to .swf - but this won't work once the site is uploaded?!

Any hints?!

Absolute And Relative MouseX, MouseY Positions
I am making a jigsaw puzzle type of game.

I realize that startDrag() and stopDrag() are the best ways to drag objects (puzzle pieces, in my case) around.

However before I realized this (I am a n00b, BTW) I was using a Timer class and getting the mouse position and setting my piece's position to it as follows:

Quote:




this.x = mouseX;
this.y = mouseY;




This was causing the piece to roughly follow the mouse but it was also jumping wildly across two ends of the stage.

I then discovered what was happening: (mouseX, mouseY) appears to be the position of the uppermost object that is enabled to receive mouse events. So while I thought I was supposed to get the mouse position relative to the stage I was in fact getting the mouse position relative to the piece if I was over it. The code snippet above would then cause the piece to jump to whatever (small) values those represented, like (10, 10) relative to the stage. Then on the next timer event the mouse would be above the stage (because the piece was off in never-never land) and (mouseX, mouseY) would return the stage coordinates, and the above code would result in the piece jumping back under the mouse.

Anyway, I finally solved it with the use of startDrag() and stopDrag(), but not after I had lost nearly a full day. So I'm posting this as a warning, in case it may be of help to someone and prevents them from wasting oodles of time, as happened to me.

I tend to learn by doing but I guess it's also helpful to read a lot beforehand as well.

Absolute Or Relative Path In Include File
Hopefully someone can help me out with a simple problem.

I am having an issue referencing some actionscript in my inlude file.

Currently on my main timeline I have an mc called nav_mc, in that mc I have another called d1.

On my main timeline I am including an actionscript file (#include "timeline.as" )

My actionscript is as follows:

Code:

_root.nav_mc.d1.onRollOver = over;
_root.nav_mc.d1.onRollOut = out;
_root.nav_mc.d1.buttText.buttonText.text = "2006";
_root.nav_mc.d1.onRelease =
function(){ getURL(Links[0]) }
My problem is that I cant get any of my actionscript to work, what am I doing wrong in my paths? Any help is appreciated.

Embed Tag Issues With Relative Or Absolute Urls
I searched but couldn't find an exact match to my issue, so posting to see if someone has run across this before.

I have a page (have the same issue whether html or jsp) that is loading a .swf file using the embed tag - for whatever reason, the only way in which I can get the .swf to load is if the html/jsp and .swf are in the same directory, REGARDLESS of the src attribute setting in the html/jsp file.

for instance:
assuming index.html is content root directory
<embed src="flash/sample.swf" ...

will not load even though the file exists in the named directory
I have even tried an absolute url
<embed src="http://www.mydomain.com/flash/sample.swf" ...

no luck. I have also tried using the base attribute as well
<embed src="flash/sample.swf" base="http://www.mydomain.com/"...

the only way at this point is to move the files to the same directory as the html/jsp, (i.e. html/jsp is in the same directory as the .swf file) which then loads and plays fine

this problem seems to be limited to .swf as I have tried the same <embed> settings with quicktime movies, and had no issues loading them from relative or absolute urls being in the "src" attribute

Any help would be appreciated - the structure of the web application in question won't support having the .swf files and jsps in the same directory, as the jsps will be protected under the WEB-INF directory and not readily accessible

Relative Vs. Absolute File Paths With Video
Can the player skin for a Flash video sit in a different directory or level on the server from the .swf and .flv files? I can't seem to make this work, have checked file permissions and everything else I can think of. I have tried putting in both relative and absolute paths to the skin file in the fla file but still no luck. I really don't want to have to store 100 copies of the skin file when I have video content separated into folders, but.....?

HitTest Problem Absolute /relative Paths
hi
im using hitTest to create a pataform game but i found a problem when loading the game.swf inside other swf

The problem is that hitTest is getting _x, _y values relative to the swf container instead of getting it relative to the mc loaded, you all can see the problem with the files on the zip (if you place the component loader at 0,0 position the problem is solve but thats not the way to fix this).

im using correct relatives paths to avoid the problem but it does not work so if someone has done a personalized prototype of hitTest somewhere in the net please tell me, or give me a hint in how to fix this.

Stuck On Preloader With Absolute Referencing
I have a code that reads:

onClipEvent (load) {// Load Six movies
loadMovieNum("http://www.domain name/lpu_m1b_wht_lg.swf", 1);
loadMovieNum("http://www.domain name/lpu_m1c_wht_lg.swf", 2);
loadMovieNum("http://www.domain name/lpu_m1d_wht_lg.swf", 3);
loadMovieNum("http://www.domain name/lpu_m1e_wht_lg.swf", 4);
loadMovieNum("http://www.domain name/lpu_m1f_wht_lg.swf", 5);
loadMovieNum("http://www.domain name/lpu_m1g_wht_lg.swf", 6);
}
onClipEvent (enterFrame) {
Total = Math.floor(_level1.getBytesTotal() / 1000) + (_level2.getBytesTotal() / 1000) + (_level3.getBytesTotal() / 1000) + (_root.getBytesTotal() / 1000);
Loaded = Math.floor(_level1.getBytesLoaded() / 1000) + (_level2.getBytesLoaded() / 1000) + (_level3.getBytesLoaded() / 1000) + (_root.getBytesLoaded() / 1000);
Percent = Math.floor((Loaded / Total) * 100);
_root.PercentDisplayTwo = int(Loaded) + " KB " + " | " + (Total) + " KB" + " | " + (Percent) + " %";
if (Percent == 100) {
_level1.gotoAndStop("park");
_level2.gotoAndStop("park");
_level3.gotoAndStop("park");
_level4.gotoAndStop("park");
_level5.gotoAndStop("park");
_level6.gotoAndStop("park");
_level7.gotoAndStop("park");
_root.play();
__________________________________________________

This code if for a preloader and what happens is my first movie which is titled "lpu_m1a_wht_lg.swf" loads these movies before playing but when it's time to play the next movie it stops. There is a tellTarget command to run the next movie:

tellTarget ("_level1") {
gotoAndPlay(3);
}
If I remove the http://www.domain name from the preloader code it runs perfect but as soon a I put the absolute portion back it stops after the first movie. I'm sure I'm doing this wrong. I appreciate reply

Mixing Relative And Absolute Path For External Loading
I have a shell application that loads external movies into it. It is like a movie player that uses loadclip(). When I publish to the server it cannot find the external movie.


Code:
movieFile="1_03_02.swf";
myMC.loadClip(movieFile,"_root.myMC");
On the server both the host wrapper (player.swf) and the 1_03_02.swf movie are in the same folder.

My problem is I must use an absolute path in the HTML to the player.swf because I use an IP replacement function I am using. I want to use a relative path to swf from the application level.

Here is my html object source param:

Code:
<param name="movie" value="http://replaceMyIp/software/player.swf">
replaceMyIp is dynamically inserted in the HTML to find the nearest server's IP.

Does the tilde work for application root level paths in Flash?

Other programs allow you to use the tilde to start at the root level of the application instead of the root level of the server.

So, what I am hoping this or something like it will work:

Code:
movieFile="~1_03_02.swf";
myMC.loadClip(movieFile,"_root.myMC");

Relative Referencing
I am trying to remove all absolute references to "_root" from a game I am making. I have tried to avoid this kind of referencing where possible, but there seems to be some situations where I simply cannot make a reference by means of relative paths.

For example:


ActionScript Code:
myTween.onMotionFinished = function():Void {    trace(this);}


Returns "[Tween]". I have been given the solution to this problem as:


ActionScript Code:
myTween.onMotionFinished = function():Void {    trace(this.obj);}


Which returns the mc that the tween was applied to. But using ".obj" only seems to work with Tween objects.

Can anyone explain the idea behind using relative paths with objects that trace a data or class type when tracing "this". (if that makes sense).

Loading External Text Files From An Absolute Path
Hey Guys.

I'm currently building a little content managment program for some sites that I am working on so that people can update their sites from one location - the problem I'm having is that the SWF file doesnt seem to want to handle an external text file located on a different server.

Here's the situation: (these paths are just examples)

The SWF is located at www.swfhere.com/swf.html

The Text File is located here: www.myadmin.com/content.txt

Is there anyway to get the SWF file to load that text file, or am I out of luck?

Thanks!
Anneka.

Relative Path Of Files On Server?
Hello world.
This question I don’t know if must be in actionscript2 or server side-scripting. But I feel that this is the correct section.
The problem is: I have a main.swf that loads askphp.swf and this askphp sendandload answer.php.
Folder structure:page/ (folder)
main.html
main.swf
swfs/ (folder)
otherfolder/
askphp.swf
phps/ (folder)
answer.php
but I can’t find the way to get answer… in a textfield I’m getting "Error connecting to server."
askphp.fla

ActionScript Code:
//simplified version
var answer_lv:LoadVars = new LoadVars();
answer_lv.onLoad = function(success:Boolean) {
    if (success) {   
        t.text = answer_lv.info ;      
    } else {
        t.text = "Error connecting to server.";
    }
};
var send_lv:LoadVars = new LoadVars();
send_lv.sendAndLoad("phps/answer.php",answer_lv,"POST");
The answer.php:

PHP Code:



<?php//simplified versionecho "&info=hello world&";?>




What I think is that the problem is referencing to the php file.

ActionScript Code:
send_lv.sendAndLoad("phps/answer.php",answer_lv,"POST");
//but I think that main.swf is the root so the php file is phps/answer.php
//also another option was that php must be relative to the askphp.swf so I changed the path to:
//send_lv.sendAndLoad("../../phps/answer.php",answer_lv,"POST");// but this method was just working outside the main.swf
Any advice???

Loading External Files With Relative URL's
How I wish we would not forget, or forget how to forget. Well anyway I got this problem. I am loading some external text files, in my swf and everything is fine until I put the things online. Then, as it seems it tries to load load the text files from the directory where the downloaded swf file is, and not the online location. Now I could of course set absolute urls but then I have to edit them every time I move my files around the site. I am pretty sure I had a way to pick up the location of the original swf without editing it, but for some reason I cannot remember. Please help

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