ActionScript 2.0 :: Absolute Targeting In A Loaded Swf?
Sep 15, 2004
i'm in the process of building a movie that is to be loaded and played into another main swf. the targeting (which is multi-level) works fine when the movie is played by itself but when it's loaded and played in the main swf some of the targeting doesn't work. i've tried using _parent. and stuff like that but it's not working. any ideas? can someone point me in the right direction? the frustrating thing is that some of the targeting does work.
1. I'm loading an external swf onto my main swf. 2. Then I'm tweening an object which is separate to the loaded swf. 3. When the tween has completed I'm calling a function to make the loaded swf gotoAndPlay(2);
Basically, I have a main .swf, into which I am loading another .swf using loadClip(), on the click of a button. It loads into an empty movie clip on the timeline of the main .swf called container_mc. So far so good, this works.
The problem comes when I am trying to control a movie clip that lives on the timeline of the external .swf. This clip has the instance name test_mc, and I'm trying to control it using the reference _level0.container_mc.test_mc. I have also tried just plain old container_mc.test_mc.
Neither of these work, though when I apply a trace to test_mc with Actionscript on the timeline of the external swf (test_mc.onRelease = function () { trace(this); }), it returns the path _level0.container_mc.test_mc (when clicked on after being loaded into the main movie, obviously).
I'm loading an external swf into a project and I want to be able to start and stop the loaded swfs timeline at will.... I'm loading swf into an MC: loadMovie("myFile.swf", swfHolder_mc);
I have a main .swf, into which I am loading another .swf using loadClip(), on the click of a button. It loads into an empty movie clip on the timeline of the main .swf called container_mc. So far so good, this works.The problem comes when I am trying to control a movie clip instance that lives on the timeline of the external .swf. This clip has the instance name test_mc, and I'm trying to control it using the reference _level0.container_mc.test_mc. I have also tried just plain old container_mc.test_mc.
Neither of these work, though when I apply a trace to test_mc on the timeline of the external swf (test_mc.onRelease = function () { trace(this); }), it returns the path _level0.container_mc.test_mc (when clicked on after being loaded into the main movie, obviously). I've attached a couple of files demonstrating the problem I'm having. It seems to me that the problem is probably something a little amiss with my code,
I have an .swf which I call into a loader identified as "level_". I want to do a hitTest between a MovieClip in the main file and a MovieClip on level_'s Stage. In AS 2.0, the path would've been: this.level_.wall0
I get this error: 1119: Access of possibly undefined property wall through a reference with static type flash.display:Loader.
Tracing the .numChildren of the loaded .swf reveals that it has zero children. Within that .swf wall0 and the other MovieClips are instances dragged from the Library and given names. So what am I missing? Is the problem that wall0 hasn't been properly added as a child in the externally loaded .swf? Or is it something I need to resolve in the main .fla?
I'm having a really weird problem with loadClip(), using Actionscript 2.0. Basically, I have a main .swf, into which I am loading another .swf using loadClip(), on the click of a button. It loads into an empty movie clip on the timeline of the main .swf called container_mc. So far so good, this works.
The problem comes when I am trying to control a movie clip instance that lives on the timeline of the external .swf. This clip has the instance name test_mc, and I'm trying to control it using the reference _level0.container_mc.test_mc. I have also tried just plain old container_mc.test_mc.
Neither of these work, though when I apply a trace to test_mc on the timeline of the external swf (test_mc.onRelease = function () { trace(this); }), it returns the path _level0.container_mc.test_mc (when clicked on after being loaded into the main movie, obviously).
I've attached a couple of files demonstrating the problem I'm having. It seems to me that the problem is probably something a little amiss with my code, as in theory I'm pretty sure what I'm trying to do is perfectly possible.
When you click the about button on my site, I am using this function to load in an external swf, about.swf. When I click on another nav button, I want to communicate with the about.swf and call a function within that swf called bailout(). But how do I target it? Nothing I try works. I've messed with getChildAt but don't know how it works. Would it be ..... theholder.aboutLoad.bailout()??? That doesn't work. How do i target the function within the about.swf file?
Having trouble targeting movieclips in a dynamically loaded swf. (Flash 8, Actionscript 2).I have a swf file, which contains a set of duplicated movieclips, that I am loading into another swf file (using the movieClipLoader() class), basically like this: "swfA" is loading into "swfB", and I have clips 1, 2, and 3, inside "swfA."I don't seem to be able to mouseover and click clips 1, 2, and 3, when "swfA" is loaded into "swfB". But when I run "swfA" on it's own, the clips are active and clickable.I've tried setting "this._lockroot = true;" at the top of "swfA", and tha in the duplicating script, but still no luck targeting the clips.I usually execute the duplicating script on the main swf (swfB), but I wanted to contain everything in a swf, thinking it might be simpler. But the targeting problem has me scratching my head.
I am doing a dynamically loading gallery by way of xml, now, i have the loading of the images going to where flash sizes them and puts them down as thumbs, all i want to do is when the user clicks on the thumb that already loaded image gets duplicated into the main area full size.... for the life of me i can't figure it out, it seems like it would be simple enough but i have been pulling my hair out for the longest..... by the way the publish settings are actionscript 2.0 with fp8.
I loaded this "slider" swf into a "sliderHolder" on my index swf file. inside that loaded swf there's a movice clip called icon_mc. I'm trying to target it and make it go to a specific y position within that loaded swf on a MouseEvent inside the index.swf. I can't seem to make it work.I triedI have traced sliderHolder and it says it's empty.I have traced sliderLoader and it gives a Loader.So how do I access the movieClip if I just have those two as references?Here's what I have and want to do in code:
Code: Select all var sliderLoader:Loader = new Loader(); sliderLoader.load( new URLRequest("sliding/ImageBar.swf"));
I have a problem that's driving me nuts. A real catch 22 it seems. I have a tutorial for creating a real cool mp3 player. The player shares url data ( allows others to embed the player among other things) so the addressing must be absolute. It works fine on my pc when I run from my local wamp server. Al my addresses are preceded with http://localhost. If I leave http://localhost in the url's it won't run on the server that I upload to and if I use the url from the server it won't compile. The addresses are in an xml file whiched is referenced in a class called PlayerDocumant the reference also uses an absolute address to reference the xml file.
Is there any way to rotate a 3D object in AS3 using absolute axes rather than the x, y and z axes of the object itself?For instance, increasing the value of rotationZ will make a movieclip rotate clockwise, but if the movieclip is first rotated 180 degrees around its y axis, increasing rotationZ will now rotate the movieclip counter-clockwise instead. Add rotation along the x axis, and things get really complicated.In my code, I simply want to flip a cube (consisting of four movieclip faces) 90 degrees around the default x and z axes, no matter what its current values of rotationX, rotationY and rotationZ are. My naive initial assumption was that it is only a matter of increasing rotationZ with 90 degrees to flip the cube left, or decrease rotationX to flip the cube "into" the screen
I looked around, and the latest reference I saw was from 2008 stating that the standard FileReference browser does not support retrieving the user's file's absolute local path unless it's an AIR app, and indeed there's nothing in the docs suggesting otherwise. The reasoning behind this is apparently some misguided security concern... I get it's not a great idea to let any Flash app know your directory structure, but if the user actually grants your app a file, I think it doesn't invalidate the security model to know just that file's absolute path.
I'm wondering if the state of things has changed at all with Flex 4 and there's a method of getting the local filename of anything. I need it because I'm making an application that when distributed runs locally in 99% of cases, so doing a full file upload just to save it somewhere else on the local machine seems silly. (Plus the standard file uploading method doesn't support SOAP, which is what I'm using for all my other services...)
I have been working on Flash AS3 project. I am designing a 3D system. Consider a MovieClip A which is at (0,0,0). A contains B which is at (10,10,10). If I rotate A by 10 degrees then the position of B with respect to A remains the same but position of B with respect to the system changes. To find Global X and Y of B, we have the function localToGlobal but it does not tell anything about the Z property. How to find that?
The question is simple. I need one line command like,Math.round((-Math.random() * 2)),which in output just shows 1 and -1. I try to figure it out but it seems not a easy task! I can use IF command like,demo = (Math.random()>.5)?(1):(-1);
our collaborators misposition the registration points of MCs.Here's the deal: we need to recover the REAL MC's coordinates (not the ones based on registration point). Is it possible? How? I've tried some code already (like getBounds and getRect functions) but all of 'em consider the registration point.
I have doubt about relative and absolute path. I mostly use relative path to load xml, sound and image Is there any problem with cross domain policy?Which one is better in web projects?
My stage contains an object that contains a child. The child sees it's x and y position in relation to it's parent, so when the object moves, the coordinates remain the same.
How do i get a child's coordinates relative to the stage?
I think I know the answer to this one already, but am looking for any workaround or solution (php??)
I have a AS3 .swf that will be hosted on a client machine running from a web server and viewed in a browser.
It loads a list of images, etc from xml and then displays them. Fine. The problem is, the client wants to be able to put absolute file/network paths in the xml eg: file://filepath or \Serverpathetc....
I have a flash file that is pulling in images from a folder and a .txt for text content. The code for the .txt file:
[Code]...
It cannot find it? What am I missing I can't figure out how to get this to work, and I want absolute paths. I'm sure it's really simple, I just can't figure this out.
I need (convert) absolute position of nested mc (_root.mc.mc._x) on the stage. I noticed that the function localToGlobal could do this, but I could not figure out how. Maybe I could do workaround with counting positions of parent clips, but that sounds lame. how to trace this on the Stage? (trace(_root.mc.mc._x);
I Have a quick question concerning absolute links in flash. I have a Flash gallery that is populated by php and xml. I was using relative URL's in all of my URLLoaders and everything worked fine. But when I moved my source files on to a different server and switched to absolute URLs, I got a 1010 Error. Could this be a flash player security issue?
im trying to embed an swf file in facebook. To cut the story short, the swf im trying to embed is loaded fine but stops at preloader stage (0% of 1) and is not progessing as if it has missing link and couldnt locate something (the files struscture is one main swf file; index.swf loads other 5 swf),But, when i tried to load it up directly from browser, it works fine. I have been advised that changing the link path to absolute between the index.swf and 1.swf, 2.swf etc would solve the problem.
My questions will be:
-how do i change this path, because i couldnt seem to find any link that reflects the connection between those files?
-Is there any feature in flash that would be able to show this link rather than diggin up every symbol?
-If changing the path wouldnt solve the problem, what could be the reason this error is happening?.