ActionScript 3.0 :: Conflict Between Function In A Loaded-in .swf And The Main .swf?

Nov 17, 2009

I have one swf (let's call this 'A') that loads in an external swf via my own pre-loading class. We'll call this 'B'.s both swfs are written by myself, the structure follows the same one I always use, ie. a DocClass named 'Main'. When B is loaded in, the DocClass's clash - ie. B calls A's DocClass. a) Is this normal behaviour?b) Will this conflict occur for any other variables/functions that share a name?

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Loaded SWF Calling Main Timeline Function

Aug 5, 2009

I have a project which requires the loading and unloading of multiple "scenes". All my navigation is working (probably not the most efficient way) but I'm having one issue. I need a button on one of the loaded SWFs to call a function on the main timeline. Since Actionscript 3 no longer supports the _root functionality the way AS2 did, I cannot access the main timeline.

In general, how do I get to the root of the main timeline without using _root?

Also, how can I reference the loaded SWF and objects inside of it from the main timeline?

View 1 Replies

ActionScript 3.0 :: Calling Function From Externally Loaded SWF Into Main SWF?

Apr 4, 2009

I've written a script that takes keyboard input to turn movieclips on and off in a swf file (like the visible/invisible layer function in photoshop). Then I'm attempting to load the *.swf (image.swf) into a zoom/pan flash file from flash den. When I load it in, the keyboard controls no longer work. I've tried importing the keyboard control function (keyDownListener) into the main zoom.fla with this script:

Code:
import flash.display.Loader;
import flash.net.URLRequest;

[code].....

View 2 Replies

ActionScript 3.0 :: Getting Loaded SWF To Use A Function From Main.fla Document Class?

Dec 16, 2009

I have a main movie with thumb movieclips that load new children and stops the main movie's animation. Within the child there is a close buttion that removes itself. I also wanted the close button to start the animation of the main movie again once it removed the child. Since I am using a document class to load everything for the main move, how can the close button from the loaded swf use a function from the main document class?

View 5 Replies

ActionScript 3.0 :: Pass Parameters To A Function In Main Class From Loaded SWF?

Aug 15, 2011

I've got a main.as that loads SWF to the stage. the loaded SWF seppoused to pass a link to the main.as and trigger a javascript function to popUp that photo from that link.

I know there are two ways:
 
((root as MovieClip).parent.parent as Object).somefunction(parameters);
 
and to dispatch an event. inorder to pass parameters throug the event i need to extend it with another class.
 
isnt the (root as... )  more efficient if all i need is to pass a link?

View 7 Replies

ActionScript 3.0 :: Loaded Movie Calls Function In Main Interface?

Jan 25, 2009

I have an interface that contains audio controls in the Library (class: AudioControls)When a movie is loaded into the interface, and it happens to contain a sound (class: Audio_1), this loaded movie calls an interface function to show the audio controls:

Code:
if (Interface._ui != null) {
Interface._ui.playCurrentAudio();
}

The problem is, the playCurrentAudio() func in the interface contains some code that refers to nested MCs:

