ActionScript 2.0 :: Array Script Dont Work?
Aug 10, 2006why this array script don�t work?
Code:
submenus = ["sub_menu1.portfolio", "submenu2_.contact"];
for(i = 0; i<submenus.length; i++) {[code]....
why this array script don�t work?
Code:
submenus = ["sub_menu1.portfolio", "submenu2_.contact"];
for(i = 0; i<submenus.length; i++) {[code]....
Im very new to flash and a colleague provided me with perfectly functioning swf presentation. I opened it with flash to make some minor mods and now when i save the pause/play buttons he had put on the presentation no longer work no longer work.
View 1 RepliesIve got this script. when u press a button u can create a movie clip called man. when u press another button u can create one called enemy. thay both create at different sides of the seane and thay walk past each other.but when thay touch each other thay should go to frames inside them. ect Attack,Die.
var mans = 0;
function addman() {
if (Gold>=10) { [code]....
I'm trying to use addChild in a for loop to add lots of copies of one mc, but they are not appearing on the stage.
[Code]...
MyMovie.addEventListener(MouseEvent.CLICK, goClick)
function goClick(e:MouseEvent):void
{
trace("Trololo");
}
It's work. Why don't work?
[Code]...
I am editing an existing application that has three sets of wheels that spin. inside each each wheel are buttons that lead to a second movie layer.this second movie layer is on rollover and on release to show information.after wheel has spun twice the button actions inside the wheel still work but they are the wrong actions for each button symbol..........
prior to the wheel spinning it makes a calculation in a form.would i use movieclips as button symbols? ..
I made a movie that has sound in it being activated and deactivated by using the sound object and linkage id's and it works like a champ.Now i take that movie and load it into another movie like so actNav_mc.loadMovie("test.swf");Now the sounds dont play or work.So just for fun i brought the sound files into the library of my _parent movie and the sounds worked. Since i must have the sounds in the loaded file this is not a viable option. I then tried using the import linkage on an empty mc in the parent movie and it worked but i could shut the sound off.I spent all day on this and as i was typing this thread i found a fix..
View 4 Replieswhen i export this file that have my script to swf flash (Action Script 2.0) Flash 8.0 CRASH but when i run the script under action Script 1.0 work fine. what can i do to fix this problem.. i want to use the script under AS 2.0
[Code]...
I made a movie that has sound in it being activated and deactivated by using the soundobject and linkage id's and it works like a champ.Now i take that movie and load it into another movieike so.....actNav_mc.loadMovie("test.swf");Now the sounds dont play or work.So just for fun i brought the sound files into the library of my _parent movie and the sounds worked.Since i must have the sounds in the loaded file this is not a viable option. I then tried using the import linkage on an empty mc in the parent movie and it worked but i could shut the sound off.
View 5 RepliesI'm fairly new to actionscript and could use some help. I'm using Flash CS3, AS 1/2.I have made a musicplayer that is inside a movieclip, but when i pull the movieclip onto the stage the buttons inside the movieclip stop working.Inside the Movieclip:I have the music start on frame 1 and then gotoAndPlay at frame 3.Frame 3 has a stop();, a button that stops the music and gotoAndPlay "play".Frame 2 has a stop();, a button that plays the music and gotoAndPlay "stop".it all works fine on its own, but as soon as i stick it on the stage it stops working.Labels have been set up fine, it works when i use 'Test Scene'. I've hardcoded all the buttons to work on the timeline frames and not on the buttons.[code]
View 1 RepliesI have made some buttons that call in external swf files and these work perfectly on my own machine when tested in various browsers. My problem is when i upload to the server and then test in the browser, the buttons don't work anymore
View 1 RepliesI made a movie that has sound in it being activated and deactivated by using the sound object and linkage id's and it works like a champ.Now i take that movie and load it into another movie like so actNav_mc.loadMovie("test.swf");Now the sounds dont play or work.So just for fun i brought the sound files into the library of my _parent movie and the sounds worked. Since i must have the sounds in the loaded file this is not a viable option. I then tried using the import linkage on an empty mc in the parent movie and it worked but i could shut the sound off.[code]
View 4 RepliesIm using Flash 8 to make a meny for my webiste. When you point whit the mouse on the meny it will scroll down, and if you take it outside it will scroll back. But im facing a problem When i try to put buttons or linked text into the movieclip, they just wont work... Anyone know what i have done wrong?Here you can download the movieclipHeres the code.
on (rollOver) {_root.html.gotoAndPlay(2);}on (rollOut) { _root.html.gotoAndPlay(7); }
i have a tlf text input in stage,i want dispatch ahndler for this object when enter key in press, but i can't do this
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
import flash.display.Sprite;
tlf.addEventListener(KeyboardEvent.KEY_DOWN,handler);
function handler(event:KeyboardEvent)
[Code]...
okay so what i cant figure out is...(still earning as3)i have these 2 buttons that are nested inside of movie clip........i havent added any code to em yet or nothing....ALL I LITERALLY did was, i have MC-a and went inside it, created 2 button symbols, and tested movie just to see how it'd look but when i rolled over the buttons they didnt work. they dont have roll over/out/press/hit states at all...it acts like its a regular graphic.i took the same buttons, copy/cut/paste on the main stage and work just fine.
View 2 Repliesi have used the following code to upload file which works in php4 server but dont work inphp 5 server.The flash code is as follows:
import flash.net.FileReference;
import gs.TransformManager;
//Allow this domain[code]....
i am uploading the php file.
If I am a subclass of an Array, how do I access an element?
class ArrayOfFoo extends Array
{
public function getFooAt(anIndex : int) : Foo
{
return this[anIndex] as Foo; // <---- looks for an object attribute (named "0", for example)
}
}
I could wrap an array instead of subclassing it, however lacking a universal IArray interface, that is less than useful for standard and custom functions expecting an Array.
Why doesnt my Array work? I get this message:
"Scene 1, Layer 'Actions', Frame 1, Line 83 1067: Implicit coercion of a value of type Array to an unrelated type flash.display:MovieClip."
PHP Code:
var boxArray:Array= new Array();boxArray.push(WallLeft);boxArray.push(WallLeft2);
PHP Code:[code]...
I am a PHP programmer who wants to combine PHP with Flash. I work with Flash 2004 MX.My question is:I have a PHP script who sends a variabel back to Flash named: validI have the folowing code but this does nothing.....it is like the value valid is lost. Flash code:
Code:
oadVariables("../PHP/login.php", "/", "GET");
if (valid=="ok"){
[code].....
Windows XP - Flash CS3: I have a family of fonts installed on my sytem, all Printer Font Metric (.PFM), Flash IDE only shows 2 of the 4 Do I need to use/convert to OpenType fonts for universal compatibility?
View 1 Repliesi will explain my problem according the 11th enemy (the last enemy in the level). i past here the answers i gave to people fron other forums..I'm making a platform game, and i have a problem. i am attaching 11 enemys, and my last enemy not appears. the _X of the 11th enemy is 3300.I tried a lot of stuff, and think, I discovered the source of the problem.on my hero class i wrote this:
_root._x -= (_root._x + (_x - 275)) / 5;
and when i changed it to this:
_root._x = -_x;
the last enemy appears!but i want it to be like first one.but it doesnt work.also, i found that if i placed the hero close to the last enemy, the last enemy appears.the _root._x refer to the stage and the _x refer to the hero.i found that if i remove this code(the gravity in the enemy class):
_y += grav;
grav += gravity;
while(ground.hitTest(_x, _y, true)){[code]....
Im building a preloader queue thingy and i have one big problem.
firstly - the goal of this class is the possibility to add movie clips to the queue that arent yet loaded in by their parent movie clips (which are also in the queue). this is a very important function of this object, and one of the main reasons im coding it.
so - when i pass a reference to a MovieClip Object to my addToQueue function, if the movie clip exists, all is well and good. But if the movie clip happens to be a child of another movie clip that is in the queue, it doesnt exist yet - so the reference returns "undefined" as expected.but very soon into the queue processing function, the child movie clip will come into existance, but unfortunately that doesnt matter cause initially the movie clip wasnt there, so the pointer variable still is set to undefined....
how do i store a pointer to a movie clip that doesnt exist YET but i know will exist? i want to be able to pass a reference to any movie clip in any scope, possibly as a child of many parent movie clips that may or may not exist...is there a sure way to set up a variable to reference a movieclip so i can use it, for example, in loadClip() functions, when the movieclip does actually appear? even if it doesnt exist yet?
All trace functions below work except for the last, buttonSix. The code, unless I'm missing something blatent is exactly the same in each else statement, and the MC is labeled correctly.
Code:
var onStates:Array = new Array(buttonOne, buttonTwo, buttonThree, buttonFour, buttonFive, buttonSix);[code]......
i am very new to xml flash and i have a problem in my code i m making a flash website for my frd and i cant make it work .....i am having problem regarding my coding i have few buttons which says click here but i cant link them. my code is here
xml code:
<?xml version="1.0" encoding="utf-8"?>
<albums>
<gallery id="1" name="MY photos " path="images/">[code].....
I have a strange getURL Problem under some windows installations. I autostart a Flash-projector from a CDROM. This file contains some buttons with getURL. When clicking on the buttons, the browser starts and shows a HTML-file from the CDROM.But under some circumstances this won't work. We have found some Windows-installations where we are not able to start the browser by calling getURL.I know, this seems not to be a Flash problem. It looks like a problem in the interaction from a Flash projector and Windows.
View 3 RepliesI am loading an external swf file. This file contains buttons, text fields etc I am controlling it through a class file. The problem I am having is setting up event listeners for objects that are not yet loaded on the external swf's timeline yet..
Example at the end of the swf i have a next button which is used to load the next swf file.But this next btn only shows up on the file frame, so in the class file if I try to reference it, flash obviously thinks it doesnt exist..
Whats the best approach? I was thinking about using an on enter frame listener to detect when this button is loaded??
i got a dinamic text field wich loads text from 2 diferent file.txt with loadVariable, it works fine on my computer but when i upload to server the text wont show up.[code]
View 3 RepliesI doing one array that will represent the menu, i gotr something like this:
Code:
var menu_label:Array = new Array("Quem Somos", " Servi�os" ," Portflio" , " Infos", "Contactos");
[code]....
I have got no clue why this array just won't work.
Code:
solutions = new Array();
solutions[s0] = new Array();
solutions[s1] = new Array();
[Code].....
I can find in the Adobe's help that masks dont function when dealing with 3d (properties). In this case I stuck on big obstacle in my project,where I wanted to deal with masks, and .z property. I wanted to tween mainMovieClip via TweenLite to make it going away from view.mainMovieClip has mask inside it ( added by the code), and certainly after tween is done mask is unaplied anymore, what is more disgusting functionality for eventListeners (clicks) attached to movieClips behind the mask gone far away. So in the end mask does not work, and everything behind it doesnt too..I need some specialist if my approach to the problem could be somehow a solution. I tried by it doesnt seem to work:I thought that if before tween I would disable the mask, by just setting
mainMovieClip.someMaskHolderMc.mask = null;
and then after tween is done, I could re-set it:
mainMovieClip.someMaskHolderMc.mask = someMasker;
but I end with nothing though, apart of that after tweening I can click once of the areas I had eventListeners before the tween, and then
all functionality disappear. Masks do not work too .