Frame One Of Linked SWF Executes Sometimes

Jun 10, 2009

I am using the loader class to load an external swf and attach it to an empty movieclip, the final step follows:
// function loadComplete(e:Event):void {
mc_launch.addChild(gLoader);
MovieClip(gLoader.content).gotoAndPlay("start");}

When navigating away from the movie clip, it's dumped as follows:
MovieClip(gLoader.content).closeAllStreams();gLoader.unload();

The linked swf has two important frames in the beginning. The first frame is labeled "hold" and has the following:
var gSC:SoundChannel = new SoundChannel();
var gSCBusy:Boolean = false;var gSlideIndex:Number = 0;
var gAudioPosition:Number = 0;
var gPlayList:Array = ["start","slide01","slide02"]
var gAudioList:Array = ["intro.mp3","",""]
var gRunMode:String = Capabilities.playerType;stop();

The fifth frame is labled "start" and the singing and dancing begins from there. The stop(); function in the first frame is used to prevent the loading swf from executing before its 100% downloaded (I had some early trouble where the music would start before the screen assets were in place). My problem: This works perfectly the first time the linked swf is downloaded and attached, however, if you navigate away and then back I get the error "gSlideIndex NAN" which indicates to me that the first frame in the linked swf is not executed on subsequent attachments, the playhead jumps straight to "start" and my globals are never declared. Why would a linked swf execute frame 1 the first time it's attached to mc_launch but not the second?

View 9 Replies


Similar Posts:


Animated Button Not Working When Linked To Frame Label?

Jan 21, 2010

After finally making a button with an animation in it, I get stuck with the button actually working. I followed this tutorial; [URL] for the most part. And when I link the button to an URL like it uses as an example in the tut it works. But when I want to link it to a frame label in my website it doesn't work. Atm the code in the movie clip on the hit area looks like;

on (rollOver, dragOver) {
gotoAndPlay("on");
}on (rollOut, dragOut) {
gotoAndPlay("off");
}on (release) {
gotoAndStop("Scene 1", "who")
}

The rollover/out works fine. But the link isn't working within the Flash file.
Here is the .fla: [URL]
And a CS3 version: [URL]

View 2 Replies

ActionScript 2.0 :: [Flash8] Use A Linked Object Without Exporting In First Frame?

Dec 6, 2005

How can I use a linked object without exporting it in the first frame? I'm asking that because I don't want to put an aditional load on the beggining of the loading progress...

View 4 Replies

Flash :: Find Out The Linked Url Of The Image And Where Is The Linked Url Code In?

Nov 29, 2011

How can find out the linked url of the image in the flash of a website? I looked for the image url some time. but couldn't find itif find the linked url of the image, and i want to alter an image linked url address. where is the code in?

View 3 Replies

Flex - Mxmlc With Both Linked And Not Linked Rsls?

Jul 27, 2009

On the mxmlc command line, I can include paths to RSL files. I can choose to link these RSLs at runtime by setting

-static-link-runtime-shared-libraries=false What if I need to link to some rsls and embed (static-link) other rsls? Is there a way to set the link settings for each rsl?

View 1 Replies

ActionScript 2.0 :: Script Executes In Flash But Not As Projector?

Feb 28, 2010

I'm using the script below for a Flash (CS3 and AS2) presentation so the client can play/stop and rewind/forward the movie with the keyboard.

It works perfectly when I go "Control >>> Test Movie" but when I publish the movie as a Projector file nothing happens when I hit the relevant keys.

Also, the same thing happens if I open the SWF outside of Flash from it's local folder.

Code:

import mx.utils.Delegate;
var nCheckPoint:Number = 0;
var aCheckPoints:Array = new Array();
aCheckPoints.push( { sScene:"Scene 1", nFrame:10 } );

[Code]....

View 10 Replies

Professional :: Script Executes In Flash But Not As Projector?

Feb 28, 2010

I'm using the syntax below for a Flash (CS3 and AS2) presentation so the client can play/stop and rewind/forward the movie with the keyboard.It works perfectly when I go "Control >>> Test Movie" but when I publish the movie as a Projector file nothing happens when I hit the relevant keys.Also, the same thing happens if I open the SWF outside of Flash from it's local folder.

import mx.utils.Delegate;
var nCheckPoint:Number = 0;
var aCheckPoints:Array = new Array();[code]..........

View 1 Replies

ActionScript 3.0 :: Create An If Statement That Executes Two Different Loops?

Oct 5, 2011

Is there a way to create an if statement that executes two different loops?

For example, If I was trying to make game with a button that when clicked creates random objects falling down and when the objects are destroyed, creates random objects floating up. I haven't seen anything online, but I'm wondering if anyone know. Is it possible or should I just create two different listeners?

View 3 Replies

ActionScript 2.0 :: Event Handler That Executes On Load?

Feb 16, 2006

I need an event handler that executes only once when the root movie has loaded. If I later on return to the first frame that holds the script it should not execute again.

something like "when_root_has_loaded = function(){ some code};

View 1 Replies

ActionScript 2.0 :: Function Executes Premature With EaseX?

Jul 26, 2007

Code:
////////////
//proto.as//
////////////
MovieClip.prototype.easeX = function( to:Number , speed:Number , endF:Function ,

[Code]....

otherFunction() runs as soon as the mouse over happens and not after the ease finishes as I would like it to.

View 4 Replies

ActionScript 3.0 :: Delay Play Only Once - Code Executes Each Loop

May 5, 2010

I am new to flash. I can't seem to decifer the script examples in the help files. After a lot of trial and error the following codes works great. It delays playback on the video for the proper amount of time. The only problem is when the playback loops (like it should) the codes executes again. I only want to execute the code the first time thru.

[Code]...

View 6 Replies

ActionScript 3.0 :: Function Executes When An Instance In The Movieclip Is Clicked?

Aug 16, 2010

I'm so getting confused with this,So i'm making a card game, and i'm just on the beginning of it. I've already added the objects on the stage and stored them on an array.now i made a function that when it executes the .x and .y properties of these cards would change. this is what i did, but nothing seems to happen.the array MyCards contain movieclip objects not strings and also, the function executes when an instance in the movieclip is clicked

ActionScript Code:
distCards(MyCards);
function distCards(cards:Array):void {
for (var i:int=0;i<cards.length ;i++) {

[Code]...

View 1 Replies

IDE :: Create A Timer That Executes The Following Piece Of Code After 10 Seconds?

May 3, 2010

How to i create a timer that executes the following peice of code after 10 seconds:

Code:
_visible = false;

View 3 Replies

ActionScript 2.0 :: Changing An On(press) Command - Automatically Executes Every 10 Seconds

Mar 20, 2008

I have an on(press) command that refreshes advertisements on an HTML page that my .swf is embedded in. When a user clicks on buttons that have the script, the advertisements refresh. I have a page that features a Slideshow Pro slideshow. Because this is a component, I am unable to put this script on the buttons in the slideshow. I am hoping instead, to have the script automatically run every 10-20 seconds. I am using actionscript 2.0 in a Flash CS3 file. Here is the code on the button:

[Code]....

View 1 Replies

ActionScript 3.0 :: Executes In Another Class That's Called From A Dispatched Event Elsewhere Still Run Procedurally?

May 29, 2009

If I change the value of a variable that two different classes can see (in a custom global class, for instance), and then immediately dispatch an event that the other class is listening for, will tracing that variable in the listening class reflect the variable's new value? In other words, does code that executes in another class that's called from a dispatched event elsewhere still run procedurally, or is there some sort of asynchronous thing going on, where the class that dispatched continues on to the next line of code in its own class without regard for what may or may not happen in the other class?

View 2 Replies

Layers Appear To Be Linked?

Jun 9, 2009

Whenever I add a new layer, it seems to be linked to my 1st layer.If I delete something on the stage on the new layer, it's also deleted from the 1st layer.  If I try locking the 1st layer, anything on the new layer-although not locked itself -can't be selected.

View 2 Replies

Linked List In Flash Cs4?

Dec 9, 2009

I am currently making a website in flash for a football team and i would like to make a list of all the players names which link to separate player profiles in the same flash document.

View 4 Replies

ActionScript 3.0 :: Get Name Of Swf Linked To An As File?

Jan 26, 2010

Sounds simple enough. I have a number of swfs (quiz01.swf, quiz02.swf.....) all linked to one quiz.as file. The quizes in turn are loaded by another swf, Main.swf. I need to get the name of the specific quiz that is loaded, so I can identify an external xml file.
 
Tried using the "loaderURL" in the as, but it gives the name of the Main.swf. How can I just get the name of the swf that is associated with the quiz.as file?

View 5 Replies

ActionScript 1/2 :: Pausing A Linked .flv?

Sep 11, 2007

I have an external .flv and I simply need to be able to pause it with a frame action and start it back up with another frame action.I found some references to "flvStream.play" through google but I haven't been able to properly implement it.

View 3 Replies

Professional :: No FLV Video In A Linked SWF?

Jun 16, 2011

I've got an FLV video linked to an external SWF (a substage) that is itself linked to another SWF (the main stage) The FLV plays fine if I publish and run the substage independently but when the substage is loaded into the main stage at runtime I lose the video, all the other screen elements from the substage work fine. I thought it might be a path issue so I hardcoded a fully qualified URL as the video source with the same results; works independently, fails when loaded into the main stage at run time.
 
Flash CS5/AS3 using the video player component.

View 5 Replies

AS3 :: Add Linked BitmapData To Stage?

Oct 12, 2011

I'm trying to add a sprite to a stage made from bitmapData I link to from the library with the identifier pointerGraphic, here's my code:

Pointer.as

package com.George.BMIapp
{
import pointerGraphic;
import flash.display.BitmapData;

[Code]....

Yet nothing appears on the stage, yet there are no errors (I'm in strict mode with debugging enabled).

View 2 Replies

ActionScript 3.0 :: Linked TLFTextField?

Jun 22, 2010

I am using linked TLFTextField in flash cs5 and want to access the text of a particular TLFTextField within the chain. Is there a way to access the text in a TLFtextField within a chain

View 0 Replies

ActionScript 3.0 :: Linked Folder Between Two Projects?

Jul 27, 2009

currently using flex builder 3. I am having trouble setting up linked folders between 2 of my projects.Basically I have a project for a Map Editor, and a project for the Tile Game. I want to share the map folder between the two projects but I keep getting package errors and I don't know how I should nest the folders/projects or where to put the maps or how to import classes from these linked folders.The project folders are currently arranged like this....Flex/Game...Flex/MapEditora maps folder needs to be shared between the two projects

View 1 Replies

ActionScript 3.0 :: Detecting The End Of A Linked Movieclip?

Mar 7, 2010

I have a problem where I can't detect the end of a movieclip in my project.

I have the FLV video linked for actionscript, so that I can control it dynamically with a few other things using AS3.

[Code].....

View 1 Replies

No Animation On Scene Linked To Another Through Button?

May 10, 2011

I have one scene linked to another through a button, when I click on the button that links to scene two it takes me to the scene but doesn't play the animation it just shows the non animated components. Is there something really obvious I am missing here because if I go to the scene (when I am not testing the movie) the animation works perfectly.

View 1 Replies

ActionScript 2.0 :: Linked In Separate Subfolder?

Nov 10, 2011

I'm having an issue with getting a simple flash image swap file displaying on a website I'm building and was wondering if anyone can tell me what I've missed. I built the image swap slideshow which is just a simple blend through four images. It uses the loadMovie to import the images from the directory the movie is sitting in so the loadMovie command just references the jpg files directly with no extra directory info. The swf file and the image files it loads are all in a subdirectory off the root called flash. The page I want to display the swf movie on is actually the index html page in the root directory of the website. So I used this html to display the swf file.

[Code]...

View 1 Replies

ActionScript 3.0 :: Importing A Swf Linked To A Class?

Dec 3, 2008

I have a scroll file, taken from a tutorial, which is linkedto a class. After having customized my file I did try it and itworks fine. The problem is starting when I try to import this fileto an empty MCL in my website. When I have imported all theelements they do not respond and act like single pieces (es. thescroll bar is detached from the scroller). What can I do?

View 2 Replies

Flash :: Image Linked To Table?

Jun 11, 2009

I have Adobe Creative Suite, but I haven't begun to learn how to use Flash yet. I work primarily with PHP using Dreamweaver and have a very basic understanding of JavaScript.I just discovered a really cool script here. The page displays a Flash image map of Africa and a table listing every nation in Africa. If you hover over Kenya on the map, Kenya is highlighted on both the map and the table. Vice versa, if you hover over the word Kenya on the table, Kenya is highlighted on both the table and the map.
 
I would like to duplicate this on my website. (It's in the public domain.) So I copied the source code, then began recreating the style sheets, JavaScript files and images. When I view the page locally, I see the Flash image (map of Africa). But when I hover over a nation on the map, it says "undefined," rather than showing the name of the nation. The table listing the nations doesn't display at all.
 
Does anyone have any idea how this affect is created? Can you offer any tips that might help me recreate it on my site? It appears that AJAX is another technology used on the page. That's something else I have no experience with, but I'm not sure if AJAX is associated with the Flash map/table function or not.

View 3 Replies

Items In Library Linked Together Somehow, But Want To Delete One

Aug 13, 2009

I'm practice with Flash, and trying out different things, but somehow, I managed to create a movie symbol from a graphic symbol, and now whenever I try deleting one of the symbols, it effects the other symbol as well.
 
I only want one of these symbols, yet I can't seem to only keep one. They both seem to depend on each other, and I don't know how to get around this.

View 2 Replies

ActionScript 3.0 :: Communicating Between Linked Classes?

Oct 28, 2009

I have been struggling with what seems to be simple concept in ActionScript 3.0 - how to communicate between classes. I have a very simple experiment with two movieclips on the stage. They are named YellowBox and RedBox in my library. I have linked the following code to the YellowBox movieclip: 
 
package{    import flash.display.MovieClip;    import flash.events.MouseEvent;        public class YellowBox extends MovieClip    {                public function YellowBox()        {            this.addEventListener(MouseEvent.ROLL_OVER, rollOverHandler);        }                public function rollOverHandler(event:MouseEvent):void        {            this.x = x + 3;        }    }}
  
What I would like to do is call the YellowBox() function on my RedBox MovieClip with the following code:
 
package{    import flash.display.MovieClip;    import flash.events.MouseEvent;        public class RedBox extends MovieClip    {                public function RedBox()        {            YellowBox();        }    }}
  
I get the following message when I compile: 1136: Incorrect number of arguments.  Expected 1.

View 2 Replies







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