Dynamically Addressing Xch Works.... But It Doesnt Always?
its me again, building another component, just wondering how you would go about making button actions via a customUI
cheers,
Prophet.
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 09-01-2004, 08:19 PM
View Complete Forum Thread with Replies
Sponsored Links:
- Button Works, Doesnt Work, Works, Doesnt Work With Each Click
- It Works It Doesnt Work It Works It Doesnt...why?
- Dynamically Addressing Movieclip
- Dynamically Addressing Movieclip
- Dynamically Addressing Movieclip
- Addressing Different Dynamically Added Movieclips
- Dynamically Created Mc + Addressing / Event
- Dynamically Created Mc + Addressing / Event
- Addressing Dynamically Named, Duplicated Clips
- [CS3] Addressing Dynamically Created Instances Individually
- Addressing Layers Dynamically For Preloading Multiple Movies
- Timer Works... Now It Doesnt
- First Function Works Second Doesnt
- Saving Works And Doesnt
- It Works, It Doesnt Work.?
- Hittest, Sometimes Works Sometimes Doesnt
- Debug Works/Swf Doesnt?
- Retrieve Var From A Mc...doesnt Works....
- Offline It Works, Online It Doesnt..... HELP PLEASE
- Reading The Array Works, Then It Doesnt...
- SetFocus Doesnt Works On Browser
- SWF Playlist, Works But Doesnt Heeeeelp
- Scene Works But Movie Doesnt?
- Testing Locally Works, Otherwise Doesnt...
- Works For 1 But Doesnt Loop Any Ideas
- Flash Doesnt Show On Mac, Works On Pc
- Making Php And Flash Actually Work? It Works....but It Doesnt
- Load Vars Works On One Server, And Doesnt' On Another
- Send Works Fine SendAndLoad Doesnt
- LoadVariables, Works In DE, Doesnt Work When Published
- Trace(input_pname.text) Doesnt Works
- Help With Code: OnPress Works But OnRelease Doesnt?
- Preloader Works, But Component Doesnt Play
- Submenu-works Fine In Flash-doesnt When Published....
- _root.play(); Works But Goto Frame Doesnt
- Mozilla Works Fine, Explorer Doesnt - For My Website
- Window Component Works In Some Files And Doesnt Work In Others
- On Keypress - Works Fine In The Flashplayer But Doesnt Work In A Browser
- Image Scroller Works But Flash Player Doesnt Like Script
- Embed Flv Doesnt Play After Load, But Refresh Works It : Weird
- Dynamically Generated: Doesnt Recieve Events
- List Component Doesnt Update Dynamically?
- Array.splice Works But Array.slice Doesnt?
- MovieClip Extension Works, But Not Dynamically
- [MX04] SWF Works Fine Until Dynamically Loaded?
- Dynamically Loaded Text WORKS But HTML?
- It Almost Works Dynamically Loads Html And Formats With Css
- Dynamically Seting A Variable ... In MX Eval() No Longer Works :(
- Loading Sound Dynamically, Swf Works But Not Upon Page Load In Browser. :-(
- One Scene Works, Next Scene Doesnt
- Addressing Mc
Button Works, Doesnt Work, Works, Doesnt Work With Each Click
I have this code on a button
on (release) {
gotoAndPlay("smokeleft");
}
that obviously takes the viewer to a frame labled "smokeleft". At that frame there is a stop action and a MC with an instance name of "smokeleftmc"
I've followed this procedure with two more buttons and MC's, smoke and smokeright.
If a button is clicked once, it works perfect. However, if the button is clicked a second time, BEFORE one of the other two buttons is clicked, the play head will not trigger the MC again, rather it will move forward one frame (I assume it would move forward more if there wasn't a stop action).
If the button is clicked once, then a second button is clicked, then the first button is clicked a second time, it works exactly as designed. The only time there is a problem is if one button is clicked twice in a row.
How do I solve this? Thanks
View Replies !
View Related
It Works It Doesnt Work It Works It Doesnt...why?
I wrote a script
it has some variables
I send them as sendAndLoad (url, vars, post) to an Acces DataBase and I get the result back through an ASPX page.
It works fine....on different plattforms, Win xp Win 2000 Mac OS X. on a local machine as well as on the server. And it works fine for the majority of the users I have interviewed.
But apparently it doesnt work on all users machines, despite they have the correct version of the plugin, ie: flash player 7.
Any idea???
Cheers
Shirley65
View Replies !
View Related
Dynamically Addressing Movieclip
i have this on my buttons (movieclips):
on (rollOver) {
name=this._name;
path=this._target;
_root.push (name, path);
}
on the timeline i have the function:
_root.push = function (name, path){
trace(name);
name.gotoAndPlay("over");
}
on rollOver i want to dynamically pass a movieclips name to a function which controls that the movieclip should goto its frame named "over", but i cant get the adressing to work.
if i trace the variable "name" in the example it gives me the moviename correctly. so i guess my syntax is wrong.
the function doesnt work with the path variable either.
i know this might be a stupid question. dont mind me, i'm a noob...
thanks for your help,
antronics
View Replies !
View Related
Dynamically Addressing Movieclip
i have this on my buttons (movieclips):
on (rollOver) {
name=this._name;
path=this._target;
_root.push (name, path);
}
on the timeline i have the function:
_root.push = function (name, path){
trace(name);
name.gotoAndPlay("over");
}
on rollOver i want to dynamically pass a movieclips name to a function which controls that the movieclip should goto its frame named "over", but i cant get the adressing to work.
if i trace the variable "name" in the example it gives me the moviename correctly. so i guess my syntax is wrong.
the function doesnt work with the path variable either.
i know this might be a stupid question. dont mind me, i'm a noob...
thanks for your help,
dual
View Replies !
View Related
Dynamically Addressing Movieclip
i have this on my buttons (movieclips):
on (rollOver) {
name=this._name;
path=this._target;
_root.push (name, path);
}
on the timeline i have the function:
_root.push = function (name, path){
trace(name);
name.gotoAndPlay("over");
}
on rollOver i want to dynamically pass a movieclips name to a function which controls that the movieclip should goto its frame named "over", but i cant get the adressing to work.
if i trace the variable "name" in the example it gives me the moviename correctly. so i guess my syntax is wrong.
the function doesnt work with the path variable either.
i know this might be a stupid question. dont mind me, i'm a noob...
thanks for your help,
dual
View Replies !
View Related
Addressing Different Dynamically Added Movieclips
Hi,
I want to programme a sliding menu. All tutorials I found, so far, are either without AS 2.0 or in AS 3.0 or written OO, i.e. too advanced for my skills.
How it's built up:
Background image and heading are imported from an xml file. Clicking on a menu item, the other menu items are sliding to the closest border.
The problem:
How do I know on which mc I click; how do I tell the other mcs to move; and last but not least,the distance to the border is different, depending on to which border it switches - how to tell the mc?
I want to achieve sth similar to http://ecco.se
The code:
ActionScript Code:
import gs.TweenMax;
import gs.easing.*;
var xmlContent = "content.xml";
var xmlObj: XML;
init();
function init() {
xmlObj = new XML(xmlContent);
xmlObj.ignoreWhite = true;
xmlObj.load(xmlContent);
this.onEnterFrame = checkXMLprogress;
}
function checkXMLprogress() {
var tmpBytesLoaded = xmlObj.getBytesLoaded();
var tmpBytesTotal = xmlObj.getBytesTotal();
if ((tmpBytesLoaded==tmpBytesTotal) && (tmpBytesTotal > 4)) {
delete this.onEnterFrame;
addContent();
}
}
function addContent() {
var mContent = xmlObj.firstChild.firstChild.childNodes;
for(var i=0; i<mContent.length; i++){
var instance = ["bild"]+i;
this[instance] = this.attachMovie("imgContainer","img"+i, this.getNextHighestDepth());
//Create Textfield and add style
this[instance].createTextField("heading_txt", this.getNextHighestDepth(), 700, 50, 200, 50);
var mainHeading:TextFormat = new TextFormat();
mainHeading.bold = true;
mainHeading.font = "ArialBlack36";
mainHeading.size = 26;
mainHeading.color = 0xFFFFFF;
mainHeading.align = "center";
this[instance].heading_txt.border = false;
this[instance].heading_txt.multiline = true;
this[instance].heading_txt.embedFonts = true;
this[instance].heading_txt.background = true;
this[instance].heading_txt.backgroundColor = 0x000000;
this[instance].heading_txt.setNewTextFormat(mainHeading);
//adds the background image
this[instance].image.loadMovie(mContent[i].attributes.url);
//adds the text into the textfield
this[instance].heading_txt.text = mContent[i].attributes.heading;
TweenMax.to(this[instance], 2, { _alpha:95, _x:(i*-40), ease:Expo.easeOut});
this[instance].onPress = function(){
if(this._x > -40) {
this._x == 0;
}
else if(this._x < -39 && this._x > -500) {
TweenMax.to(this, 2, { _alpha:95, _x:-Stage.width+(i*40), ease:Expo.easeOut});
}
}
}
}
the project as download:sliding-menu.zip
Thanks.
View Replies !
View Related
Dynamically Created Mc + Addressing / Event
Hi guys,
does anyone have a tip on how to "bind" events to dynamically created movieclips ?
Code:
public function createClip():Void {
var _images:ImageElement;
var x:Number = 0;
var y:Number = 0;
var _cc:Number = 0;
for (var j:Number = 0; j < _objectArray.length; j++) {
_images = _objectArray[j];
if (_images.get_image_page() == _cpage) {
rootMC.createEmptyMovieClip("images_"+_cc,_cc);
loadMovie(thumb_path + "/" + _images.get_image_thumb(),["images_"+_cc]);
setProperty("images_"+_cc,_x,x);
setProperty("images_"+_cc,_y,y);
["images_"+_cc].onPress = function() {
trace("CLICKED!");
}
_cc++;
}
}
}
Code:
["images_"+_cc].onPress = function() {
trace ("Blah");
}
gives me the following error :
Code:
Unexpected '.' encountered
["images_"+_cc].onPress = function() {
does anyone know how to bind (correct addressing syntax) the onPress function to the dynamically created movieclips ?
thx,
bustaa
View Replies !
View Related
Dynamically Created Mc + Addressing / Event
Hi guys,
does anyone have a tip on how to "bind" events to dynamically created movieclips ?
Code:
public function createClip():Void {
var _images:ImageElement;
var x:Number = 0;
var y:Number = 0;
var _cc:Number = 0;
for (var j:Number = 0; j < _objectArray.length; j++) {
_images = _objectArray[j];
if (_images.get_image_page() == _cpage) {
rootMC.createEmptyMovieClip("images_"+_cc,_cc);
loadMovie(thumb_path + "/" + _images.get_image_thumb(),["images_"+_cc]);
setProperty("images_"+_cc,_x,x);
setProperty("images_"+_cc,_y,y);
["images_"+_cc].onPress = function() {
trace("CLICKED!");
}
_cc++;
}
}
}
Code:
["images_"+_cc].onPress = function() {
trace ("Blah");
}
gives me the following error :
Code:
Unexpected '.' encountered
["images_"+_cc].onPress = function() {
does anyone know how to bind (correct addressing syntax) the onPress function to the dynamically created movieclips ?
thx,
bustaa
View Replies !
View Related
Addressing Dynamically Named, Duplicated Clips
I'm having a problem addressing duplicated clips and setting their ._x properties. I know how to do it when the clips are on the main stage, but when they're in another MC I get messed up.
I have a MC on my main stage called slider. Inside it, during a for loop, I duplicate a MC called thumbTemplate, like so:
for(i=1; i <= numImages; i++){ // numImages is defined elsewhere...
// make names for the duplicates
slider.thumbNailName = "thumbNail" + i;
//make the duplicates
duplicateMovieClip(slider.thumbTemplate, slider.thumbNailName, i);
That works fine. Then I set a variable to determine placement of each duplicated clip:
var xLocationOfNewThumb = //do various calculations
That works fine, too. The problem is how do I address those dynamically named clips so I can set their ._x properties. For clips on the main timeline,this would work:
this[thumbNailName]._x = xLocationOfNewThumb;
But I can't figure out what works for clips in the slider clip, such as:
this[slider[thumbNailName]]._x , or
slider[this[thumbnail]]._x , or various other attempts.
Any help is appreciated.
View Replies !
View Related
[CS3] Addressing Dynamically Created Instances Individually
When an asset is created in the Flash authoring environment, the instance can be given a name using the Properties tab edit field. It's then simple to target that instance using ActionScript, e.g.:
myClip_mc.alpha = 50;
Using ActionScript 2.0, I used the following code to specify a movie clip to remove:
myListener.onMouseMove = function() {
if (dragging == true) {
attachMovie("squareturn", "squareturn1" + level + "_mc", level);
eval("squareturn1" + level + "_mc")._x = _xmouse;
eval("squareturn1" + level + "_mc")._y = _ymouse;
removeMovieClip("squareturn1" + (level - 100) + "_mc");
level += 1;
}
};
I used the unique level of the movie clip to generate its name and later identify it for the removeMovieClip method. My question is, is there a better way to do this in ActionScript 3.0? (I know that the methods and syntax are different in 3.0.)
My example isn't very good, since it just removes any movie clip that is 100 levels "down" from the latest clip. I'm looking for a general purpose way to act on an individual movie clip that has been dynamically instantiated in ActionScript 3.0. What is the easiest way to give a dynamically instantiated movie clip a unique identity so it can be manipulated?
I know that I can use "this" or "target" to identify something that's been clicked on, but I want something more flexible. Maybe everything can be done using these methods and I'm just not used to thinking in 3.0 yet.
Any suggestions would be highly appreciated.
Thanks!
View Replies !
View Related
Addressing Layers Dynamically For Preloading Multiple Movies
I'm building a portfolio site with a row of images that can be clicked to view the full-size image. Because the full-size images are so big, I'm saving each of them as a separate swf, then preloading them into layers 1 - 18. Then, when the user clicks a thumbnail, I simply make the appropriate layer visible and run it's animation. I have that worked out.
Problem...
I need to make my preloader load the images into the appropriate layers one at a time, in order, rather than just starting them all loading at once.
The concept is,
1: test to see if image one has any bytes loaded yet
2: If not, then start loading it
if(thelevel.getBytesLoaded() == null && thepic < 19){
loadMovieNum("http://www.mamasutra.com/rolston/pics/" + thepic + ".swf", thepic);
}else if(thepic == 19){
gotoAndStop(5);
}
3: wait until it's finished and start loading number 2
4: etc
I would prefer to do this with a loop, but can't figure out how to test for completion, because I can't figure out how to write the GetBytedLoaded statement using a variable.
Here's what I tried...
if(thelevel.getBytesLoaded() >= thelevel.getBytesTotal()){
//once this one's loaded, go to the next
thepic ++;
thelevel = "_level" + thepic;
gotoAndPlay(2);
}else{
//trace(thelevel + " loaded = " + thelevel.getBytesLoaded());
prevFrame();
}
Figuring I can test by level number, but this doesn't work. How can I write that statement to test when each one is finished loading?
Thanks
rpossum
View Replies !
View Related
Timer Works... Now It Doesnt
hi everybody,
I got a wierd one for you.
Below you will see the code i have created in order for a stopwatch to count up within a loading environment. This code is within a movie clip that is on the main timeline.
Here's the annoying part. It actually works in one movie, the movie I origninated the code in, but, will not work within an almost identical movie. Ive tested by trying in a new blank movie and it works there.
I am reasonably new to action script, so is there anything obvious i should be looking for. I've checked variable names but i cant think of anything else!!
Thanks for any ideas you may have
minutes = "00";
seconds = "00";
milli = "00";
this.onEnterFrame = function() {
totalTime = getTimer()/1000
goTime = totalTime
minutes = Math.floor((goTime/3600)*60);
seconds = Math.floor(((goTime/3600)*60-minutes)*60);
milli = Math.floor((gotime-(seconds+(minutes*60)))*100);
if (seconds<10) {
seconds = "0"+seconds;
}
if (minutes<10) {
minutes = "0"+minutes;
}
if (milli<10) {
milli = "0"+milli;
}
}
View Replies !
View Related
First Function Works Second Doesnt
Hey, I cannot figure out why this Pause and Play functions are not working... any ideas??
loadMovie("Login.swf", EmptyMC1);
stop ();
//function takes user to Scene 1 when back_Home instance is released.
BtnHome.onRelease = function() {
loadMovie("Login.swf",EmptyMC1);
}
BtnPricing.onRelease = function() {
gotoAndPlay("Scene 2", 20);
loadMovie("PricingMenu.swf", EmptyMC2);
}
//function takes user to Scene 2 when BtnBack instance is released.
BtnBack.onRelease = function() {
gotoAndPlay("Scene 2", 1);
};
//function takes stops play when BtnPause instance is released.
BtnPause.onRelease = function() {
_root.EmptyMC.gotoAndStop(_root.EmptyMC._currentfr ame);
};
//function starts play when BtnPlay instance is released.
BtnPlay.onRelease = function() {
_root.EmptyMC.gotoAndPlay(_root.EmptyMC._currentfr ame+1);
};
//function takes user to Scene 2 Frame 10 when BtnNext instance is released.
BtnNext.onRelease = function() {
gotoAndPlay("Scene2",10);
};
View Replies !
View Related
Saving Works And Doesnt
Hello, I have a kind of....odd situation. I have a game called The Orb 2. And it (when it starts) detects whether or not you have played before. Here is the script:
Code:
stop ();
var save:SharedObject = SharedObject.getLocal("lukeflash_theorb2_data");
playedBefore = save.data.playedBefore;
if (playedBefore){
detector_mc.gotoAndPlay ("2T");
var MusicO:Boolean = save.data.MusicO;
var SoundsO:Boolean = save.data.SoundsO;
var QualityN:Number = save.data.QualityN;
var optionsMusic:Number = save.data.optionsMusic;
var optionsSound:Number = save.data.optionsSound;
var optionsQuality:Number = save.data.optionsQuality;
}else{
detector_mc.gotoAndPlay ("1T");
playedBefore = true;
save.data.playedBefore = true;
var MusicO:Boolean = false;
var SoundsO:Boolean = true;
var QualityN:Number = 3;
var optionsMusic:Number = 2;
var optionsSound:Number = 1;
var optionsQuality:Number = 3;
save.data.MusicO = false;
save.data.SoundsO = true;
save.data.QualityN = 3;
save.data.optionsMusic = 2;
save.data.optionsSound = 1;
save.data.optionsQuality = 3;
save.flush();
}
The part that says whether the person was there or not works. However, later (in options, which is under Extras in the second frame in the attached fla) when u set an option it wont save it! Please check the attached fla and tell me what I am doing wrong.
(The attached FLA has the game and movies taken out of it)
View Replies !
View Related
It Works, It Doesnt Work.?
Hey guys, here is my code. When I use it on a clip in a single frame movie it works perfect.
But when i place it in a movie with say 100 frames it only scales a small amount. Instead of scaling to the full 500px the clip will scale to say...250px. Any idea what I a doing wrong.... I am no genius at this so any help will be appreciated.
Thanks!
here is the code:
onClipEvent(enterFrame){
gofer = (500 - _yscale)
gomer = (gofer / 6)
if(_yscale<=500,_xscale<=500){
_yscale+=gomer;
_xscale+=gomer;
} else if(_yscale==500){
stop();
}
}
View Replies !
View Related
Hittest, Sometimes Works Sometimes Doesnt
Having a weird hit test problem.
I have a game where stuff falls from the sky and you have to catch it in a bucket, when it hits the bucket it adds to the score variable and plays an animation.
Mostof the time it works fine but occasionally it wont play the animation but adds to the score.
I cant figure out whats wrong, any ideas???
Code:
if (_root["apple" + i].hitTest(_root.character.hitArea_mc))
{
_root.character.bucket.gotoAndPlay(7);
if (_root["apple" + i].type == "good")
{
score = score + 1;
trace("good one");
}
else if(_root["apple" + i].type == "good30")
{
score = score + 2;
trace("very good one");
} //end else if
else
{
score = score - 1;
trace("bad one");
if (score < 0)
{
score = 0;
trace("score 0");
} // end if
} // end else if
View Replies !
View Related
Debug Works/Swf Doesnt?
I have a program that I have been working on for the past several months. I have used countless gotoandplay methods in my code and they have worked fine. One of the final steps that I had to do was to put an intro movie in. I placed the frames at the end of the program. On frame 1, it takes you to the end of the program to play the intro, at the end of the intro, it then has a gotoandplay to take you to frame 2 to start the program. The only problem is that when I make the swf (or projector file), it completely skips the intro and stops at frame 3 (even though it goes to frame 2 first and there's a stop there). When I ran the program in the debugger, it works perfectly, like it's supposed to. Why does this happen? Has anyone else run into this? Any help would be greatly apprecaited! Thank you.
Chris
PS I am running flash mx.
View Replies !
View Related
Retrieve Var From A Mc...doesnt Works....
hi!
I have a small problem retrieving a variable from an attach MC. I just create a small mc and I left it in the library with the "linkage name", then I place this in the main time line:
for (var f = 0; f < 10; f++) {
_root.attachMovie("test", "test" + f, f);
_root["test" + f].light="green";
_root["test" + f]._x = 20 * f;
_root["test" + f]._y = 20 + f;
trace(_root["test" + f].light);
}
and it works.BUT,if I place inside the MC "test" this:
var light:String="green";
then I write in the _root this:
for (var f = 0; f < 10; f++) {
_root.attachMovie("test", "test" + f, f);
_root["test" + f]._x = 20 * f;
_root["test" + f]._y = 20 + f;
trace(_root["test" + f].light);
}
I simply get an "undefined".why?
tnx,bye!!
View Replies !
View Related
Offline It Works, Online It Doesnt..... HELP PLEASE
i have applied this action to a button on my site:
on (release) {
tellTarget ("_level0.instance2.downloadspage.pulsedlactualpag e.pulsedlactualpage") {
play();
}
}
all works fine when i preview it, but when i upload it, the target i want it to play doesnt play, its like the action isnt ther at all. so i tried previewing (in MX) with streaming and i got this Output:
Target not found: Target="_level0.instance2.downloadspage.pulsedlact ualpage.pulsedlactualpage" Base="_level0.instance168.downloadspage.instance23 6.tmp_mc"
can someone help please?
thank you
jh
View Replies !
View Related
Reading The Array Works, Then It Doesnt...
hell there...i have this function that is supposed to build a menu:
Code:
//create menu items
rnMenu = new Array("Getting Started", "Starting Your Shift","Working With Basic Patient Information",
"Working With Exisisting Orders", "Working With Stage and Transfer Orders",
"Updating Patient Care Data", "Placing Orders", "Shift Change Procedure");
//build main menu
function mainMenu (whichMenu){
trace (whichMenu);
//set starting point for first menu item
startX = 26;
startY = 57;
//loop through array for menu button labels
for (i=0; i<whichMenu.length; i++){
attachMovie (menuButton, "menuButton" + i, i);
//pull button name from menu array
//and assign it to the dynamic text field
//inside the "menuButton" movie clip
_root["menuButton" + i].buttonText = whichMenu[i];
trace (_root["menuButton" + i].buttonText);
//position menu Items
_root["menuButton" + i]._x = startX;
_root["menuButton" + i]._y = startY;
//update startY for next menu item
startY = startY + _root["menuButton" + i]._height;
}
}
i call it with:
Code:
mainMenu (rnMenu);
the first trace in the function works fine, but when i try the second time it comes back as undefined, and the movie clips arent attaching at all.
View Replies !
View Related
SetFocus Doesnt Works On Browser
Hi everyone!
I need some help, Im making a login animation for a website.
The main movie load the login.swf
Ok, Now.. I just add this to my login.fla
Code:
Selection.setFocus("TextID");
If I run the main.swf and load the login.swf in the main.swf the focus works fine.
But it doesnt works on any browser!!!
Any Ideas?
Thanks,
regards
Carlos Zamora
View Replies !
View Related
SWF Playlist, Works But Doesnt Heeeeelp
ok ive made myself a swf playlist file which will play a list of swf files after loading them into an empty movieclip. at the moment it works fine apart from... when i try and use large files to load (217k) into the main swf it will play the first one and then sit there not doing anything. when i replace the files with smaller ones i.e. 1k it works great, so i guess this is a timing issue somewhere please could you have a peek at it and see if you can help
code
------
There are three frames ,
frame 1
-------
var x = 0;
label = start
frame 2
-------
x=x+1;
label = loadnextmovie
Frame 3
-------
stop();
loadnext();
function loadnext(){
// makes up 'advert1.swf' increments the number.
y = "advert"+ _root.x +".swf";
trace("swf = " + y);
//loads the swf into a empty movieclip on stage called dropzone.
loadMovie(y , _root.dropzone);
checkforend();
}
function checkforend(){
// wait for a bit cos i cant seem to get the totalframes for the movie if i do not put a pause in.
myTimerzero=setInterval(begin,100);
}
function begin(){
clearInterval(myTimerzero);
if(_root.dropzone._totalframes==0){
// if the total frames in the movie are zero (no swf file)
gotoAndPlay("start");
}
trace(_root.dropzone.currentframe);
_root.dropzone.onEnterFrame = function() {
if (_root.dropzone._currentframe == _root.dropzone._totalframes) {
trace("end of movie reached...")
gotoAndPlay("loadnextmovie");
}
}
//just a text box on stage im using for debugging.
p = _root.dropzone._totalframes;
}
-------------------------
Note: I cannot edit the swf files which are being played so it isnt an option to put in code at the end of each of the movies in the playlist.
thank youuuuuuuuuuuu
arran
View Replies !
View Related
Scene Works But Movie Doesnt?
If its not all to obvious I am completely new here and to flash..having sucessfully finally (i think) completing my first scene I have tested and retested and it works fine.. then I went to publish preview to test the "Movie" and it wont play properly.. and I havent the foggiest clue where to begin to find out why or how to fix that. Can anyone give me a starting point on where to begin? TIA
View Replies !
View Related
Testing Locally Works, Otherwise Doesnt...
when i test this locally, it works fine... but when its uploaded to the web, it only loads carousel2_mc..
Attach Code
var current_date:Date = new Date();
if (current_date.getHours()>=12) {
amPm = "PM";
}
if (amPm == "AM") {
carousel_mc._visible = true;
carousel2_mc._visible = false;
} else if (amPm == "PM") {
carousel2_mc._visible = true;
carousel_mc._visible = false;
}
View Replies !
View Related
Load Vars Works On One Server, And Doesnt' On Another
Here is the code:
Code:
projectTitleText.text = _global.projectName.toUpperCase();
loadMovie("renderings/"+_global.projectName+"BG.jpg", "projectBG");
movietrailerBtn._visible = false;
fullvideoBtn._visible = false;
var mtExists = new LoadVars();
mtExists._parent = this;
mtExists.onLoad = function(success) {
if (success) {
trace("Movie Trailer Found")
movietrailerBtn._visible = true;
}else{
movietrailerBtn._visible = false;
trace("No Movie Trailer Found")
}
};
var fvExists = new LoadVars();
fvExists._parent = this;
fvExists.onLoad = function(success) {
if (success) {
trace("Full Video Found")
fullvideoBtn._visible = true;
}else{
fullvideoBtn._visible = false;
trace("No Full Video Found")
}
};
mtExists.load("videos/" + _global.projectName + "MT.txt");
fvExists.load("videos/" + _global.projectName + "FV.txt");
Basically what we are trying to do is find out if a file exists on the server. If it does, reveal (make visible again) the button that will link to this file. If it does not, keep the button hidden.
What happens on the server that doesn't work, is that the movie loads up and then slowly at odd intervals displays the buttons, even though the files we are checking for do not exist. The only place the buttons could become visible is between the sucessful load action.
On the other server it works as planned/coded. If the files exists, they buttons appear, if they don't they stay hidden.
I can't see anything on the server that would be differently setup, but it's possible. The main core features are all the same.
Any reason this should/could be happening? Help is much appreciated. Thanks.
View Replies !
View Related
Send Works Fine SendAndLoad Doesnt
i have followed nwebbs tutorial http://www.nwebb.co.uk/nw_htmlsite/i...ashphp1&part=1
and the first part is a send which outputs the results in a _blank window. the second part is sendAndLoad but i do not recieve a variable back.
i run the swf on one server and access the php file on another - i can see the php file as send works fine, but when i change it to sendAndLoad to get a variable back it fails in the onLoad.
i guess its not the script but something to do with the variable being sent back - the php is fine as per the tute.
any ideas ?
thx
View Replies !
View Related
Help With Code: OnPress Works But OnRelease Doesnt?
my code is listed below. basically, i wrote this code to generate a rectangle that surrounds the movie clip called 'SELECTED' along with a small square that appears at the bottom left corner of the new rectangle.
this new rectangle + tiny square are supposed to act as resizing tool for the movie clip 'SELECTED'. hence, if i press and drag the small square, the mc SELECTED should get resized accordingly. that is happening to some extent, except that when i release the mouse button, neither the onRelease nor onReleaseOutside function gets called.
onLoad = function()
{
pressed = false;
mulx = 1;
muly = 1;
}
onEnterFrame = function()
{
this.createEmptyMovieClip("surround",199);
drawRectangle(surround,SELECTED._width+5,SELECTED. _height+5,0x00FF00,6);
surround._x = SELECTED._x;
surround._y = SELECTED._y;
surround.createEmptyMovieClip("resizer",198);
drawRectangle(surround.resizer,10,10,0x000000,100) ;
mulx = SELECTED._xscale / Math.abs(SELECTED._xscale);
muly = SELECTED._yscale / Math.abs(SELECTED._yscale);
surround.resizer._x = (surround._width/2)*mulx;// + surround._x;
surround.resizer._y = (surround._height/2)*muly;// + surround._y;
surround.resizer.onPress = function()
{
//trace("done true");
pressed = true;
oldx = surround._xmouse;
oldy = surround._ymouse;
}
surround.resizer.onRelease = function()
{
pressed = false;
}
surround.resizer.onReleaseOutside = function()
{
pressed = false;
}
if(pressed == true)
{
diffx = surround._xmouse - oldx;
diffy = surround._ymouse - oldy;
SELECTED._xscale += diffx;
SELECTED._yscale += diffy;
oldx = surround._xmouse;
oldy = surround._ymouse;
}
}
function drawRectangle(target_mc:MovieClip, boxWidth:Number, boxHeight:Number, fillColor:Number, fillAlpha:Number):Void
{
target_mc.lineStyle(1,0x000000,100);
target_mc.beginFill(fillColor, fillAlpha);
target_mc.moveTo(-boxWidth/2, -boxHeight/2);
target_mc.lineTo(boxWidth/2, -boxHeight/2);
target_mc.lineTo(boxWidth/2, boxHeight/2);
target_mc.lineTo(-boxWidth/2, boxHeight/2);
target_mc.lineTo(-boxWidth/2, -boxheight/2);
target_mc.endFill();
}
View Replies !
View Related
Preloader Works, But Component Doesnt Play
Preloaders and I dont mix. I have a .swf with a preloader and a video component. When I test it, the preloader runs through fine, but nothing happens afterwards. My code is the same as on the advanced preloader tutorial for when you have components in your swf.
frame 1
Code:
this.onEnterFrame = function() {
var amountLoaded:Number = this.getBytesLoaded() / this.getBytesTotal();
loadText.text = Math.round(amountLoaded * 100) + "%";
}
frame 2
Code:
if(amountLoaded == 100) {
this.gotoAndPlay(3);
delete this.onEnterFrame;
}
frame 3 is just a stop();
My component is loaded on frame three, but doesn't show up when preloader gets to 100%. its freakin me out. I have gotten the component to play before, but with no preloader, so I think I am OK there. I am uploadeing this .swf into a holder, and that is working too, because the preloader plays through. Let me know if you need more info to help.
thanks for any help and Happy Holidays!
View Replies !
View Related
Submenu-works Fine In Flash-doesnt When Published....
i have a menu system in which i have 3 sub buttons, coming out on rolling over the main button, i have script like on click gotoandplay, my different links of buttons are different scenes...all over i have a movie with main button and sub buttons.......when i play the movie with control-enable simple buttons,,,,it works well..everything runs smooth....but the problem comes when i publish the movie...the sub buttons........stop to respond....all effects do show....but on clicking nothing happens ever.....
PLEASE HELP.........
View Replies !
View Related
_root.play(); Works But Goto Frame Doesnt
In a game _root.death tells me if the player is dead or not.. on the movieclip that generates enemies it has an if statement that says if death==1 then goto frame 2...
For some reason i cannot have a movie clip on the main timeline tell the _root to go to a specific frame, i can only tell it to play();
I have the statement on a onenterframe event....i also tried makeing a function and calling it, nothing happens again, i also tried putting the call to the function on the movieclip's timeline, still same result but if i change the function to play(); it works fine...
is there an easier way to make the _root. go to a specific frame depending on the value of a variable ?
View Replies !
View Related
Mozilla Works Fine, Explorer Doesnt - For My Website
I just tested my new website in two different browsers.
Mozilla shows it perfectly but iexplorer sort of "doubles" the
website so that you have to click away one "layer" get started.
I guess you just have to see it to understand:
www.johnschuette.de
I am a professional illustrator so i dont think it will look very
good to my clients. Therefor it would be great if you could help.
The swf-file seems to work like it is suposed to when i test it.
I made the site very simple. Its just a swf-file inserted inte a dreamweaver 4
document and then its just uploaded to my domain.
Maybe you could look at the html-code?
I dont know html, it would be cool if you could.
its: www.johnschuette.de
Thanks, hoping you can help me.
View Replies !
View Related
Window Component Works In Some Files And Doesnt Work In Others
I successfully made a window component using examples from these forums. I made it in a new document, and the window opens when I press a button with an instance name "myButton". But when I try to implement this script into my existing flash document, it doesn't work. I made a new button and gave it an instance name of "myButton" and imported the window component into the library, but when i click this button, nothing happens. No errors, no action, nothing. Please help me. Thank you
View Replies !
View Related
Image Scroller Works But Flash Player Doesnt Like Script
Ive got this image scroller. It works fine but flash player hates the script and makes my computer run very slowly.
Could someone have a look at it, please? Its very simple. The scroller moves to the left or right depending on what x coordinate is called. When the x coordinate is reached a new movie is loaded. I think the routine for checking when the next movie should be loaded is wrong.
This script is on frame 1. frame 2 loops back to 1;
/*as
startx = GetProperty(_root.info,_x) ;
moved = _root.targetx-startx;
setProperty(_root.info, _x, startx+(moved/9));
//trace (startx);
if (_root.section == "targetx0" & startx == 0){
loadmovie("targetx0.swf", 1);
stop();
}
if ((_root.section == "targetx-471") && (startx == -471)){
loadmovie("targetx-471.swf", 1);
stop();
}
if ((_root.section == "targetx-900") && (startx == -900)){
loadmovie("targetx-900.swf", 1);
stop();
}
if ((_root.section == "targetx-471") && (startx == -470.6)){
loadmovie("targetx-471.swf", 1);
stop();
}
if ((_root.section == "targetx-900") && (startx == -899.6)){
loadmovie("targetx-900.swf", 1);
stop();
}
if ((_root.section == "targetx-1364") && (startx == -1363.2)){
loadmovie("targetx-1364.swf", 1);
stop();
}
as*/
Thank you.
View Replies !
View Related
Dynamically Generated: Doesnt Recieve Events
hi there
i dynamically attach movieclips to another.
the attached mcs are created from an extended MovieClip class.
everything works fine, but when i nest them the the inner ones
dont recieve the onPress event.
even if i dont install one single event handler in the outer containing
mc.
i want the inner movieClips to recieve the events.
the outer one (here called "mc") is just a container to bundle the inner ones.
any idea on how to solve this?
thanks in advance
Code:
var toolText = mc.attachMovie("jkPropsButton", "toolText", getNextHighestDepth());
toolText.jkSetImage("gfx/bt_text.jpg");
toolText.onPress = function() {
trace("proppress");
}
View Replies !
View Related
List Component Doesnt Update Dynamically?
Hi everyone,
Im very new at flash, only been writing stuff for a couple weeks, so maybe there is a simple solution. I have a List component that i use, and it doesnt seem to update its labels dynamically when i change an object in the dataprovider. The code goes like this:
I use a dataprodiver.
var dp:DataProvider = new DataProvider();
mylist.dataProvider = dp;
var myObj:testObj = new testObj("name");
dp.addItem(myObj);
mylist.labelFunction = setLabel;
function setLabel(Obj:Object):String{
return Obj.name;
}
then if I change the object name, it doesnt update the label.
myObj.name = "test 2";
I have even dispatched an event in the in myObj and added a listener so
I can explicitly make the List update label, but I cant find any
function call to make it do that. Driving me insane :)
Please let me know if youve experienced that same., TIA
Edited: 06/08/2007 at 03:00:01 PM by studmanho
View Replies !
View Related
Array.splice Works But Array.slice Doesnt?
This should be simple enough. I have an array of objects, and I want to SLICE a piece of the array and assign it to a new array. All of my attempts have failed. SPLICE works, and I could duplicate my original array into a temp array and splice out what I want, but surely slice is supposed to save me this trouble, right?
I'm a bit baffled, but here's the code:
Code:
private function createGlist() {
var glistObj:Glist = this;
xml_object = new XML();
xml_object.ignoreWhite = true;
xml_object.onLoad = function(success:Boolean):Void {
if(success) {
var i:Number = 0;
for (var this_node = this.firstChild.firstChild; this_node != null; this_node = this_node.nextSibling) {
glistObj.thumb_array.push(new Gthumb(glistObj, glistObj.thumb_array_mc.getNextHighestDepth(), this.firstChild.childNodes[i]));
i++;
}
var load_start:Number = 2;
var load_count:Number = 2;
glistObj.thumb_load_array = glistObj.thumb_array.slice(load_start,load_count);
trace(glistObj.thumb_load_array); //no result, no error
trace(glistObj.thumb_array.slice(load_start,load_count)); //no result, no error
trace(glistObj.thumb_array.splice(load_start,load_count)); //outputs [object Object],[object Object]
} else {
//error
}
}
xml_object.load(xml_url);
}
View Replies !
View Related
MovieClip Extension Works, But Not Dynamically
Hi all -
I'm just learning to create classes and class extensions. I have set up two MovieClip extensions for loading clips that work fully if used as includes but when used dynamically in a swf that is loaded solely as a carrier for class extensions, the automatic clip level creation won't work. Why is this? Here is the code:
Code:
MovieClip.prototype.loadClip = function(identity, instance, x, y) {
var depth = getNextHighestDepth();
var newClip = this.attachMovie(identity, instance, depth);
//
newClip._x = x;
newClip._y = y;
//
return newClip;
};
//
MovieClip.prototype.makeCopy = function() {
var depth = getNextHighestDepth();
var newName = "copy"+depth;
//
return this.duplicateMovieClip(newName, depth);
};
Please feel free to ask for clarification about this. Any help greatly appreciated. Thanks!
View Replies !
View Related
[MX04] SWF Works Fine Until Dynamically Loaded?
Hello
I have created a quiz page that works fine when viewed in its own .swf but it appears to have problems when I dynamically load it into a separate swf as a movie clip. The particular Action scripting I am having a problem with is this:
on (release) {gotoAndPlay(36);
_root.NewQuiz.B.gotoAndStop(36);
_root.NewQuiz.D.gotoAndStop(36);
_root.NewQuiz.C.gotoAndStop(36);
_root.NewQuiz.B.incorrectB._visible = false;
_root.NewQuiz.D.incorrectD._visible = false;
_root.NewQuiz.C.incorrectC._visible = false;
}
The black text works fine in both the regular swf and once it is dynamically loaded but the red text seems to be completely ignored.
I think the problem have something to do that the quiz lies within a movieclip within the .swf and it is somehow conflicting with the how the page is dynamically pulled into the other page, but I am clueless as to why.
Can anyone help?
View Replies !
View Related
It Almost Works Dynamically Loads Html And Formats With Css
Ok this is my fist post so it’s possible I just missed this somewhere but I am dynamically loading html and formatting it with css. That works just fine no problems the issue is with links, I would like to open a new window but it gets killed by the pop up blocker! The issue I believe is that flash is rendering the html and not the browser so the browser isn’t seeing the interaction that triggered the target=”_blank” and kills it. The next logical step is to just use some simple java but unfortunately that gets blocked to. I have tired pretty much everything I can think of and checked the tech notes, forums, and it seems no one has run into this problem. So I am hoping I just missed something obvious or there is a better way to load basic html into flash.
So here is the code:
// Loads HTML and Applies CSS
loadText = new LoadVars();
loadText.onLoad = function()
{
_root.HomeHTML.html = true;
_root.HomeHTML.htmlText = this.HomeText;
}
var format = new TextField.StyleSheet();
var path = "siteStyle.css";
format.load(path);
format.onLoad = function(loaded) {
if (loaded) {
HomeHTML.styleSheet = format;
HomeHTML.text = loadText.load("Home.htm");
} else {
HomeHTML.text = "Error loading CSS file!";
}
};
The Dynamic text box is named HomeHTML and I think the rest is self explanatory.
If anyone has a solution it would be greatly appreciated!
Links:
http://www.jimhunkins.com/test/Main.htm
http://www.jimhunkins.com/test/siteStyle.css
http://www.jimhunkins.com/test/Home.htm
(and yes I know my site is way out of date I’ve been busy!)
Thanks.
View Replies !
View Related
Dynamically Seting A Variable ... In MX Eval() No Longer Works :(
in the old days of Flash 5, you could dynamically set a variable using the eval() function. What am I talking about? - here ...
For example, if I created a movie clip using duplicateMovie() as follows :
Code:
for (i=0; i<playList.length; i++) {
thumbNum = playList[i][1];
duplicateMovieClip("menu.thumbClip", "thumbClip" add thumbNum, i);
}
I could then set a variable (in this case called 'test') to that new clip as follows :
Code:
eval("menu.thumbClip" add thumbNum add ".test") = "toast";
This can no longer be done in MX, and I can find NO documentation on this method ... boo hoo ... any one know how i can do this in MX??
Thanx in advance,
Jamin.
View Replies !
View Related
Loading Sound Dynamically, Swf Works But Not Upon Page Load In Browser. :-(
I have a small little control for volume, stop and play for a background loop for a page. I'm loading an mp3 dynamically, and it works fine when I test the movie or even run the swf in the wwwroot on my server. When I load the page up in my browser though, no sound. Althought the buttons work, and correspond to my animation as you can see in the code, and the page via the link below. Can anyone help??
ps. I've changed the mp3 extension to mpx, just for that download manager workaround.
Webpage Addy: http://2170funhouse.no-ip.org
########## Code in first from of main timeline ############
song = new Sound(loadingMusicClip);
song.loadSound("page_background_track.mpx");
song.start(0, 999);
playing = true;
newPosition = 0;
// play sound if not playing
_root.playButton.onRelease = function() {
if (!playing) {
song.start(0, 999);
playing = true;
_root.speaker.play();
}
};
//stop sound if playing
_root.stopButton.onRelease = function() {
if (playing) {
song.stop();
playing = false;
_root.speaker.stop();
newPosition = 0;
}
};
View Replies !
View Related
One Scene Works, Next Scene Doesnt
have built a demonstration of a medical aparatus -
first half of demo works great - buttons work, action script works, timeline runs normal
in the second half of the demo - buttons works, action script is the same, but the timelines dont run
when the button is released, they do go to the proper scene but stop on the first frame (or whatever frame is scripted)but still does not run
its as if something is preventing the second half timelines from running
I have checked every symbol, every tween, every script on every scene - everything appears to be correct
ANY suggestions - I would greatly be appreciative
View Replies !
View Related
Addressing Mc
I have a mc called "product" on the root which has a dynamic text box in it called "productInfo".
I also have a mc instance called "images" on the root which on keyframes 2,3,4 there are images.
In mc product I have..
if (images._currentframe = 2){
productInfo = "This is 2";
}else {
productInfo = "This is not 2";
}
It will display "This is 2". However, it still displays that even if the _currentframe in "images" is 3 or 4. Can you help?
View Replies !
View Related
|