[F8] Pushing The Mcs Away
so,i have this effect i have been asked to do- it's the genie/tsunami effect which we all know from the dock on a mac. i can get the zoom to work well by having mc's react to the mouse position. At present, the mc with the least distance to the mouse will zoom most. but the issue i am having is getting the closest mc's (to the center most mc) to "push" out/away. would love some help with that....
Code: function checkMouse() { for (var g = 0; g<tb; g++) { delete boxA[g].onEnterFrame; boxA[g].onEnterFrame = function() { this.markX=this._x var xC = (this._x)-shell._xmouse; var yC = (this._y)-shell._ymouse; var dist = Math.sqrt(xC*xC+yC*yC); if (dist<300) { this.space = (320-dist)/4; } else { this.space = 50; } this._xscale = this._yscale += this.space-this._xscale/2;
if (this._xscale<100) { this._xscale = this._yscale=100; } }; } }
FlashKit > Flash Help > Flash ActionScript
Posted on: 08-13-2007, 04:24 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Pushing In Arrays
Hi all,
I think this is quick question. Below is a function that I'm trying to get to push new values into an array. It works the first time but then returns an undefined thereafter.
code:
function dollyFunction(target) {
if (functionPass ==0 ) {
var sickBayArray:Array = new Array();
//trace(sickBayArray);
functionPass = 1;
}
var thisTarget:String = target;
trace(eval(thisTarget));
if (eval(thisTarget)._currentframe != 2) {
eval(thisTarget).gotoAndStop(2);
} else {
eval(thisTarget).gotoAndStop(1);
}
var pushVal:String = thisTarget.substring(0,2);
sickBayArray.push(pushVal);
trace("pushVal "+pushVal);
trace(thisTarget.substring(0,2));
trace("the array contains "+sickBayArray.toString());
}
Am I missing something here when using the push method?
Thanks heaps
ss
Button Pushing
Ok when a user clicks on one of my buttons more than once there seems to be a little glitch. The button wont work again the second time when clicked unless the mouse pointer is slighty moved just a little bit to highlight the button again. I want it so that everytime the person clicks the button it works right away even if the mouse pointer is in the same exact position as before.
I hope I explained this so you can understand what my problem is.
Pushing Button
how do you make a button be pushed when you push a button on the keyboard?
Pushing The Movie Up A Bit
hi guys check out my site
www.citycomments.co.uk
ive tried playing about with the publish settings, but how can i bump the thing up a bit so its nearer the top. what should i be editing?
also how can you make it so it fills the WHOLE explorer window. again, i tried stretching and using publishing but it didnt really work
Any help appreciated.
[F8] Pushing/Pulling.
Well... I wasn't sure if I should post this in newbie section because I am a noob or in the regular flash help section, I decided to play it safe and go with the former, obviously.
Anyways I've searched for about an hour and a half, I thought I found a few helpful things but not enough to satisfy my question. Search has failed me ):
I am making a side scrolling-platform sort of story. I have some questions. I hope nobody minds.
1) All right -- Uh, first -- I am curious to a "push" and "pull" sort of command. But it's kind of complex. Think Valkyrie Profile for those who have ever played it. Let's say the key to start is "Z". When pressing Z, I want it to check if there is an object that the character can grab onto. If not it just does nothing.
Now say there is an object. Character presses Z. This will make the Character have the "GrabWait" graphic.
Code:
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.getCode() == 90) {
// GRABBING ON
this.characterMC.gotoAndStop("grabWait");
}
};
Key.addListener(keyListener);
The above is only checking if person pressed Z and the character is grabbing on despite checking if an object is in front of him -- so how to do that?
2) Ok so he's grabbed onto something. I want the Left and Right arrow keys to make him either push or pull. But -- He has to be holding "Z" key all the while, while he holds down left or right arrow to push or pull. If he lets go of Left or right arrow, he will return to "grabWait" graphic. If he lets go of "Z", he will return to regular standing position.
3) Yeah, and the last bit is -- so if he's pushing/pulling, how do you make the object he is pushing/pulling move?
Is this too much to ask? Thanks in advance. I am a freaking noob.
Edit: yeah... and that code is probably wrong |: I don't know how to use that stupid keylistener thing.
Pushing All Buttons
I am creating something where I need a MC to show once all 8 of the buttons on my current frame have been pressed. I am pretty sure you use an array to create it, but I cannot seem to get it to work. any help is appreciated.
So, in a nutshell, no MC until you click all 8 buttons.
P
Pushing My Thumbnails
I have a problem with my thumb gallery. Each thumb gets bigger on rollover and goes back to its original size on rollout. Everything is ok. BUT : each thumb that goes bigger covers all the thumbs that are beside it. I would like to know how to avoid this by pushing the other neighboring thumbs when the rollover is going on. Which kind of code do I have to learn as I am learning the very very very very difficult as scipt.
thank you
Pushing Var To MC And Reload MC
Hey there,
I have two MCs in my FLA. The root level has a button and there is also a container MC on my root level. I want to change the color inside the MC.
root timeline:
Code:
button.onRelease = function(){
container.s1.color = 0x00FF00;
}
Code:
movieclip container:
var color = 0xff0000;
MovieClip.prototype.drawRectangle = function(w, h, color) {
var s:MovieClip = this.createEmptyMovieClip("s1", 1);
s.beginFill(color, 100);
s.moveTo(0, 0);
s.lineTo(w, 0);
s.lineTo(w, h);
s.lineTo(0, h);
s.endFill();
};
drawRectangle(200, 100, color);
I also attached the example. Hopefully there will be someone who understands what I mean...
draw_vars.zip
EDIT: Just forget something. How could I reload the whole container? For example if there is a animation inside the container and I want to reset the animation and start it with a new color...
Pushing The Limits
Hi folks,
We, at Design is Dead, are preparing a pretty ambitious project where streaming video is a key feature.
I already have little experience in video streaming with Red5 and video in general in flash but this time it's gotta be huge so it's necessary to scan the possibilities first.
The two main points I need to know are:
If there is a practical count limit to where Media server can handle live webcam feeds.
How many feeds a flash player, on an average computer, can handle with ease.
Thanks a lot in advance!
Pieter
Pushing On To An Array
I'm just learning how to do an array and am apparently not getting it completely.
I have data from an xml file that I'm loading into my .as file. I need to have each
piece of info pushed onto an array, but I keep getting the following error message:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at XMLLoader/resultsArray()
at XMLLoader()
at Document()
Attach Code
package
{
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class XMLLoader extends Sprite
{
private var electionData:XML;
private var urlLoader:URLLoader;
public function XMLLoader ()
{
var urlRequest:URLRequest = new URLRequest("http://www.kgwcreative.com/election/results.xml");
urlLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, completeListener);
urlLoader.load(urlRequest);
resultsArray();
}
private function completeListener(e:Event):void
{
electionData = new XML(urlLoader.data);
//trace("electionData.toXMLString is " + electionData.toXMLString());
}
public function resultsArray():void
{
var xmlResults:Array = [];
xmlResults.push(electionData[0]);
trace (xmlResults);
}
}
}
Pushing Blocks
hi
im working on a overhead view game where you control the player.
ok so i found this code
Code:
onClipEvent (load) {
posy = _x;
movey = 120;
// move back 120 px
maxy = posy-movey;
// max y movemen
activate = true;
// if move is completed stop checking for hitTests
}
onClipEvent (enterFrame) {
if (activate) {
if (this.hitTest(_root.hero._x-12, _root.hero._y, true) and Key.isDown(Key.LEFT)) {
if (_x<maxy) {
_x = maxy;
activate = false;
}
_x--;
_root.hero.speed = 1;
// slow down hero
}
}
// end activate
}
this works great, but i can only push the box to the left. any idea on how i could push it in all 4 directions, and have it stop once it hits my movieclip??
THANKS!
game
Pushing Onto Array
I'm just learning how to do an array and am apparently not getting it completely.
I have data from an xml file that I'm loading into my .as file. I need to have each
piece of info pushed onto an array, but I keep getting error messages. Here's the
code:
package
{
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class XMLLoader extends Sprite
{
private var electionData:XML;
private var urlLoader:URLLoader;
public function XMLLoader ()
{
var urlRequest:URLRequest = new URLRequest("http://www.kgwcreative.com/election/results.xml");
urlLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, completeListener);
urlLoader.load(urlRequest);
resultsArray();
}
private function completeListener(e:Event):void
{
electionData = new XML(urlLoader.data);
//trace("electionData.toXMLString is " + electionData.toXMLString());
}
public function resultsArray():void
{
var xmlResults:Array = [];
xmlResults.push(electionData[0]);
trace (xmlResults);
}
}
}
I keep getting this error message:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at XMLLoader/resultsArray()
at XMLLoader()
at Document()
any suggestions much appreciated!
Pushing Frames ?
Dear all,
I've just finished my first banner ad and it's looking alright. Problem: it's too fast at the start and I can't slow down the frame rate anymore without making the rest of the movie looking rubbish. Does anybody know how I can "push" frames up (all Layers then I guess too...) so that the movie flows better?
Thanks a bunch,
Gab
Pushing And Dragging Clips
Hi everybody!!
Does anyone of you know how to make a movie clip that is actually been dragged to move a second one like if the first would be pushing the second???
I know it sounds confusing, so here´s what I want:
1) I would like to simulate a man wich moves towards the screen and moves some heavy boxes with his power (wich is set by a variable).
2) I would like to get a friction effect on the boxes.
Thank you very much!
Pushing A Multidimentional Array
Hi,
I am trying to add an Array to an Array, if that makes sence...
myarray [[titel,preis,ID],[titel,preis,ID]];
now, how can I push/add another one like this: [titel,preis,ID]?
myarray.push(??HOWWWWWWWW???);
Does anybody know a very cool, basic, but complete array tutorial?
*BIG* Ticker Pushing The Limits.. (mx)
Hi all,
I've got some challenges in getting flash to do as I want. The project I'm working on is somewhat complicated so i'll give you a proper introduction, the question is at the bottom:
I'm making a fullscreen sized text ticker using multiple computers with tv-sized monitors i dug up when they closed the Stock Exchange Building in our country. These computers are pentium II's running at 233 Mhz and I've got 6 of em in a straight line, hanging on the ceiling in a large bar ;-)
I've been able to scroll text across these monitors by sending each computer the whole text string and it's place in the row (using an XML Socket connection and CommServer, the little brother of Unity).
However, since the speed of the computers is not as high as i would like to (and changing the speed is not an option), when using long text strings with lots of different characters, the computers are too slow too handle the scrolling and start to lag, making the presentation very poor (even at low text quality).
In an attempt to speed things up, i masked my moving dynamic text layer. I figured that the part of the string not on the monitor (the whole string minus about 4 letters(they're really big letters..)) would not be rendered, increasing speed dramatically. However, this didn't produce the desired speed increase.
New (only) option: send each computer (in the row of 6) small text strings (5 chars), place them correctly in a mc, and scroll the mc, append new small string, etc, until all text has been shown.
Now how do I place random length (font isn't fixedwitdh), huge (4-5 chars on entire screen), dynamically generated textfields next to each other so you can't see they're not one textfield?!
If you can help me with that, then I've got a working application.
Pushing Objects Into Arrays
I've got an array of objects...a list of quiz questions in the format:
Code:
current_category_questions[i]={question:"question text",
answer1:"answer 1 text", answer2:"answer 2 text", answer3:"answer3 text",
answer4:"answer 4 text",rationale:"rationale text"};
I'm trying to push these questions into a new list of questions. Do I need to initialize an array element as an object before I add an object to it, or can I just push the value like so?
Code:
current_quiz.questions.push(current_category_questions[i]);
I've tried this already and it doesn't seem to work, but I feel like it should. I do this in PHP all the time, can actionscript handle it? Is there some trick to make this work?
Pushing The Envelope: IM In Flash
thought I share this with all of you: first ever ICQ compatible flash Application
http://www.livepros.com/site/default...in&skinID=icq1
let me know what you think, you will need to have ICQ account to log in.
Dan
[F8] Pushing Objects With The Mouse
I am trying to get the mouse pointer to push around objects on the stage. The only good way I can see to do this is to give the pointer an object to represent its mass and velocity in order to calculate the momentum, etc., for the collision.
So I would need to make a pointer move toward the mouse using acceleration (I guess) so that it keeps its velocity even when the mouse stops moving.
How do I do that?
Or is there a better way to approach it?
-Zippy Dee
Ted Newman
Pushing XML Values Into An Array...
I need to push values from an XML file into the array. The problem is there may be 2-6 possible values... for example:
Code:
<options>
<option1>here's the first one</option>
<option2>here's the second one</option>
<option3>here's the third one</option>
</options>
but there could be 2, 4, 5, 6, etc. options in the <option> area.
I'm using this tutorial to create a quiz, but modifying it to load the data from XML: Create a Quiz Application Using AS3 Classes
In the tutorial the quiz pieces are pushed into an array like so:
Code:
quizQuestions.push(new QuizQuestion("What color is an orange?",
1,
"Correct",
"Incorrect",
"Orange",
"Blue",
"Purple",
"Brown"));
The first 4 things are easy to push in from my XML document:
Code:
quizQuestions.push(new QuizQuestion(quizXML.quiz.items.question[i].question,
currentCorrectAnswer, //CORRECT ANSWER
quizXML.quiz.items.question[i].correctFeedback,
quizXML.quiz.items.question[i].incorrectFeedback
//CHOICES SHOULD GO HERE
));
But I don't know how to push the choices into the array because it could be as many as 6 to as few as 2... how would I go about this? I don't need exact code, just an idea, but code can help for an example...
Pushing Arrays From XML Data
I have written the following XML file to incorporate 3 image galleries as such.
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<gallery>
<bkOne url="bookOne/food_001.jpg" />
<bkOne url="bookOne/food_002.jpg" />
<bkOne url="bookOne/food_003.jpg" />
<bkOne url="bookOne/food_004.jpg" />
<bkOne url="bookOne/food_005.jpg" />
<bkOne url="bookOne/food_006.jpg" />
<bkOne url="bookOne/food_007.jpg" />
<bkOne url="bookOne/food_008.jpg" />
<bkOne url="bookOne/food_009.jpg" />
<bkOne url="bookOne/food_010.jpg" />
<bkOne url="bookOne/food_011.jpg" />
<bkOne url="bookOne/food_012.jpg" />
<bkOne url="bookOne/food_013.jpg" />
<bkOne url="bookOne/food_014.jpg" />
<bkOne url="bookOne/food_015.jpg" />
<bkTwo url="bookTwo/food_001.jpg" />
<bkTwo url="bookTwo/food_002.jpg" />
<bkTwo url="bookTwo/food_003.jpg" />
<bkTwo url="bookTwo/food_004.jpg" />
<bkTwo url="bookTwo/food_005.jpg" />
<bkTwo url="bookTwo/food_006.jpg" />
<bkTwo url="bookTwo/food_007.jpg" />
<bkTwo url="bookTwo/food_008.jpg" />
<bkTwo url="bookTwo/food_009.jpg" />
<bkTwo url="bookTwo/food_010.jpg" />
<bkTwo url="bookTwo/food_011.jpg" />
<bkTwo url="bookTwo/food_012.jpg" />
<bkTwo url="bookTwo/food_013.jpg" />
<bkTwo url="bookTwo/food_014.jpg" />
<bkTwo url="bookTwo/food_015.jpg" />
<bkTwo url="bookTwo/food_016.jpg" />
<personal url="personal/pers_001.jpg" />
<personal url="personal/pers_002.jpg" />
<personal url="personal/pers_003.jpg" />
<personal url="personal/pers_004.jpg" />
<personal url="personal/pers_005.jpg" />
<personal url="personal/pers_006.jpg" />
<personal url="personal/pers_007.jpg" />
<personal url="personal/pers_008.jpg" />
<personal url="personal/pers_009.jpg" />
<personal url="personal/pers_010.jpg" />
<personal url="personal/pers_011.jpg" />
<personal url="personal/pers_012.jpg" />
</gallery>
My aim is to create (push) 3 arrays for each of the "galleries" in this XML file. Here is my attempt, which is not working. Anyone know what I'm doing wrong here?
Code:
var feedXML = new XML();
feedXML.ignoreWhite = true;
var bkOneUrls:Array = new Array();
var bkTwoUrls:Array = new Array();
var personalUrls:Array = new Array();
var whoIsOn:Number;
feedXML.onLoad = function(success) {
var photos_bkOne:Array = this.firstChild.childNodes.nodeName[bkOne];
for(i = 0; i < photos_bkOne.length; i++) {
bkOneUrls.push(photos_bkOne[i].attributes.url);
}
var photos_bkTwo:Array = this.firstChild.childNodes.nodeName[bkTwo];
for(i = 0; i < photos_bkTwo.length; i++) {
bkTwoUrls.push(photos_bkTwo[i].attributes.url);
}
var photos_personal:Array = this.firstChild.childNodes.nodeName[personal];
for(i = 0; i < photos_personal.length; i++) {
personalUrls.push(photos_personal[i].attributes.url);
}
holder.loadMovie(bkOneUrls[0]);
whoIsOn = 0;
trace(photos_bkOne.length);
}
feedXML.load("images.xml");
Thanks / help appreciated
Pushing New Videoclip Into Ns.play?
Hey all,
Im currently trying to modify Lee Brimelows videoplayer, however im not quite sure how to achieve what im looking for and need suggestions. I'm looking to have 3 different movieclips. Lets say
var movie1:String = "http://www.link_to_movie_clip1";
var movie2:String = "http://www.link_to_movie_clip2";
var movie3:String = "http://www.link_to_movie_clip3";
As default, Movie1 will run in the window.
Each movieclip will be attached to an individual movieclip(button), and when i click button 1, then movieclip1 will load etc.
Currently the loaded movieclip is defined within:
ns.play("VARIABLE_TO_MOVIECLIP");
So guess I need to make a listener for each button, and within each of the listeners, define vars for the movieclips. Then make the EVENT listening for clicks, and when clicked, push the new movie into ns.play??
I'm pretty new to Flash, so any examples, suggestions or whatever would really be appreciated
Pushing A Xml Node Into A New Array
Hello.
I am trying to store a xml nodes childrenNodes values into a duplicated movieClip, it works...almost, unfortuantely it's not storing all of the info in the node. If you can help that would be awesome-O.My code looks like this:
ActionScript Code:
for (i=0; i<Object.workNode.childNodes.length; i++) {
this["clone"+i].myJoin = new Array();
this["clone"+i].myJoin.push(Object.workNode.childNodes[i].childNodes[i].attributes.Name);
}
Pushing To An Array With A Function
Hi all,
I'm having problems pushing element to an array within a function. The first time i press the button it works fine. The problem is occuring if i press the another button, what it is doing is replacing the first item instead of adding it to the Array that was already created. Here is the code that i'm using:
PHP Code:
btn_1.onRelease = function(){
correctAnswer(this);
}
btn_2.onRelease = function(){
correctAnswer(this);
}
//it the answer is correct
function correctAnswer(btn_clip){
btnAdded = new Array();
//
btnAdded.push(btn_clip);
trace("btnPushed="+btnAdded);
//
}
Thanks,
Jake
Pushing XML To Multiple Swfs
I was wondering if you could point me in the right direction... or any direction.
I'm updating a flash player some other guys built, it's in good shape but the functionality that my client wants me to add seemed easy at first but turned into a *nice* little puzzle. What I'm trying to do is a "reverse" xml load. Reverse because the way I've done it is have flash load an xml and parse it within the swf. But this one is the reverse of that. Basically I have multiple swfs that need to be dynamically populated by one xml file. Each swf (the same .swf) needs different text and images.
Does this make sense? I can see trying to do it a number of ways but their all leading to dark tunnels I don't know if I can get out of.
Wondering if you could shed any light.
Best,
Jackson
Pushing To Multidimensional Array.
Can anyone help me with the correct syntax for pushing variables to arrays within arrays? I have searched many threads but found nothing that exactly answers my query.
I have a class (Brigade) which amongst other variables contains an array (BrigadeUnits) This is the third element.. My Brigades are stored in an array called AllBrigades. I now need to fill the BrigadeUnits array with objects of my Units class.
The hierarchy I want to create is as follows:
AllBrigades (array of Brigades)
Brigade (object)
BrigadeUnits (array within Brigade object)
Unit (Object to be stored in BrigadeUnits array)
I hope this makes sense!
I have tried various approaches including the following, assuming that I am addressing the first Brigade in the array:
AllBrigades [0] [2].push (MyUnit);
But when I trace this I just get undefined.
Where am I going wrong?
Pushing And Popping An Array
I have two buttons, one that adds a ball to an array and displays it and one pops a ball from the array and removes it from the display list, the add button works fine, however when i push the subtract button I get this message ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
Here is my code, thanks:
var iconArray:Array = new Array();
var ball:Ball;
var icon_count:int = 0;
add_btn.addEventListener(MouseEvent.CLICK,startAdd );
sub_btn.addEventListener(MouseEvent.CLICK,stopAdd) ;
function startAdd(evt:MouseEvent){
addBall(1);
}
function stopAdd(evt:MouseEvent){
subBall(1);
}
function subBall(num_ball:int){
add_btn.removeEventListener(MouseEvent.CLICK,start Add);
for(var i:int = 0; i < num_ball; i++){
iconArray.pop()
removeChild(ball);
trace(iconArray);
}
}
function addBall(num_ball:int){
for(var i:int = 0; i < num_ball; i++){
ball = new Ball();
iconArray.push(ball);
trace(iconArray);
addChild(ball);
ball.x = icon_count * 100;
ball.y = 100;
icon_count++;
}
}
Pushing To Multidimensional Array.
Can anyone help me with the correct syntax for pushing variables to arrays within arrays? I have searched many threads but found nothing that exactly answers my query.
I have a class (Brigade) which amongst other variables contains an array (BrigadeUnits) This is the third element.. My Brigades are stored in an array called AllBrigades. I now need to fill the BrigadeUnits array with objects of my Units class.
The hierarchy I want to create is as follows:
AllBrigades (array of Brigades)
Brigade (object)
BrigadeUnits (array within Brigade object)
Unit (Object to be stored in BrigadeUnits array)
I hope this makes sense!
I have tried various approaches including the following, assuming that I am addressing the first Brigade in the array:
AllBrigades [0] [2].push (MyUnit);
But when I trace this I just get undefined.
Where am I going wrong?
PROBLEM WITH KEY PUSHING ON MOVIECLIP EVENT
On the main timeline of my flash movie I have a text field with the variable name of the text field called: "totaltime".
I also have a movieclip on the main timeline, the action/s assigned to this movieclip are as follows:
onClipEvent (keyDown) {
if (Key.isDown( Key.SPACE )) {
timeonpress = getTimer();
} else {
released = getTimer();
totaltime = (released-pressed)/1000;
}
}
What Im expecting it to do, is get the time the flash movie has been playing for at the point of pressing a key (timeonpress), then also get the time the movie has been playing on the release of the key (released).
Finally by subtracting these two values and dividing by 1000 to get the time in seconds, I was hoping to get a value of how long I have held the key down for.
But guess what, no cigar, nothing in the text field. Can anyone help?
Loading Var Textfile When Pushing Next Button
I've got a script wich loads the next picture from the server into my
my flash-movie. Now I would like to load the according text from a variable text-file on the server.
is there any alike script wich can handle this?
if (wimg eq 23) {
wimg = wimg;
url = 'image/'+img+'1.JPG';
play();
} else {
wimg = wimg+1;
url = 'image/'+wimg+'.JPG';
play();
}
loadMovie(url, "bitmap");
Thanks in advance.
Bert.
Pushing Items Onto An Array And Them Staying There
Hey ppl,
Im learning actionscript and im doing a simple translator that will also allow you to add words. I have a couple of arrays, one for the english and one for the translation.
I am using the push command to insert the contents of an input text box into the array which, when traced, does work, however, when i return to the main menu (backwards in the timeline) it will not remain in the array?
Is there some fundamental that im missing here (wouldnt suprise me!)
Thanks, in advance for anyone who can help.
ANdy
[F8] Flash Banner Pushing Down Webpage?
Hello,
Can anyone point me in the right direction as to how to make those flash banners that start off large and shrink when done, moving the entire webpage up below it... as seen on http://www.nfl.com
Also, I would like the same for the flash advertisements that you see animated over webpage content, something similar to those ads you may see fly from the left side of the screen and fly over the page content and exit screen right.
Thanks for any help, very much appreciated!
[F8] Pushing Data To An Array Then To DataGrid
i want to push the data that is entered by the user in Input text
in the datagrid
i'm using an array to push the data in, and then enter the data into the datagrid
this script in the first frame
PHP Code:
var myDataGrid:mx.controls.DataGrid;
myDataGrid.addColumn("Username");
myDataGrid.addColumn("score");
var myDP_array:Array = new Array()
myDataGrid.dataProvider = myDP_array;
script in button
PHP Code:
on (release)
{
myDP_array.push({Username:Std_txt.text,score:score_txt.text});
}
it doesnot work
Pushing Elements Into Arrays Not On Same _level?
I have an swf that loads other swfs into higher levels than 0. Within those swfs I have buttons that push mp3s into their own array -
I'd like to be able to put a master array on the main level 0 swf so I can push elements into that array even from swfs on a different/higher level -
is that possible, or are arrays strictly inter-swf and not intra-swf?
I've tried using the _global. and _root. prefixes on arrays but I must not be doing something right
Lets say I use this code on a button in an swf on _level10:
MyArray.push("Sound01.mp3");
and I have this play code in the _level0 swf that I use to play the contents of MyArray:
PlayArray.loadSound(MyArray[(now++)%MyArray.length]);
PlayArray.start();
PlayArray.onSoundComplete = function () {
if (now == MyArray.length) {PlayArray.stop();}else {
PlayArray.loadSound(MyArray[(now++)%MyArray.length]);
PlayArray.start();
}
- is it possible to push elements from _level10 into the array in _level0?
Pushing Information To Flash Client
I am wanting to create a Flash client using AMFPHP which should be constantly receiving data pushed to it from a server. I have seen the paradigm of request/response in action script but I was wondering about how to set up Flash to receive a continual data stream back from a server. Any suggestions would be most welcome.
Pushing Multiple Movieclips In An Array
my problem is simple... i have a lot of movieclips in the library, all of then are exported and have similar class names (class1, class2,...). to insert those movieclips in the array i use:
array.push(new class1());
but i dont want to make that for every single movieclip.
i even tried using a for function with a string to generate the of the movieclip but it was hopeless from start. (knew that strings wouldnt work, it was just a desperate guess).
So... is there anyway to do it?
Movie Clones Are Pushing My Buttons
I have a movie named "camp" in which a dynamic text serves as a button, the textfield variable is named "campone".
Now I need to have 7 instances of that movie but I also want to save space, so I used duplicateMovieClip(). Everything works, except, that all the buttons have the same name ( which I don't want ) :
tmi = "7";
menu0 = "Name_1";
menu1 = "Name_2";
menu2 = "Name_3";
menu3 = "Name_4";
menu4 = "Name_5";
menu5 = "Name_6";
menu6 = "Name_7";
while (Number(n)<Number((tmi*2)-1)) {
n = Number(n)+1;
dup = "camp" add n;
duplicateMovieClip("camp", dup, n);
if ( n < 7 ){
this["camp" add n].campone = this["menu" add n];
}
else {
this["camp" add n].campone = this["menu" add (n-7)];
}
setProperty(dup, _x, Number(getProperty(dup, _x))+Number(n*getProperty(dup, _width)));
}
( I've tried replacing this["camp" add n].campone by campone but this changes all the button's name to Name_7 )
If anybody knows a way to use dynamic texts as buttons, duplicate them with AS and give each of them a different text/content... please save a poor soul from brain masturbation.
Trouble Pushing Some Code Into An Array
Hi,
I’m trying to create an xml-based slideshow in flash and am having trouble pushing some code into an array.
The following is an extract showing how my xml file is structured:
Code:
<slideshow>
<garment url="formal01.jpg">
<title>Classic Design Formal Suit</title>
<style>5993</style>
<description>Olorperat illaor sim dio od dolore velit atie modiatem adio et ipit praesectem erit, vel ipsuscip er sit velit ipisciduis nulla.</description>
<price>$???</price>
<colours>Black</colours>
<sizes>87cm to 152cm</sizes>
</garment>
<garment url="formal02.jpg">
<title>Another title goes here</title>
<style>5994</style>
<description>Olorperat illaor sim dio od dolore velit atie modiatem adio et ipit praesectem erit, vel ipsuscip er sit velit ipisciduis nulla.</description>
<price>$???</price>
<colours>Black, White</colours>
<sizes>87cm to 137cm</sizes>
</garment>
</slideshow>
The urls are stored as attributes within the garment tag and the rest of the caption is stored with separate tags nested within the garment tags:
In my .fla file I have the following code:
Code:
var ssx:XML = new XML();
ssx.ignoreWhite = true;
var currentIndex:Number = 0;
var captions:Array = new Array();
var urls:Array = new Array();
ssx.onLoad = function(success) {
if (success) {
var ss:Array = ssx.firstChild.childNodes; //stores pictures as separate elements
for (i=0;i<ss.length;i++) {
urls.push("images/" + ss[i].attributes.url);
captions.push(ss[i].childNodes[0].firstChild.nodeValue);
}
frame_mc.images_mc.loadMovie(urls[currentIndex]);
captions_txt.htmlText = captions[currentIndex];
}
else
{
trace("XML file failed to load.");
}
}
ssx.load("formalwear.xml");
With the for loop I'm trying cycle through the ss array, pull out the url attributes as well as the rest of the caption, and assign the values to the arrays called "captions" and "urls".
Since my url was stored as an attribute, the following line of code works to push the url into the urls array:
urls.push("images/" + ss[i].attributes.url);
...however, the captions line entered as follows doesn’t push the captions into the captions array:
captions.push(ss[i].childNodes[0].firstChild.nodeValue);
It only outputs the information contained in the <title> tag, ie. Classic Design Formal Suit
Since the caption isn't stored as an attribute, I assume I need the following code to be pushed into the captions array, but I don’t know how to do it.
Code:
var caption:String = ""
caption += "<b>"
caption += ss[0].childNodes[0].firstChild.nodeValue;
caption += "
</b>";
caption += "<b>Style Number</b>
"
caption += ss[0].childNodes[1].firstChild.nodeValue;
caption += "
";
caption += "<b>Description</b>
"
caption += ss[0].childNodes[2].firstChild.nodeValue;
caption += "
";
caption += "<b>Price</b>
"
caption += ss[0].childNodes[3].firstChild.nodeValue;
caption += "
";
caption += "<b>Colours</b>
"
caption += ss[0].childNodes[4].firstChild.nodeValue;
caption += "
";
caption += "<b>Sizes</b>
"
caption += ss[0].childNodes[5].firstChild.nodeValue;
Can someone tell me how I can fix the code?
Appreciate any help offered.
Pushing Buttons Inside ScrollPane ?
Hello,
I used this tutorial http://www.kirupa.com/developer/flas...dynamic_mc.htm
and it is working fine but if i put a button inside the attached movie clips
it cannot be pushed!!!!!
Can someone help me please?
Thanx in advanced
Pushing Text Into An Array With A Button
I have an array called lotr that is being displayed into a textfield. I've created an input textfield and a button to allow users to add to the array. My script looks like this:
Code:
addto_btn.addEventListener(MouseEvent.CLICK, lotrAdd);
function lotrAdd(event:MouseEvent):void {
var lotrNew:String = myvalue_txt.text;
lotr.push(lotrNew);
trace(lotr);
}
The output window shows new values, but the values don't get updated in the textfield. Is there such a thing as an update or refresh command for the player?
Thanks.
Trouble Pushing Code Into An Array
Hi,
I’m trying to create an xml-based slideshow in flash and am having trouble pushing some code into an array.
The following is an extract showing how my xml file is structured:
CODE<slideshow>
<garment url="formal01.jpg">
<title>Classic Design Formal Suit</title>
<style>5993</style>
<description>Olorperat illaor sim dio od dolore velit atie modiatem adio et ipit praesectem erit, vel ipsuscip er sit velit ipisciduis nulla.</description>
<price>$???</price>
<colours>Black</colours>
<sizes>87cm to 152cm</sizes>
</garment>
<garment url="formal02.jpg">
<title>Another title goes here</title>
<style>5994</style>
<description>Olorperat illaor sim dio od dolore velit atie modiatem adio et ipit praesectem erit, vel ipsuscip er sit velit ipisciduis nulla.</description>
<price>$???</price>
<colours>Black, White</colours>
<sizes>87cm to 137cm</sizes>
</garment>
</slideshow>
Playing A Movie Clip By Pushing A Button?
iv posted this.. twice now, sorry for bothering. but ill explain myself better this time. I need to play a movie clip by pushing a button. I got some code that did this with another movie, so i just kinda transfered it over to mine. this is what it is.
on(release){
_parent.gotoAndStop("patmov");
}
it doesnt seem to work, and i cant figure out why. the link to the fla is http://wishforunity.tripod.com/Freinds/mainf.fla
thanks for all the help
StartDrag Movement By Pushing In A Corner Of A Specified Area
Hello,
I'm having a bit of a problem and really hoping somebody could help. I have a movie clip under a mask that I'm dragging so that only portions of it are visible. So far I'm dragging it by inversing the direction of the mouse cursor. Unfortunately, this requires a lot of movement on the whole stage because the graphic I'm dragging is very big.
What I need to do is keep the movieclip moving by just continually pointing in a corner of a specified rectangle. This is basically the same function that any image program has (ex. photoshop) to keep pushing the visible boundaries when the curser has moved in a certain direction.
Can somebody please help?
Pushing Values From Text Field Into Array
Hello everybody!
Please help! I created dynamically a text field. If the user types a number to it and clicks on the button, it generates other x (number) text fields. Now the user should fill these fields with numbers too. What I would like to get: I want to get the numbers from these fields and put them into array, like the number from first field should be on position [0], from the second field on position [1] and so on. This is the part of the code, where the 2nd level fields are generated:
code:
for (var i = 1; i<=number_input_1stfield; i++) {
_root.createTextField("varValues"+i, 1000+i, 400, 20*i, 20, 20);
_root["varValues"+i].border = true;
_root["varValues"+i].borderColor = 0x000000;
_root["varValues"+i].background = true;
_root["varValues"+i].backgroundColor = 0xFEF9C2;
_root["varValues"+i].type = "input";
_root["varValues"+i].variable = "ar"+i;
myArray.push(WHAT TO WRITE HERE???);
}
How can I put the value of each field into an Array? I simply can't figure it out!
Any help greatly appreciated! Thanks a bunch!
Poco
Java Pushing Data To Comm Server
I have a dilemma. Flash Com Server is great for Push architectures. In fact, timely retrieval of information is what it was designed for. However, there is a problem that I do not have the answer to. With Flash Remoting you can make use of Java Classes, Servlets, etc. But this is over HTTP so you can only Poll (meaning query the server at intervals). Combine Flash Communication Server with Remoting and you have Flash Comm Server Remoting. Great, now we can push data that is in AMF (Action Message Format) to the client as opposed to having them Poll. I like this so far.
My problem arises when I want to have JAVA trigger the push via the Comm Server. So that means Java must be able to randomly either A) Add to the SharedObject so that all movies update or B) Tell the server Side Actionscript to update (I.e. call a ActionScript method)...
Any takers? Macromedia people?
Authentication For Pushing Live Streams To FMS3
Hi there, I have setup FMS3 and use it to test my live streaming. But I was wondering is it possible on the FMS to setup an application for live stream, so that it checks for authentication before accepting the live stream for broadcast? What I mean is if I create a live application on FMS, anyone who knows this application name would be able to push the stream to FMS. Can FMS control this with a username and password? Thank you.
Previous Stage Open/close..when Pushing New Button
hi ,
what i finally want
on the main stage, i have 4 submovies (sections) , they are very narrow next to each other. i want them to "roll out/on" at the screen when choosing one of them... kinda like a stage-curtain that gets pulled down and pulled up again...
the thing is that i don't know how to do it if you have several buttons, lets say 4 in total, if you push button 1, curtain 1 opens and movie 1 plays, but if you go to button 3, how do you make it in that way, that curtain 1 (so movie 1) gets pulled down again, and after that movie3/curtain 3 gets opened up.....
are you with me here?
greetz
|