Loading Movie From Parent Directory?
Jun 20, 2009
I am doing some testing with various methods of deep linking in a flash site and have created a test site with the following structure:
/index.html
/simple.swf
/two/index.html
three/index.html
The index.html file located at the root of the site loads the simple.swf file using an absolute reference to the file (view the source of [URL]). The index.html file located in directories "two" and "three" are exactly the same as the index.html file in the root directory with the exception that I have added a defined a "base" parameter pointing to "../". [Right now, I am passing the same "flashvars" parameter in each of these files, however, once I resolve this issue, I will change the flashvars value.]
For some reason, the simple.swf file loads in the root level index.html file but not in the index.html file located in directories "two" or "three". I am confused why this is not working since I am using an absolute reference to the file. The only possible meaningful difference I can see is that the simple.swf file is only located in the root directory.
View 2 Replies
Similar Posts:
Aug 18, 2009
I am making a site, this site is in a folder, inside of this folder I have the index.html file and a load of other html files. I then have a folder, flashheader. with a flash header that has 5 tabs on it. When I click a button, I want to navigate to another URL, this URL being in the parent.
PHP Code:
tab1.addEventListener(MouseEvent.CLICK, myBtnClicked1);
function myBtnClicked1(e1:MouseEvent):void {
var url:String = "../index.html";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, '_self');
} catch (e1:Error) {
trace("Error occurred!");
}}
There is my code, it listened for the tab to be clicked, and when it is, it loads the URL.
View 2 Replies
Sep 13, 2011
I have seen similar questions, but not this specific problem. I have a folder structure like this:
[Code]...
View 3 Replies
Mar 3, 2009
I just have a simple question how do i point to the parent directory from where i curently am in URLRequest string parameter?in other words my folder structure:
my_site/flash/button.swf
How must string look to tell flash to locate solarij.html that is in my_site folder one folder up(parent) from current swf position.?
ActionScript Code:
var link:URLRequest = new URLRequest(""); navigateToURL(link, "_self");
View 2 Replies
Jun 19, 2007
I need to be able to load/change a movie within the main container using a button within a subcontainer if that makes sense?
Ive had problems before with loading and unloading movies eventually breaking the damn thing.
View 1 Replies
Nov 24, 2009
C:UsersPublicMusicSample MusicKalimba.mp3
A preferred solution would be with actionscript alone (I know some things like this are possible with php etc.) and without prior knowledge of where the SWF file is saved at author time. And the finished product will not be in a browser because I know that there is no way around it like that, maybe an AIR application or something
I've tried some stuff such as
Code:
var loader:URLLoader = new URLLoader(new URLRequest("C:UsersPublicMusicSample MusicKalimba.mp3"));
etc, but the problem is obviously that it cannot find this directory in the folder where it was saved
View 1 Replies
Feb 9, 2010
When I have a class linked to a MovieClip in my library and that class takes an argument in its constructor method. That class will compile properly ONLY when it's located in my top-level directory (same dir as the .fla and Document.as files). If I move that class to a deeper directory, say com.place, and update the package statement and symbol link appropriately, the compiler will generate error "1136: Incorrect number of arguments. Expected 0."Create flash project and put a rectangle on the stage. Covert it to symbol and assign it to class TestPanel - or whatever you choose. Also configure the fla so that is uses a Document (Main) class.Create Main.as and TestPanel.as in the same folder. In the Main class, instantiate a instance of TestPanel and add it to the stage. Flash will, predictably, add the rectangle symbol and everything is fine.Now modify TestPanel so that its constructor method takes a Number and have Main.as pass some number to TestPanel.[code]You now get the error: 1136: Incorrect number of arguments.Expected 0.When I move the TestPanel.as into a deeper directory, Flash somehow is looking elsewhere for the base class for Symbol, even though I'm mapping that Symbol to com.place.TestPanel.
View 4 Replies
Jul 19, 2011
without having to hardcode a username / password in my .swf file (very easy to decompile!), is it possible to send a URLRequest for some file (perhaps .php?) to a loader object which can load assets that reside in password protected directories?my PHP skills are weak at best, so if calling a .php script is the solution.
View 2 Replies
Oct 11, 2011
The web designer on a project is using Flash Gallery which loads a images.xml file. The SWF expects it to be in the same directory as the .html file. So if I am at the action /Public/Home/Gallery, it would expect the images.xml to be in at Public/Home.
How do I allow the Flash SWF to load the file? I have no access to the source code, so I cannot change the behaviour of the SWF.
View 1 Replies
Feb 12, 2009
I Have 3 Movies:MAIN.SWF, contains loading movie actions for Nav.swf and Home.swf.NAV.SWF, contains navagation menu loaded on Level 2 in Main HOME.SWF, contains slideshow for home page loaded on Level 1 in Main In NAV.SWF, there is a MOVIE CLIP "graphmc", which contains a BUTTON "graphicbtn", When this button is clicked, I'd like the HOME.SWF (which is loaded into Main.swf on Level 1) to fade out and unload, and load and fade in Graphics.SWF in place of it.
View 6 Replies
Jun 27, 2011
I can play the .flv movie after compilation through FlashDevelop but its not working if I move the whole directory into another PC or another Directory in the same PC.
package
{
import flash.display.Sprite;
import flash.net.NetConnection;
[Code]....
View 1 Replies
Aug 9, 2004
I am trying to create a movie clip that loops and on each loop it loads a random little .jpg banner from a directory. The banners are named 0.jpg, 1.jpg and so on, a script on the first frame of the loop saying
Code:
_root.randomnumber = random(_root.bannernumber);
_root.bannerloop.bannerholder.loadMovie("http://www.url.com/directory/"+_root.randomnumber+".jpg");
"bannernumber" is a variable from an external text file specifying how many random numbers to cycle through (how many banners), This works just fine and loads up a new banner after each loop cycle. The problem lies in trying to make each banner go to its own url, I have another external text document with variables "click0=url, click1=url etc" where I want the number in each variable to equal the randomnumber variable in flash, then use an on(release){getURL(urlvariable)} function to have it retrieve the url that is somehow in the url variable. Basically, how would I make the urlvariable be equal to the "click0" variable to get the url of the click0 variable into the getURL function? while having the number in the "click0" variable be equal to the randomnum variable?
View 2 Replies
Jun 25, 2009
I have an external swf (sub.swf) that loads into my main swf. The external swf has buttons of its own...that I would like to use to load additional external swf's in its place. I click on the buttons and nothings happens.
My current code is as follows:
All of the following code is in my main.swf
================================
//Location where the external SWFs will load
var Xpos:Number=18;
var Ypos:Number=10;
[Code]...
External swf has no code except for a stop action.
I pieced this current code based on various articles I've found on the net.
View 4 Replies
Feb 5, 2010
[code]All clips are squared.Ok, on the PlayerPlane, there are little soldiers, which have hotkeys. The effect I'm trying to create is I want to position the GameStage so that the currently selected soldier appears in the center of the GameClicker clip.The GameStage is movable by the player (to scan other areas of the map)by holding the CTRL key, so it's easy to kinda lose track of where your players are.I have tried using localTo Global and globalToLocal techniques, but I think I'm lost on the actual math of getting the GameStage to move the correct distance so that the selected soldier is centered to the GameClicker.[code]
View 2 Replies
Jul 30, 2010
I am loading external swf's into a main load.swf, using a Moviecliploader object. What I basically want to do is that, after an external movie, say home.swf, loads another external swf, say about.swf, home.swf should be unloaded.
home.swf is loading about.swf into the _root.mc_holder, which is placed inside load.swf. I want all external files to be placed within this holder. Now this is working with some files, but not with others. My standard code within all files is this:
//code within home.swf to load about.swf
var loader:MovieClipLoader = new MovieClipLoader();var ldrlistener = new Object();loader.addListener(ldrlistener);ldrlistener.onLoadStart =
[Code]......
View 3 Replies
Jun 16, 2003
I'm working on a Flash MX application which involves a Parent movie and a Child movie.
I've loaded the Child movie into the Parent movie using LoadMovie. The instance name of the Child movie is Child1.
In the Child movie I have a user-defined function called getChildXML (we don't need to get into more details about the function).
The point here is that I want to call the getChildXML function from the Parent movie. I've tried something like Child1.getChildXML(); but with no luck.
View 4 Replies
Aug 23, 2010
I have a situation where I use loadvars to load an xml file, which has the address of 2 swf's on the server. I can trace the xml items so know they are loading. So I'm trying to load the swf's but am running into problems. First problem, the swf always gives an error when I publish from flash, "TypeError: Error #2007: Parameter url must be non-null." as it can't find the mention of the xml file, as it's just being published. I'm not sure this affects the next issue which is the swf not loading when I try to load it like this:
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest(loadswf1); // where I know loadswf1 = "myswf.swf"
loader.load(defaultSWF);
[code]......
View 1 Replies
Sep 16, 2008
Late night dumb question time:I have an SWF named "gallery.swf" that loads into an empty clip called "holder_mc" in the parent movie. How do I call a function from gallery.swf that replaces gallery.swf with a file called "purchase.swf" in holder_mc? The function I'm using looks like this:
Code:
function ProceedToCart():Void {
_root.mcLoader.loadClip("purchase.swf",_root.holder_mc);
[code].....
View 1 Replies
Feb 16, 2012
I have two different external .swf files that are loading onto a parent, I have the same code on each, one works fine but the other one is giivng me this error,
TypeError: Error #1009: Cannot access a property or method of a null object reference.at aavar/frame1() at flash.display::MovieClip/gotoAndStop() at aavar/mouseA()my FLA still runs, but I would like to work out what is going wrong. I do not have any references to this function in my document class but it doesnt like it! What is going on here?
[Code]...
View 1 Replies
Mar 20, 2011
I am working through an audio player demonstration in the book "Foundation Actionscript 3.0". When I try to publish my AudioDemo_final.FLA file I get the following error, "Adobe Flash CS3 - Error creating flash movie file. Destination directory does not exist. Change your publish settings."The following is displayed in my output panel >> Error opening URL 'file:///C|/Sites/flashcoder.net/FAS3/Audio/AudioDemo%5Ffinal.swf'My file directory is set up like this:AudioDemo_final.flasong1.mp3com.fas3.smc (folder)Main.asSounds.as
View 2 Replies
Jan 3, 2010
I got a "preloader" that creates an movieclip and loads an SWF. Now in the loaded SWF i want a close button to go back to the "preloader". The preloader isn't an actuall preloader but some sort of mainclip.Now i tried this:removeChild(MovieClip(e.currentTarget).parent.pare nt.parent)But i get error:ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.at flash.display::DisplayObjectContainer/removeChild()at MethodInfo-6()
View 1 Replies
Jul 2, 2009
I have a problem with XML data loading into a datagrid when the containing swf is loaded into another swf.
I am able to get this to work in other scenarios, however in this scenario it seems to be related to the menu system I am using. The menu is populated from another external XML and when a button is clicked it calls a function to load the swf containing the datagrid into the parent swf. The URL for the swf to be loaded is accessed from the menu.xml. The result is an empty data grid.
I have tried adding a the datagrid component to the parent swf, however this dows not solve this issue.
View 1 Replies
May 13, 2011
I'm trying to load a flipping book swf file inside my flash website and I'm using this code:
var myLoader:Loader = new Loader();
addChild(myLoader);
var url:URLRequest = new URLRequest("catalogue.swf");
[code].......
View 8 Replies
Jan 29, 2010
So I got two flash movies. A big one and a small one. I want to display the small one into the big one. Additionally I want the ability to resize it, load it at certain frame in the clip and apply some sort of tween/fade in effect to the loaded swf, but first things first.
View 2 Replies
Jun 1, 2010
Embedded some characters using embed tag in flash CS3 (font.swf). 2 separate swf (a.swf,b.swf) loads the font.swf on runtime. These 2 swf are being called from a container (parent) swf. It looks find locally and not time consuming to load. But when I view it from a server, computer lags after a while....
(all file sizes are relatively small.around 160kb)
What needs to be done in order to prevent computer from lagging? Is it better to load font.swf not in separate swf but directly in container(parent).swf?
View 0 Replies
Nov 20, 2011
I have a FLA site built in AS2 that once you get to the home page it plays one song and only one song. If I want to set up so that when the user clicks back to the home page from anywhere else in the site it plays a different random song (there are 8 total).
So in other words when you initially land on the home page it will play Song 1 every time. But when you click back to the home page from anywhere else on the site, it randomly plays the 1 of the 8.
I have it so that Song 1 plays every time initially but I don't know how to set it up in AS2 to have it randomly play songs when you click back to the home page from deeper in the site.
View 8 Replies
May 9, 2009
I'm trying to understand how to make referrences from one movie clip to another where one has "loaded" the other. I'm not seeing how to relate the two.keep in mind that I've just gotten comfortable with spittin things up and loading them from external swfs, etc.Lets say that I have a main.swf with a set of 3 buttons(self managed MovieClips actually) that each dynamically load 3 swfs with individual content The first of these sub movie clips(e.g. web.swff) has a set off say 3 thumbnails. I want to be able to have these thumbnails invoke the actions of the 3 buttons up in the main calling movie but I am not clear how to go about calling these functions when they are not in the same scope as the main move. I keep thinking that if I had these thumbnails in a clip within my main.but I still hit this same issue of making a correct reference.This is just a current example. If there is a simpler or better way to explain this kind of communication feel frer to ignore this example or tell me to just go read a tutorial somewhere
// snippet from main.flafunction click_web( e ) { var chl_mc:MovieClip = my_lc.add_content("web.swf");}
function click_motion( e ) { my_lc.add_content("motion.swf");}
[code].....
View 4 Replies
Oct 31, 2009
I'm getting a bald patch on my head from frustration with the following problem. I have a parent AS3 swf which loads in a AS2 swf like so;
stop();
var ldr:Loader = new Loader();
ldr.load(new URLRequest( "as2child.swf"));
addChild(ldr);
contained in the AS2 file is the following script which loads in jpegs when the user clicks the next button, etc.
[Code]...
however when you view the AS2 swf via the AS3 swf it does not seem to load in the jpgs when requested.
I need to retain the AS2 file so cannot rewrite in AS3 as the image loading thing is only a small part of the AS2 file.
View 1 Replies
May 27, 2009
i am trying to use the Tween class to change the size of movie clip to certain height.the code works for me but when resizing the parent, it effects the child.i tried the height and scaleY property for the thum, but does not work.
ActionScript Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
[code]....
View 6 Replies
Jul 10, 2009
I'm currently making a platform game and when the player shoots i want to add the bullets to the stage. The players gun class is in charge of adding bullets. The "players gun" is a child of "players gun holder" which is a child of "player" which is a child of the stage. is there a better or more dynamic way for the "players gun" to add bullets to the stage rather than using parent.parent.parent.addChild (bullet);
View 2 Replies