Code:
public function showAudioControls():void {
audioControls.x = 710;
audioControls.y = 583;
//

[code]....

That would be the speaker, rewind_btn, playPause_btn, etc. Referring to the parent clip, "audioControls", is no problem of course. But I get an error when I publish the loaded movie:

1119: Access of possibly undefined property speaker through a reference with static type AudioControls.
1119: Access of possibly undefined property rewind_btn through a reference with static type AudioControls.
1119: Access of possibly undefined property playPause_btn through a reference with static type AudioControls.

View 1 Replies

ActionScript 2.0 :: Sound Function Conflict?

May 5, 2004

How can I change the following so it won't conflict with sounds inserted manually in keyframes. Currently when this function is active, the loop sound works but the other sounds don't play..

Code:
soundTrack = new Sound();
soundTrack.attachSound("loop");

[code].....

View 14 Replies

ActionScript 2.0 :: Function Conflict - Loop Sound Works But The Other Sounds Don't Play

May 5, 2004

How can I change the following so it won't conflict with sounds inserted manually in keyframes. Currently when this function is active, the loop sound works but the other sounds don't play..

[Code]...

View 13 Replies

ActionScript 3.0 :: Access A Public Function (main.as) From Main.fla?

Oct 8, 2010

If I have a main.fla and main.as (where I written a Main class).

How can I access a public function (main.as) from main.fla?

View 4 Replies

Actionscript 3 :: Getting Data From Function Loaded After Current Function?

Mar 18, 2010

I have 2 functions, 1 loaded before another. Some value are determine by the other function data, but since one of it has to load before the other 1, how should I get the data that is loaded after current function?

private function wMessage():void {
Message.width=Name.width+20;
}

[Code]....

I've taken out some other unnecessary codes, but as you can see Name position is set according by the position + width of Message, but I want Message's width to be not smaller than Name

View 1 Replies

ActionScript 3.0 :: Access A Function Within A Function In A Parent Swf From A Loaded Swf?

Jul 29, 2010

Is it possible to access a function within a function in a parent swf from a loaded swf?

View 6 Replies

ActionScript 2.0 :: Lock FPS Of Loaded SWF In Main?

Jun 11, 2009

I am using loadmovie to load in swf in my main swf.

The FPS of my main timeline is : 20FPS

The SWF I am loading is : 8 FPS

When i load it in it is automatically changed to 20 FPS.

Is there anyway to lock FPS?

View 2 Replies

ActionScript 3.0 ::loaded A Swf Into Main Swf File

Nov 17, 2009

i want to loaded a swf into my main swf file. How do I place it on the main timeline in the main swf. To be exact I have a frame label called about. Where i want the swf to be.[code]

View 7 Replies

ActionScript 3.0 :: Return From Loaded Swf To Main?

Mar 13, 2012

I have some swfs that i want to combine: I have the main.swf that containes buttons, and i want each button to lead to an external swf. I have already done that.What i dont know is how to return to  main.swf. I want all external swfs to have a button called "Back to menu" and go back to main.swf

View 3 Replies

Access Main Swf X,Y From Externally Loaded It?

Jan 7, 2010

I have a site that I'm working on that I am loading an external swf page into a main one. The main one is based on a totally liquid state and stretches the background to fill the browser and the components are relatively position based on browser window dimensions.

Now inside of the main swf I load an external swf through the loader command. This swf has a set dimension and stays centered in the stage.

I am trying to make a button in this swf that loads yet another swf that is stretches the full browser. However I do not know how to access the properties of a main swf from this external one, or if this is even possible.

View 3 Replies

ActionScript 3.0 :: Overlapping Loaded Swf To Main Swf?

Jan 4, 2011

I am loading an external swf and I want it to overlap my main swf. I have been trying to figure this out for days. Check my link to see what I am talking about

[URL]

when you click on about the swf loads, but it leaves a little space on the right where you can still see the main swf underneath... you can also check my FLAs if you want...download here

[URL]

View 1 Replies

ActionScript 2.0 :: Second Swf Works By Itself But Not When Loaded Into The Main Swf

Mar 18, 2003

i have a movie that loads a 2nd movie on a button action. The second movie has some other buttons ("co" & "me") that makes some text pop up with easing. This is the code below. The problem is, the second swf works by itself, but not when loaded into the main swf. I've tried changing _root to _parent as well as various others, but to no avail? Is _root my problem??

[Code]...

View 1 Replies

ActionScript 2.0 :: Loaded Swf Controlling Main Swf?

Oct 25, 2005

is it possible for a loaded swf to control the timeline of the main swf or even to tell the main swf to unload the loaded swf just by pressing a button in the loaded swf.

View 2 Replies

ActionScript 2.0 :: Possible To Run FLV Inside SWF Loaded Into Main?

Sep 26, 2006

I have a website up at [URL]. The thing is that I have flv files being loaded by swfs that are loaded on a movieclip of a main swf. Locally everything works fine but as soon as I move it up the web or even try to run in over my home network, the flv files won't run. Can the flv run inside a swf that is loaded into another swf? I have set the paths to relative already, this taking into account the main swf!

Something like this:
loaded_swf_folder/flv_folder/flv_file.flv
If I didn't take the main swf into account it would look like this:
flv_folder/flv_file.flv
But I tried this already and it didn't work at all. Except if you run one of the loaded swf directly instead of through the main swf.

View 2 Replies

ActionScript 3.0 :: Control Main.swf Through Loaded.swf?

Jun 7, 2009

I'm trying to control my main.swf through a loaded .swf.

My goals are. 1. load the external swf into main.swf and have a movieclip in the external swf play. (the movie clip in the external swf should play without any code, however, when the external swf loads, the movie clip goes to the last frame of itself for some reason)

2. I have an "X" button on the loaded.swf itself that should dismiss the loaded swf and cause my navigation on my main.swf to reappear.

Here is my loader code in main.swf:

Code:
var _urlx:Loader = new Loader();
_urlx.load(new URLRequest("loadBlank.swf"));
var _url1:Loader = new Loader();

[Code]....

As of now, my navigation in main.swf does reappear when the "X" in the loaded.swf is clicked, but I need a way to unload the currently loaded swf when the "X" button is clicked..

I've tried remove child, checking to see if the loaded child is not null, but that didn't work either...

View 3 Replies

ActionScript 2.0 :: Add One To The File That Is Loaded Into The Main Movie Main Movie That Is Loading The File?

Aug 3, 2003

using the command:

loadMovie(_root.section, _root.content);how would i work in a preloader bar?? add one to the file that is loaded into the main movie or on my main movie that is loading the file?

View 1 Replies

Action Script :: Swf Is Loaded Into Main Movie?

Apr 29, 2008

My site consists of a main swf file ('home.swf') which then has other swfs loaded into it via an empty movie clip.I have created one such swf. file (news.swf) which features 2 simple scrolling text buttons (one to move text down, and the other to move it up).http:[url].....

Everything works fine when I preview the news.swf on its own, but when I preview the home.swf and view the news.swf loaded into it, the button which should move the text up doesn't work.I think it's something to do with using the term _root. but i don't know what to replace it with.This is the script I have on the button that doesn't work:

//Events during mouse click
on(press) {
_root.controller.gotoAndPlay (2);[code]........

Is it just a case of changing the _root. term, and if so what should I change it to, or is it trickier than that.

View 9 Replies

ActionScript 3.0 :: Communication Between Main And Externally Loaded SWF

Aug 30, 2010

I basically need to communicate to an externally loaded swf and send info back to main swf. Below is some sample code of what I am trying to achieve:

In the main swf:
var imgLoader:Loader = new Loader();
imgLoader.load(new URLRequest("external.swf"));
addChild(imgLoader);
var MC:MovieClip = imgLoader.content as MovieClip;
//var MC = MovieClip(imgLoader.content);
trace(MC)
MC.btn1.visible=false;

In the external swf:
btn1.addEventListener(MouseEvent.CLICK,externalCli ck1);
btn2.addEventListener(MouseEvent.CLICK,externalCli ck2);
function externalClick1(e:MouseEvent):void {
trace("external Click 1");
//main swf goto nextFrame;
} function externalClick2(e:MouseEvent):void {
trace("external Click 2");
// main swf goto PrevFrame;
}

The trace I have setup in the main swf, trace(MC) returns a null value.

View 2 Replies

ActionScript 3.0 :: Controlling Main Timeline From Loaded SWF

Nov 2, 2010

I have a simple swf called site.swf that loads a menu with UILoader called menu.swf, from menu I'm able to navigateToURL but I also need that it goes to frame 50 in menu.swf.

View 1 Replies

ActionScript 3.0 :: Referencing The Main Timeline From A Loaded Swf?

Jun 14, 2009

I just poked around google as well as these forums, but the only answer I am seeing that was successful, is from kglad, and for some reason his posts are not showingAnyway, I am just trying to figure how to reference a frame label on my main timeline from a loaded swf (through my imageLoader).

View 4 Replies

ActionScript 1/2 :: Getting Back To Main Timeline In Loaded Ext. SWF

Jul 7, 2009

I have a project I'm working on where the user is presented with an overhead shot of a building and is able to mouse-over the different rooms to choose one to "enter." Once clicked, the chosen room is an external .SWF that is loaded that has options to view other external .SWFs within that room. Problem is, within the first loaded .SWF, I have a "home" button that is supposed to take the viewer back to the main overhead view but I can't get the AS to work. I've tried _parent and _root with no luck (not sure I even typed out right code).

View 29 Replies

ActionScript 3.0 :: Muting Sound In A Loaded Swf From The Main Swf

Aug 25, 2009

I have a swf I am loading in and I need to be able to mute the sound of those soundChannels in the keyframes inside of the other swf. I have a mute button that I am toggling its visiblity on and off, one for mute one for sound. I need to be able to access the sound clip inside the external swf.

View 3 Replies

ActionScript 3.0 :: Control Main Timeline From Loaded Swf

Aug 24, 2010

I'm using a textfield for debug information.I'm loading an swf on the main timeline and I'm showing the status in the debug textfield.[code]I'm loading a png file in the loaded swf. , I'm trying to show the status of the png file as I showed the status of the swf.[code]I can't control the main swf from inside the loaded swf. Even gotoAndStop or calling a function doesn't work.Do I need to add something when I load the swf, saying it's a MovieClip or something?URL...

View 3 Replies

Preloader Can Not Close After Main Site Has Loaded

Dec 11, 2010

I'm using the sample external preloader file supplied with CS5 as the basis for my customised pre-loader. It's working fine except that once the main site has loaded and is open, the preloader remains loaded in the background.[code]...

View 7 Replies

ActionScript 3.0 :: Enable Outside File When Loaded Via Main SWF?

Jul 21, 2009

If I have a main.swf which loads, for example, outside.swf, is there a way to make outside.swf useless if run on its own, but working when loaded via main.swf? The purpose would be preventing people from running parts of a presentation on a CD, forcing them to use only the main.exe projector file. I tried making a Boolean variable called "allowed" in outside.swf telling the movie not to play if it's set to false, and then tried changing this property from main.swf after loading it by calling loader.content, but it didn't work.

I did this:
ActionScript Code:
button1.addEventListener(MouseEvent.CLICK, loadaj);
function loadaj(e:MouseEvent):void {
var MVloader:Loader = new Loader();
var req:URLRequest = new URLRequest("outside.swf");
MVloader.load(req);
attacher.addChild(MVloader);
MVloader.content.allowed = true;
}

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved