ActionScript 2.0 :: OnPress And Looping XML File

Dec 5, 2007

I'm having a problem with my onPress actions when reading them form an XML file. Here's what I'm trying to do: Read xml file: duplicate movie clip according to how many xml items there are. Place a different onPress action to each movie clip according to what the corresponding path is in the xml. My problem is that each time I press any movieclip I always get the last path in the xml file. The loop is over writing the value and when the onPress function is called it uses the last value. How do I get the onPress to remember which movie clip it is and use the appropriate onPress action?

Here is my code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var Portfolio:XML = new XML();
Portfolio.ignoreWhite = true;
Portfolio.onLoad = function(bSuccess:Boolean):Void {
[Code] .....

View 3 Replies


Similar Posts:


ActionScript 2.0 :: Array.onPress - Add A OnPress Event To Dynamically Duplicated MovieClips ID's Stored In Array List

Apr 15, 2011

lets say i have dynamically duplicated movieClips ID's stored in array list. i want to add a onPress event to them. how do i do it?

[Code]...

View 5 Replies

ActionScript 2.0 :: Button OnPress Calls Another Button's OnPress?

Nov 5, 2007

[URL]

First, click on the Abaco island shape on the map. You'll see on rollOver there is a glow around the island. Now click on that island and the glow remains for the zoomed-in detailed view. When you return to map and zoom back out, the glow is removed.

Now, compare this with clicking on the island name "Abaco" from the list on the right, instead of clicking directly on the island from the map. It zooms in and shows the details fine, but the glow that should be there is not.

The reason this problem is very perplexing for me, is that the onPress action of the list button in the right column calls the onPress function of the map button. So, theoretically they should do the EXACT same thing when pushed. But clearly they don't.

Here is the code for the button from the list on the right panel:

Code:
listAbaco_mc.onRollOver = function() {
_root.map_mc.abaco_mc.button_btn.onRollOver();
};

[Code]....

There is more code, for example rollOver, rollOut, and Press actions for the other island buttons, but they are all of the exact same format as the Abaco island button and they all have the same problem.

So, to recap, the problem is that the list button in the right panel do not function properly onPress, even though they are calling the onPress function of the island buttons directly, and the island button onPress function works perfectly. Strangely, all but one little thing works. So it's obviously getting to the correct functions and going through the code as planned, yet that one part about the glow is being ignored or otherwise messed up.

View 12 Replies

Looping A Layer Within Fla File?

Jul 22, 2009

Im having trouble getting my head around writing script for looping certain layers of a fla file.I have a project that I urgently need to finish and can't figure out how to achieve what I need.I have an fla file that has several animated layers.I want layer 1 to play once and stop while continuing to be visible (which I have achieved).I then need to play layer 2, layer 3 and layer 4, and loop these layers continuosly without relooping layer 1.

View 2 Replies

Can't Stop File From Looping

Jul 2, 2009

I created a small Flash movie that I want to end at the last frame. Instead it keeps looping and starting from the beginning. This is the link: [URL] At the end of each timeline I inserted a keyframe and added the action: stop(); But this doesn't seem to have any effect.

View 1 Replies

Professional :: Looping The .swf File?

Dec 9, 2010

I'm having a problem with a .swf file created in Flash CS3. I want it to loop, which it does when I Test Movie in Flash, or when I play the .swf file in the Flash Player. But when I upload to my web space it stops looping.
 
I used the follwing script in the last frame of the file to create the loop:
 
gotoAndPlay(1);

View 4 Replies

Html :: Swf File Not Looping?

Aug 6, 2010

I'm working with a swf file (a simple flash movie) and I am trying to get it to loop. I've tried setting loop="true" in the embed tag, and for the object.

Does this mean that the problem is in the swf file itself?

View 1 Replies

Looping A Layer Within Fla File

Jun 29, 2009

I am very new to flash CS4 and am having trouble getting my head around writing script for looping certain layers of a fla file.I have a project that I urgently need to finish and can't figure out how to achieve what I need.I have an fla file that has several animated layers.I want layer 1 to play once and stop while continuing to be visible (which I have achieved).I then need to play layer 2, layer 3 and layer 4, and loop these layers continuosly without relooping layer 1

View 3 Replies

GotoAndPlay - Flash (SWF) File Not Looping

May 7, 2009

I'm new to this actionscript stuff and I'm having trouble making my swf file loop over and over. I have several movie clips in my scene and in the last movie clip, in the "actions" layer, in the last frame, I put "gotoAndPlay(1);" hoping that this would make the file loop over and over.

Instead, I get a error message:
1120: Access of undefined property social_media_mc.
How I can make my swf loop over and over?

View 2 Replies

Flash :: Create Looping Swf File From Mp4?

Jun 6, 2011

I am having a problem where i am trying to get a swf file to loop. I am starting with a mp4 of a slideshow i have made.
 
I can import it to flash and export it as a .swf file but it does not loop.
 
Does anyone know of a way to get it to export a file that loops?

View 11 Replies

Actionscript 3.0 :: Looping A Layer Within Fla File?

Jun 29, 2009

I have an fla file that has several animated layers.I want layer 1 to play once and stop (which I have achieved).I then need to play layer 2, layer 3, layer 4 and loop these layers continuosly without relooping layer 1.

View 6 Replies

HTML :: Parameters Added But SWF File Not Looping

Mar 22, 2011

I have a .swf file that is not looping although I have added the parameter to do so. It plays just the once, and at the end of the video it stops instead of looping.
<div id="video">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="211" height="316" id="FLVPlayer" style="visibility: visible; ">
<param name="movie" value="FLVPlayer_Progressive.swf">
<param name="quality" value="best">
<param name="wmode" value="opaque">
[Code] .....

View 1 Replies

ActionScript 2.0 :: Reading Messages From A XML File And Looping Through Them

Dec 22, 2006

I have done before, but unfortunately no longer have the FLA file. The idea is to have a web page header that has some eye-catching animated messages that keep changing to the next one after a few seconds.

An XML file (header-messages.xml) contains one line per message, and also a hyperlink, see example below

<?xml version="1.0"?>
<config>
<message1 lineOne="Special offer on red widgets" hyperLink="/special-offer.htm" />
<message1 lineOne="Read our latest news" hyperLink="/latest-news.htm" />

[Code].....

View 1 Replies

ActionScript 3.0 :: Looping Mp3 File And Event.SOUND_COMPLETE

Jul 3, 2007

I am trying to find a workaround to the problem of looping mp3 files, basically the silence in the transition (from end to start). I could use wav files but I need to load the file externally, which makes not possible to use wav. So I did this

HTML Code:
var channel:SoundChannel = myMp3.play();
channel. addEventListener (Event.SOUND_COMPLETE, onComplete);

[Code]....

Edit: Now I know it is not a problem of flash, it is problem of the mp3 format itself.

View 7 Replies

ActionScript 3.0 :: How To Stop Looping An External .SWF File

Dec 20, 2010

How can I stop my Logo.swf file from looping. Actually the external Logo.swf file doesn't contain any looping code inside it. If I open it in any flash player it animates only one time. Writing "stop();" in code stops all other animations which I don't want.

Code:

var J:Loader=new Loader();
addChild(J);
J.load(new URLRequest("Logo.swf"));
J.x = 275;
J.y = 25;

[code].....

View 1 Replies

ActionScript 1/2 :: Stop Looping File At Specific Frame?

Oct 19, 2011

Ive created a banner ad in AS 1.0-2.0. The ad can only loop 4 times then it must stop. The following code does this at frame 170. The timeline is 170 frames in length, and this code is keyframed on an actions layer on frame 170 - however, I'd like the final stopped flash swf file to occur at frame 155. I can't just put this code on frame 155 - it skips a whole section of  animation (from frames 155 to 170) that I want to keep in the loops. 
 
loop = loop + 1
if (loop < 4) {
this.gotoAndPlay(2);
} else {
this.stop();
}

View 3 Replies

ActionScript 3.0 :: Get Flv File Looping Within The Swf - Access Of Possibly Undefined Property

Jun 5, 2011

I want to get my flv file looping within the swf. I've used the FLVPlayback Component. I've given the flv file the instance name of "vid". Actionscript is as follows:

import fl.video.*;
vid.addEventListener(VideoEvent.COMPLETE, rewind);
function rewind(eventObject:VideoEvent):void {
vid.autoRewind = true;
vid.play();
}

The error message I get at runtime is: 1119: Access of possibly undefined property COMPLETEthrough a reference with static type class.

View 3 Replies

Actionscript 3 :: Loading External .swf File In Air Application Causing Looping Constructor

Apr 19, 2011

I'm building an Air application (straight AS3 no flex) that embeds and displays a .swf file. [code]Not only does this not add the .swf file to the display list like I want it to but it seems to run over and over again. "hello" fills up the output window from the trace statement like it's running every frame.The code loads a .jpg just fine so it must be a problem specific to flash files. I would think I would get some kind of security error if there was a conflict not this strange looping constructor. Does anybody have any ideas what is causing this behavior?So I think what was happening is that because both flash files shared the same application domain and they both had "Main.as" as the main class file it was running the constructor over and over again.I've updated my code above to show my unsuccessful attempts to load the external .swf with a different application domain.

View 1 Replies

Separating Looping Anims From Non-looping?

Feb 2, 2010

The issue I am running across is this: I encoded and embedded a movie clip to act as the background. There are other animations that can and will loop, as the movie resets itself. But there are some elements that I only want to run once and not repeat once the embedded movie loops (link introductions, where objects fly in and transition into the button). How can I set the one time animations to fire just once, while keeping the embedded animation on a loop?

View 1 Replies

IDE :: Singling Out Non-looping Anims From Looping

Feb 2, 2010

I am fairly new to Flash and I am constructing a website. The issue I am running across is this: I encoded and embedded a movie clip to act as the background. There are other animations that can and will loop, as the movie resets itself. But there are some elements that I only want to run once and not repeat once the embedded movie loops (link introductions, where objects fly in and transition into the button). How can I set the one time animations to fire just once, while keeping the embedded animation on a loop?

View 1 Replies

ActionScript 2.0 :: Set OnPress Dynamically?

Jan 16, 2009

Im new to actionscript , but not new to programming..Got the following problem : Im building a flash page dynamically with actionscript , from a php generated xml file which defines image/swf paths, text, position etc..All works well, except, i can't set an onPress function on the movieclips i create. Im doing something like this:

[Code]...

View 0 Replies

ActionScript 2.0 :: OnPress Not Working On Jpg?

Jun 17, 2009

the onPress down the bottom of this code wont trace

Code:
thumb_1_mc.onPress = function(){
loadjpg();
}

[Code].....

View 1 Replies

ActionScript 2.0 :: Using OnPress And OnRelease With MC

Jan 27, 2011

I have a Red Cup which is a MC and I want the Red Cup to go UP when clicked on and goes back down when you release the mouse click.
I know the coding is
On(press) { and
On(release) {
But I do not know the details.

View 2 Replies

ActionScript 2.0 :: Cs3 With AttachMovie And OnPress

Jan 13, 2009

I have a movieclip with onPress and I attach another movie to the first one. Unfortunately, the second movie inherits the onPress function from the first one. How can I remove the onPress function from the second movie? I tried to set it's onPress and onRelease to null and undefined but no success.

View 3 Replies

IDE :: OnPress Navigates To A Cue Point In FLV?

May 11, 2010

I'm trying to use some buttons to navigate through an FLV with cue points. Here is an example of the code I'm using so far, but I'm getting an Invail Seek error in my output.

[AS]
photochromic_but.onPress = function() {
FLV_player.seekToNavCuePoint("Photochromic");
};
[/AS]

View 2 Replies

ActionScript 2.0 :: OnPress 2 Actions?

Sep 18, 2010

If I want a button to perform 2 actions such as 1st time onPress the mc visible true and 2nd time onPress the mc visible false and true and false and so on.

View 2 Replies

Remove The Event Handler OnPress?

Feb 8, 2006

I have the next code:

mc.onPress=function()
{
//some code
}

How do I remove the event handler onPress?

View 4 Replies

ActionScript 1/2 :: OnRollOut, OnRollOver And OnPress?

Aug 30, 2010

I have a button that I basically want to give the action:

on (press) {
gotoAndPlay (3) ;
}

[code]....

View 5 Replies

Flash :: Pass Parameters To An .onPress() In AS2?

Apr 4, 2012

I'm trying to do something like this:

var something = "someValue";
some_btn.onPress = function (something) {
someFunction(something);
}

[Code].....

But it traces "undefined". What would be the correct way of achieving this?

View 3 Replies

ActionScript 2.0 :: Adding An OnPress Function?

Feb 16, 2009

I'm trying to add an onPress function to something that I've just dynamically attached to the stage.

ActionScript Code:
item.attachMovie("close_btn", close_btn, this.getNextHighestDepth());

View 9 Replies







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