MotioTween Efect With ActionScript?
Hello! I was wondering how could I make an effect like the one found on http://www.subblue.com/home.php on the "portfolio" section. Not all the interface, just look how the marquee changes its size when you click on a project. I suppose you use something like xscale or something, but the effect is like a motion tween, not like a skip from one frame to another. I just want to change the size of a graphic with one click, but from varios buttons so the graphic can change its size a few times, pretty much like the marquee on subBlue.com, you know, like a Motion Tween.
I will really appreciate any help!
P.S. Sorry about my english!
Any sample movie will work great!
FlashKit > Flash Help > Flash ActionScript
Posted on: 11-02-2004, 10:00 PM
View Complete Forum Thread with Replies
Sponsored Links:
Glass Efect
Hello,
i have an image on flash. I inserted a white rectangle on top with an 60% alpha...it looks fine but it doesn't look exactly like a glass.
I saw in a web site something like this but it seemed the white part had some kind of simple texture which seemed like glass...
Could u help me with this...i think i have to do more then alpha=80%.
Thanks,
Miguel
View Replies !
View Related
Glass Efect?
can some one tell me were to find a glass efect tutorial?!?!?
my skills in design are lousy so i need to see how it's done... i done it in photoshop, but wen i save it as a .jpeg it looses the transparancy....
i search already by the so called "normal ways" but i couldn“t find nothing... can someone help me?!?!?
View Replies !
View Related
Flash Efect
HEllo, I am looking to create the flash effec on this banner located here.
http://csmt.uchicago.edu/glossary2004/abstraction.htm
If anyone could help me, it would be appreciated.
View Replies !
View Related
Glass Efect
can some one tell me were to find a glass efect tutorial?!?!?
my skills in design are lousy so i need to see how it's done... i done it in photoshop, but wen i save it as a .jpeg it looses the transparancy....
i search already by the so called "normal ways" but i couldn“t find nothing... can someone help me?!?!?
View Replies !
View Related
Help With Text Efect
Hello I have a menu that I am working on ...everything is ok exept for the movement...you see when it moves the text is looseing quality . The movie is at 30 Fps. Is there any way to make it not loose quality ...or to lose less quality that it allready does. For movement I used motion tween (is this the problem ?)
Any help would be very usefull.
Tnx Cata
View Replies !
View Related
Shadow Efect
I“m making a mask effect to some pictures.
How do I make a drop shadow effect to the outline of the mask? No just a transparent shadow, but a blured shadow.
thanks any comments
View Replies !
View Related
Glass Efect
can some one tell me were to find a glass efect tutorial?!?!?
my skills in design are lousy so i need to see how it's done... i done it in photoshop, but wen i save it as a .jpeg it looses the transparancy....
i search already by the so called "normal ways" but i couldn“t find nothing... can someone help me?!?!?
View Replies !
View Related
Help With Text Efect
Hello I have a menu that I am working on ...everything is ok exept for the movement...you see when it moves the text is looseing quality . The movie is at 30 Fps. Is there any way to make it not loose quality ...or to lose less quality that it allready does. For movement I used motion tween (is this the problem ?)
Any help would be very usefull.
Tnx Cata
View Replies !
View Related
AMAZING Efect - How To Do It?
http://www.mini.com.pl/
HOW TO DO IT? What i mean is the amazing effect of shining things. Is it a mask? Can anyone help me out on this one?
Also the scrolling images, the little blur efect while they are moving - any idea how to make it so smooth?
thanks
View Replies !
View Related
Spectrum Efect On A Sound
Greetings.
I was taking a look at the wonderful Flashkit's tuturials, and saw one that particularly interesested me : here
This is a great tuturial, but it uses an imported wav sound to play, I wanted to do the same effect with an external ".mp3" sound, so that the .swf wouldn't got too big.
But I don't seem get to work with it, (the spectrum stays still) could you give me any tip? I would be very glad!
Thanks for your support!
View Replies !
View Related
Looking For AS# Text Efect Code
Hi I am looking for an effect like this but in AS3
http://flashden.net/files/56288/index.html
I would happily buy this but its AS2.
I do not want to buy a big expensive text effect package for one small effect.
I am not one to use them often.
Has anyone seen code or a class that would make this possible, free or not.
basically I want to start with a bunch of letters randomly all over the screen that swirl in and form a menu. Might be nice if they moved around for a while before swirling in. Even nicer if the move in to position could be triggered by something, such as a preloader finishing.
thanks
mark
View Replies !
View Related
Blur Glass Efect
Hello, i need some help, i wold like to do a glass with blur, i try much tutorials but they won't glass blur i need.
I trying to make something like that:http://www.giorgioarmani.com/index.jsp?site=AC&movieSession=armani_collezioni.swf&language=en&audio=acceso
Thanks to ALL
View Replies !
View Related
Flash Button Like Mac Apple Efect
Hi , I plan to have button that bahave like Mac Apple button transition effect.
When u mouseover the image(button), it zoom in into foreground (floating up)and the other buttons will become blur and slighly smaller. But if mouseover, the image returns to its original size.
I think that need some tricky actionscript. Anyone that can help me with that. Thanks.
View Replies !
View Related
Loading A Movie In A MC, With Accelerated Scroller Efect
ok I used 2 scripts one from ericlinand the other accelerated scroller (flashkit.com ) ...
I get it to load to the mainmovie through the MC, on (press) , but I cant get it to scroll anymore...I wanted to remove the drag,/tracker MC, it gave me too much trouble so ...
here's the script... I tried also putting the script(the scrolling script) on a frame and added the updateAfterEvent(mouseMove)...I don't know what Im doing wrong...If anyone could enlighten me , I would drink another corona...to se if boozed I could get inspired...
//the button
on (release) {
//this function is if I want to setProperty later
_root.dummy.needModify();
loadMovieNum("vinos.swf",1);
}
/////////////////////////dummy clip//////////////////
onClipEvent(load){
loaded=true;
function needModify(){
_level1._width-=1;
old=_level1._width;
loaded=true;
}
}
onClipEvent(mouseMove){
if ((_root._xmouse>160) and (_root._xmouse<742) and (_root._ymouse>436) and (_root._ymouse<468)){
trasladar = (trasladar*9)+(((_root._xmouse-451.7)/20))/10;
mover = mover + trasladar;
if (mover>800) {
mover=0;
}
if (mover<0){
mover=800;
}
setProperty(_level1.menuvinos,_x,mover);
updateAfterEvent(mouseMove);
}
I want to keep the accelerated menu effect, can this be done WITHOUT the hidden button
on(rollOver) { startDrag(/tracker);} and the trackerMC...
if it cannot be done then any scrolling...
gracci tanti
View Replies !
View Related
Fancy Box Type Moving Graphic Type Cool Efect But Im To Dumb Type Thingy
i am tring to make a box thinky simaler to the one on www.starvingeyes.com but cant even work out how to start it. is there anyone who can point me in the right direction or to a tutorial ?
the box has a graphic inside a grided box the sections of the graphic fade in and out as the mouse goes over them and displays random sections when the user is not moving the mouse over the box
i did find java tutorials for this effect but would much preffer it to come from flash as java is a bugger to get working on some machines
Any way thanks in advance for any help
Steven Green one_mad_punk@yahoo.co.uk
View Replies !
View Related
Fade Out, Fade In Alpha Efect
fade out, fade in alpha efect
i 'm a jpg file, who make it movie clip, with alpha = 50 %.
on mouse over action i wanna set alpha on this picture = 0, but i wanna make this with little transition. i try this, but i don't make it, because i need set pu some variables, but i don't know how.
please help me. best regards for all who help me. sorry for my english, i don't speek english verry well.
View Replies !
View Related
[FCS3] Adding Actionscript To A Movieclip Through Actionscript?
Yo, is there a way to add actionscript to a movieclip created in actionscript? Such as a onClipEvent(load) and onClipEvent(enterframe)? I have a onEnterFrame already for the movie clip as its created though. I have taken code thats from a gravity tutorial where it uses the two methods above. I've tried adding them into the onEnterFrame that I had already to add gravity to the movieclips created though that did'nt work =(
View Replies !
View Related
Jigsaw Puzzle - Changing From Actionscript 2.0 To Actionscript 3.0
Hello Everyone,
I was hoping someone could help me convert the following actionscript from actionscript 2.0 to actionscript 3.0. I'm trying to complete a jigsaw puzzple but I'm having problems converting it into actionscript 3.0.
Below is my actionscript:
//Puzzle Pieces
scramble_btn.onRelease = function(){
piece1._x = random(250);
piece1._y= random(250);
piece2._x = random(250);
piece2._y= random(250);
piece3._x = random(250);
piece3._y= random(250);
piece4._x = random(250);
piece4._y= random(250);
startGame();
messageOn.text = "";
counter.text = "00:00";
clearInterval(timeStarted);
timeStarted = setInterval(countdown, 1000);
time_start = 0;
}
//Puzzle Move
function startGame(){
piece1.onPress = function(){
this.startDrag();
piece1.swapDepths(1)
}
piece1.onRelease = function() {
this.stopDrag();
hit1();
checker();
};
piece2.onPress = function(){
this.startDrag();
piece2.swapDepths(1)
}
piece2.onRelease = function() {
this.stopDrag();
hit2();
checker();
};
piece3.onPress = function(){
this.startDrag();
piece3.swapDepths(1)
}
piece3.onRelease = function() {
this.stopDrag();
hit3();
checker();
};
piece4.onPress = function(){
this.startDrag();
piece4.swapDepths(1)
}
piece4.onRelease = function() {
this.stopDrag();
hit4();
checker();
}
};
//HitTest Script
function hit1(){
if(piece1.hitTest(container1)){
piece1._x = container1._x;
piece1._y = container1._y;
}else{
piece1._x = random(250);
piece1._y = random(250);
}
}
function hit2(){
if(piece2.hitTest(container2)){
piece2._x = container2._x;
piece2._y = container2._y;
}else{
piece2._x = random(250);
piece2._y = random(250);
}
}
function hit3(){
if(piece3.hitTest(container3)){
piece3._x = container3._x;
piece3._y = container3._y;
}else{
piece3._x = random(250);
piece3._y = random(250);
}
}
function hit4(){
if(piece4.hitTest(container4)){
piece4._x = container4._x;
piece4._y = container4._y;
}else{
piece4._x = random(250);
piece4._y = random(250);
}
}
//Timer
counter.text = "00:00";
function countdown() {
started();
time_start = time_start+1;
if (time_start>10) {
messageOn.text = "GAME OVER!!!";
clearInterval(timeStarted);
}
}
function started(){
sec = Math.floor(time_start+1/1000);
sec = (sec<10)?"0"+sec:sec;
min = Math.floor(sec/60);
min = (min<10)?"0"+min:min;
counter.text = min+":"+sec;
};
//This will check if all puzzle pieces are complete...and display game finish messsage.
function checker(){
if((piece1.hitTest(container1)) && (piece2.hitTest(container2)) && (piece3.hitTest(container3)) && (piece4.hitTest(container4))){
messageOn.text = "CONGRATULATIONS!!!";
clearInterval(timeStarted);
}
}
View Replies !
View Related
Warning: An ActionScript 1.0/2.0 SWF File Has Loaded An ActionScript 3.0 SWF;
Hi all,
I'm trying to clone an swf (produced in CS3) that has been loaded into my app (built using Actionscript/mxmlc) but keep getting the following message appear in my logs:
Code:
Warning: An ActionScript 1.0/2.0 SWF file has loaded an ActionScript 3.0 SWF; code in the ActionScript 3.0 SWF will not run.
I know the CS3 swf has been produced using Actionscript 3 as it's settings and published for FP9. It does nothing more than a motion tween of a graphic.
Here is a really simple example of how to emulate the problem:
ActionScript Code:
package{
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLRequest;
[SWF(backgroundColor=0x000000)]
public class Test extends Sprite{
private var _mc:MovieClip;
public function Test():void{
var mc:String = "rain.swf";
var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,loadedSWF);
ldr.load(new URLRequest(mc));
}
private function loadedSWF(e:Event):void{
var mc:MovieClip = MovieClip(e.target.content);
this._mc = MovieClip(new (mc.constructor)());
this.addChild(this._mc);
}
}
}
I'm using the following version of mxmlc: Version 3.0.0 build 1844
I've also tried a slightly more convoluted way:
ActionScript Code:
package{
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.utils.getQualifiedClassName;
import flash.net.URLRequest;
[SWF(backgroundColor=0x000000)]
public class Test extends Sprite{
private var _mc:MovieClip;
public function Test():void{
var mc:String = "rain.swf";
var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,loadedSWF);
ldr.load(new URLRequest(mc));
}
private function loadedSWF(e:Event):void{
var c:Class = Class(e.target.applicationDomain.getDefinition(getQualifiedClassName(e.target.content)));
this._mc = new c();
this.addChild(this._mc);
}
}
}
I would like to know what's causing the warning message, am I doing something wrong?
View Replies !
View Related
Actionscript - User Input Actionscript
I am trying to develop a way where by a users input can determine the number of fields in a form e.g. the user inputs the number 3 then the form would have 3 fields
can you show me or point me in the direction of an example i can look at and manipulate?
View Replies !
View Related
[F8] Flash6 Actionscript 2, Flash 8 Actionscript 2...help
Ok loosing it a bit now, have gone back to a very old project from a Flash 6 file, managed to convert the script language to ActionScript2, works fine as flash6 actionscript2, but once I change the project to be flash 8 I get One error......and I know where it's coming from (see below), Have come to a dead - end here, so hope that one of you guys may be able to help me....
Feel free to use this if you can get it working, just credit the designer (Me).
On the main stage MC named "site", go inside and double click on any of the MC's (named "str0, or str1 etc....all instances). Once inside an "str" MC move to frame 2 and the MC on the stage should be called "seg0 or seg1 etc...(again all instances"), go inside the MC and click on frame 1 of the actions layer. Scroll down and look for the variable named "var nummer = _parent.plus+Number(this._name.substr(3, 1));"....this always returns NaN in flash player 8, but works in flash player 6?.................help me.....I'm drowning.
link to files:
http://www.solidvision.co.uk/dev/help.zip
View Replies !
View Related
Moving A Game From Actionscript 1.0 To Actionscript 2.0...
Hi there.
I hope someone can help me out here. I have been asked to create a simple Flash memory game, and I have been given a template to use as a basis. However, this template has been created in Actionscript 1.0 for Flash player 5. I now need to transfer it over to Actionscript 2.0 Flash player 8, and Ive noticed lots of odd behaviour once it has been changed.
Here is the code....
Code:
initGame();
stop();
function initGame() {
// make sorted list of cards
cardsListOrdered = [];
for (i=1; i<=18; i++) {
cardsListOrdered.push(i, i);
}
// shuffle list
cardsListSorted = [];
while (cardsListOrdered.length>0) {
r = int(Math.random()*cardsListOrdered.length);
cardsListSorted.push(cardsListOrdered[r]);
cardsListOrdered.splice(r, 1);
}
// create card clips and assign their location and picture
x = 0;
y = 0;
for (i=0; i<36; i++) {
attachMovie("Card", "Card"+i, i);
_root["Card"+i].picture = cardsListSorted[i];
_root["Card"+i]._x = x*60+200;
_root["Card"+i]._y = y*60+50;
// move to next card spot
x++;
if (x>5) {
x = 0;
y++;
}
}
firstclip = 0;
}
function clickCard(clip) {
// see if two card are showing
if (secondclip != 0) {
// turn those two cards back over
firstclip.enabled = true;
secondclip.enabled = true;
firstclip.gotoAndStop(1);
secondclip.gotoAndStop(1);
firstclip = 0;
secondclip = 0;
}
// see if same card was clicked
if (firstclip == clip) {
// turn card back over
firstclip.gotoAndStop(1);
firstclip = 0;
// see if no cards are showing
} else if (firstclip == 0) {
// turn first card over
clip.gotoAndStop(clip.picture+1);
firstclip = clip;
firstclip.enabled = false;
// must be one card showing
} else {
// turn second card over
clip.gotoAndStop(clip.picture+1);
secondclip = clip;
secondclip.enabled = false;
// see if two cards match
if (firstclip.picture == secondclip.picture) {
// Disable both cards
firstclip.enabled = false;
secondclip.enabled = false;
firstclip = 0;
secondclip = 0;
}
}
}
When set to FlashPlayer5, all works well. If a player tries clicking the same tile twice, it stops them. Also, when a pair of tiles are uncovered, again, the user is no-longer able to press them. This was done using the "enabled = false".
However, when I change it to Flash Player 8, none of these seems to work. Ill include the .fla so someone could possibly play around with it and see where the problem is, or whether there is another way to do it....
Hope someone can help.
Many thanks
View Replies !
View Related
Swf Actionscript 3, Load A Actionscript 2 File.
Hey dudes.
I need some help over here:
i have one banner player, and load some external swf files in actionscript 2, but the player is actionscript 3.
The files is loaded like a movie, when load a as2 files into as3. I just need a trigger when the swf file ends, when is in the last frame of movie.
Someone have a ideia in how do that?
thanks!
View Replies !
View Related
Urgent :Getting Actionscript To 'pause' - Actionscript 2.0
Hi guys,
I need the actionscript to carry out a piece of code, then pause for 0.5 seconds, then carry out the next piece of code, then pause, then next code e.t.c
There will be twenty pieces of code that build up an animation with tweens that need to start at different times.
I guess its something to do with setInterval, but I'm not sure on the syntax, as there 20 pieces of code I don't want lots of nested code (though if thats the only way to do it then so be it!)
I'd really appreciate your help guys
cheers
View Replies !
View Related
Obtaining An ActionScript 2 Variable From ActionScript 3
Probably one of the most subjects on this forum has to be ActionScript 3 and ActionScript 2 communication. I found several threads on how to communicate between the two using a LocalConnection class, but there is one problem with this approach - I can't transport any values with it. Because LocationConnection.send doesn't have a return type, there is no way to transport a value from AS2 to AS3. This is very unfortunate, as I need to have access to a value that is set somewhere in the AS2 code.
I could use JavaScript as a middle layer to communicate the data between the two, but this will be a very ineffective way to achieve it. Are there any better ways for doing this?
View Replies !
View Related
ActionScript 3.0 Is 5~7 Times Slower Then ActionScript 2.0
I have a code that will translate this XML
quote:
<?xml version='1.0'?>
<Member>
<M>
<Username>Test 1</Username>
<Password>Test 1 Password</Password>
</M>
<M>
<Username>Test 2</Username>
<Password>Test 2 Password</Password>
</M>
<M>
<Username>Test 3</Username>
<Password>Test 3 Password</Password>
</M>
</Member>
Into this array
quote:
Array[0].Username = "Test 1"
Array[0].Password = "Test 1 Password"
Array[1].Username = "Test 2"
Array[1].Password = "Test 2 Password"
Array[2].Username = "Test 3"
Array[2].Password = "Test 3 Password"
Here is my variable declaration
quote:
var StartTime:Number = getTimer();
var EndTime:Number = getTimer();
var j:Number = 0;//This Variables used for ActionScript 3.0 Loop
var k:Number = 0;//This Variables used for ActionScript 3.0 Loop
Here is the XML String
quote:
var MyXMLString:String = "<?xml version='1.0'?><member><O><member_id>1</member_id><currency_id>0</currency_id><name>Administrator</name><description>Account Administrator</description><contact>-</contact><billing_info>-</billing_info><opening_payable>0.0000000000</opening_payable><opening_receivable>0.0000000000</opening_receivable><type>STAFF</type><asset_chart_of_account_id>0</asset_chart_of_account_id><liability_chart_of_account_id>0</liability_chart_of_account_id><staff_username>administrator</staff_username><staff_password>21232f297a57a5a743894a0e4a801fc3</staff_password><staff_privileges>ADMIN</staff_privileges></O><O><member_id>1</member_id><currency_id>0</currency_id><name>Administrator</name><description>Account Administrator</description><contact>-</contact><billing_info>-</billing_info><opening_payable>0.0000000000</opening_payable><opening_receivable>0.0000000000</opening_receivable><type>STAFF</type><asset_chart_of_account_id>0</asset_chart_of_account_id><liability_chart_of_account_id>0</liability_chart_of_account_id><staff_username>administrator</staff_username><staff_password>21232f297a57a5a743894a0e4a801fc3</staff_password><staff_privileges>ADMIN</staff_privileges></O><O><member_id>1</member_id><currency_id>0</currency_id><name>Administrator</name><description>Account Administrator</description><contact>-</contact><billing_info>-</billing_info><opening_payable>0.0000000000</opening_payable><opening_receivable>0.0000000000</opening_receivable><type>STAFF</type><asset_chart_of_account_id>0</asset_chart_of_account_id><liability_chart_of_account_id>0</liability_chart_of_account_id><staff_username>administrator</staff_username><staff_password>21232f297a57a5a743894a0e4a801fc3</staff_password><staff_privileges>ADMIN</staff_privileges></O></member>";
var MyXML:XML = new XML(MyXMLString);//Parse the XML ONCE
I have a function called ConvertXML , and to check the performance i made it loop every frame by calling the following RunXML function
quote:
function RunXML(Events:Event){
StartTime = getTimer();
for(var i:Number=0;i<100;i++){
var MyXMLArr:Array = ConvertXML(MyXML, false, false);
}
EndTime = getTimer();
trace(EndTime - StartTime + " ms");
}
and here is my code for parsing the variable MyXML in ActionScript 3.0 (ConvertXML function)
quote:
//Action Script 3.0 ConvertXML
import flash.xml.*;
function ConvertXML(RecvXML:XML, ChildBranch:Boolean, IsTable:Boolean):Array {
var RowArr:Array = new Array();
for (j=0; j<RecvXML.child("*").length(); j++) {
var TempObject = new Object();
for (k=0; k<RecvXML.child("*")[j].elements("*").length(); k++) {
TempObject[RecvXML.child("*")[j].elements("*")[k].name()] = RecvXML.child("*")[j].elements("*")[k];
}
RowArr.push(TempObject);
}
return RowArr;
}
addEventListener(Event.ENTER_FRAME, RunXML);
The code above run 5~7 times slower then the following actionscript 2.0 code
quote:
//Action Script 2.0 ConvertXML
function ConvertXML(RecvXML:XML, ChildBranch:Boolean, IsTable:Boolean):Array {
var RowArr:Array = new Array();
for (var aNode:XMLNode = RecvXML.firstChild.firstChild; aNode != null; aNode=aNode.nextSibling) {
var TempRecord:Object = new Object();
for (var bNode:XMLNode = aNode.firstChild; bNode != null; bNode=bNode.nextSibling) {
TempRecord[bNode.nodeName] = bNode.firstChild.toString();
}
RowArr.push(TempRecord);
}
return RowArr;
}
this.onEnterFrame = RunXML;
they both does exactly the same thing.. and yet the actionscript 3.0 code run 5~7 TIMES SLOWER . why?
i have tried other benchmark, and it seems that actionscript 3.0 perform 10 to 100 TIMES FASTER then actionscript 2.0 , only for this one it run slower... why?
I also attach all the code for actionscript 3.0
should you want to try the actionscript 2.0 , just uncomment the ConvertXML and this.onEnterFrame for actionscript 2.0 and comment the one for actionscript 3.0
Why? have i done something wrong?
Cheers and God Bless,
Chowi
Attach Code
var StartTime:Number = getTimer();
var EndTime:Number = getTimer();
var MyXMLString:String = "<?xml version='1.0'?><member><O><member_id>1</member_id><currency_id>0</currency_id><name>Administrator</name><description>Account Administrator</description><contact>-</contact><billing_info>-</billing_info><opening_payable>0.0000000000</opening_payable><opening_receivable>0.0000000000</opening_receivable><type>STAFF</type><asset_chart_of_account_id>0</asset_chart_of_account_id><liability_chart_of_account_id>0</liability_chart_of_account_id><staff_username>administrator</staff_username><staff_password>21232f297a57a5a743894a0e4a801fc3</staff_password><staff_privileges>ADMIN</staff_privileges></O><O><member_id>1</member_id><currency_id>0</currency_id><name>Administrator</name><description>Account Administrator</description><contact>-</contact><billing_info>-</billing_info><opening_payable>0.0000000000</opening_payable><opening_receivable>0.0000000000</opening_receivable><type>STAFF</type><asset_chart_of_account_id>0</asset_chart_of_account_id><liability_chart_of_account_id>0</liability_chart_of_account_id><staff_username>administrator</staff_username><staff_password>21232f297a57a5a743894a0e4a801fc3</staff_password><staff_privileges>ADMIN</staff_privileges></O><O><member_id>1</member_id><currency_id>0</currency_id><name>Administrator</name><description>Account Administrator</description><contact>-</contact><billing_info>-</billing_info><opening_payable>0.0000000000</opening_payable><opening_receivable>0.0000000000</opening_receivable><type>STAFF</type><asset_chart_of_account_id>0</asset_chart_of_account_id><liability_chart_of_account_id>0</liability_chart_of_account_id><staff_username>administrator</staff_username><staff_password>21232f297a57a5a743894a0e4a801fc3</staff_password><staff_privileges>ADMIN</staff_privileges></O></member>";
var MyXML:XML = new XML(MyXMLString);//Parse the XML ONCE
var j:Number = 0;//This Variables used for ActionScript 3.0 Loop
var k:Number = 0;//This Variables used for ActionScript 3.0 Loop
/*
//Action Script 2.0 ConvertXML
function ConvertXML(RecvXML:XML, ChildBranch:Boolean, IsTable:Boolean):Array {
var RowArr:Array = new Array();
for (var aNode:XMLNode = RecvXML.firstChild.firstChild; aNode != null; aNode=aNode.nextSibling) {
var TempRecord:Object = new Object();
for (var bNode:XMLNode = aNode.firstChild; bNode != null; bNode=bNode.nextSibling) {
TempRecord[bNode.nodeName] = bNode.firstChild.toString();
}
RowArr.push(TempRecord);
}
return RowArr;
}
this.onEnterFrame = RunXML;
*/
//Action Script 3.0 ConvertXML
import flash.xml.*;
function ConvertXML(RecvXML:XML, ChildBranch:Boolean, IsTable:Boolean):Array {
var RowArr:Array = new Array();
for (j=0; j<RecvXML.child("*").length(); j++) {
var TempObject = new Object();
for (k=0; k<RecvXML.child("*")[j].elements("*").length(); k++) {
TempObject[RecvXML.child("*")[j].elements("*")[k].name()] = RecvXML.child("*")[j].elements("*")[k];
}
RowArr.push(TempObject);
}
return RowArr;
}
addEventListener(Event.ENTER_FRAME, RunXML);
function RunXML(Events:Event){
StartTime = getTimer();
for(var i:Number=0;i<100;i++){
var MyXMLArr:Array = ConvertXML(MyXML, false, false);
}
EndTime = getTimer();
trace(EndTime - StartTime + " ms");
}
Edited: 10/09/2008 at 12:17:57 AM by M4G1C14N
View Replies !
View Related
URGENT How Do I Get Actionscript To Pause Actionscript 2.0
Hi guys,
sorry to repost, I know its an annoying thing to do, but this is pretty urgent on a project I'm doing.
I need the actionscript to carry out a piece of code, then pause for 0.5 seconds, then carry out the next piece of code, then pause, then next code e.t.c
There will be twenty pieces of code that build up an animation with tweens that need to start at different times.
I guess its something to do with setInterval, but I'm not sure on the syntax, as there 20 pieces of code I don't want lots of nested code (though if thats the only way to do it then so be it!)
I'd really appreciate your help guys
cheers
View Replies !
View Related
Help: This Works In Actionscript 1 But I Need It To Work In Actionscript 2
I have some scrolling navigation that works when published using actionscript 1 but not actionscript 2. I need to use actionscript 2 because it supports the streaming video that I'm trying to navigate. Can someone help me rewrite my button logic to get the scroll bar to work as it did in actionscript 1? Please see my fla if necessary, but here is the area I need help with.
if (Number((getProperty("../scrollhandle", _y)))>Number((Number(../:top)+Number((../:speed/(../:height/../:scrolllength)))))) {
setProperty("../scrollhandle", _y, (getProperty("../scrollhandle", _y)-(../:speed/(../:height/../:scrolllength))));
} else {
setProperty("../scrollhandle", _y, ../:top);
}
tellTarget ("../scrollhandle") {
gotoAndPlay(3);
}
the error that I get is:
**Error** Symbol=buttonlogic, layer=Layer 1, frame=2:Line 1: Operator '>' must be followed by an operand
if (Number((getProperty("../scrollhandle", _y)))>Number((Number(../:top)+Number((../:speed/(../:height/../:scrolllength)))))) {
**Error** Symbol=buttonlogic, layer=Layer 1, frame=2:Line 2: Operator '-' must be followed by an operand
setProperty("../scrollhandle", _y, (getProperty("../scrollhandle", _y)-(../:speed/(../:height/../:scrolllength))));
**Error** Symbol=buttonlogic, layer=Layer 1, frame=2:Line 4: Unexpected '.' encountered
setProperty("../scrollhandle", _y, ../:top);
Please help if you can.
View Replies !
View Related
Converting ActionScript 1 To ActionScript 2
Flash keeps giving me a "type mismatch" error for this particular line of code:
myItemArray[x] = parseInt(Math.random()*9) + myItemArray[x];
Based on my research it's because it's old script and I'm not sure how to go about converting it so I don't get the error. I've pasted the entire block of code for your understanding. Thanks in advance for you help.
Code:
//Build array
myItemArray = new Array("a1","a2","a3","a4","a5","a6","b1","b2","b3" ,"b4","b5","b6");
for(var x = 0; x < 12; x++){
myItemArray[x] = parseInt(Math.random()*9) + myItemArray[x];
}
//Sort array
myItemArray.sort();
//Strip off random num at beginning
for (var x = 0; x < 12; x++){
myItemArray[x] = myItemArray[x].substr(1,myItemArray[x].length);
}
View Replies !
View Related
Works On ActionScript 1.0 But Not On ActionScript 2.0
The following code works if you have your flash file set to:
Flash Player 6
Action Script 1
I need it to work for
Flash Player 7
Action Script 2
What it does is that basically if i have
1 2 3 4 5
and i click on the 5 it will arrange the movie clips so they will be
5 1 2 3 4
mc is the name for action script of the movie clip i'm using
I think
the function that doesn't work correctly is the move function
HOW CAN I FIX THIS Sad
Code:
var acceleration = 12;
var friction = 0.7;
clipArray = [];
posArray = [];
for (var k = 0; k<5; k++) {
myclip = attachMovie("mc", "mc"+k, k);
myclip._y = 100;
myclip._x = 170+myclip._width*k;
//myclip.myText.text = "Button "+k;
clipArray.push(myclip);
//countArray.push(k);
posArray.push(myclip._x);
myclip.onPress = dostuff;
}
function move() {
var xdif = posArray[this.jvar]-this._x;
this.xspeed += xdif/this._parent.acceleration;
this.xspeed *= this._parent.friction;
this._x += this.xspeed;
this.checkDistance();
}
checkDistance = function () {
if (Math.abs(posArray[this.jvar]-this._x)<1) {
this._x = posArray[this.jvar];
delete this.onEnterFrame;
}
};
function dostuff() {
for (var i = 0; i<clipArray.length; i++) {
// setting indexes
clipArray[i].ivar = i;;
}
// deleting the mc the user clicked
k = clipArray.splice(this.ivar, 1);
// the mc you click is on the front
clipArray = k.concat(clipArray);
for (var j = 0; j<posArray.length; j++) {
// re setting the indexes
clipArray[j].jvar = j;
trace(clipArray[j]+" "+clipArray[j].jvar);
// calls move
clipArray[j].onEnterFrame = move;
}
}
View Replies !
View Related
Actionscript 2.0 Convert To Actionscript 3.0
Hello Everyone,
I have the code below which was created for Actionscript 2.0... I was hoping someone could help me convert to Actionscript 3.0.
If there is anyone that could help me out I would greatly appreciate it.
Thanks,
Alan
var mouse_control:Boolean = true;
var speed:Number = 0;
var mouse_force:Number = 100;
map_color_mc.gotoAndStop("1");
var stop_motion:Boolean = false;
var front_map_position:Number = front_map_mc._x=0;
var reverse_map_postion:Number = reverse_map_mc._x=0;
var centerX:Number = Stage.width/2;
point_mc.duplicateMovieClip("point_mc2", -16367);
point_mc2._x = point_mc._width;
point_mc2._y = point_mc._y;
this.onEnterFrame = function() {
if (stop_motion == false) {
if (mouse_control) {
speed = ((_xmouse-centerX)/mouse_force);
}
front_map_position += speed;
reverse_map_postion -= speed;
if (front_map_position>0) {
front_map_position = -(front_map_mc._width/2);
}
if (front_map_position<(front_map_mc._width/2)*-1) {
front_map_position = 0;
}
if (reverse_map_postion>0) {
reverse_map_postion = -(reverse_map_mc._width/2);
}
if (reverse_map_postion<(reverse_map_mc._width/2)*-1) {
reverse_map_postion = 0;
}
point_mc._x = front_map_mc._x=front_map_position;
point_mc2._x = point_mc._x+point_mc._width;
reverse_map_mc._x = reverse_map_postion;
}
};
globe_hit_mc.onRollOver = function() {
if (mouse_control == false) {
stop_motion = true;
}
};
globe_hit_mc.onRollOut = function() {
if (mouse_control == false) {
stop_motion = false;
}
};
View Replies !
View Related
Importing Actionscript Into Actionscript
I've got a game and I've got too much actionscript.
So I'm wondering if it's posible to import an external actionscript file into the code on the maibn SWF file.
This would also give the user a chance to edit basic vaiables, eg. speed, jumpHeight etc.
Any ideas?
View Replies !
View Related
Actionscript 2.0 → Actionscript 3.0
Hi,
Since I'm no expert in it, it took me time to get used to some Actionscript 2.0 codes. Now I'm trying to work on Actionscript 3.0, but I don't know that much about it. I have a script that I want to convert from 2.0 to 3.0. Here it is:
ActionScript Code:
g_list.addItem({label:"Wikipedia", data:"Wikipedia"});
g_list.addItem({label:"Yahoo", data:"Yahoo"});
var listHandler:Object = new Object();
listHandler.change = function(ntt:Object) {
switch (ntt.target.selectedItem.data) {
case "Wikipedia" :
getURL ("http://www.wikipedia.org");
break;
case "Yahoo" :
getURL ("http://www.yahoo.com");
break;
default :
trace("unhandled event: "+ntt.target.selectedItem.data);
break;
}
};
g_list.addEventListener("change", listHandler);
Can anyone help me, please?
View Replies !
View Related
Migrate Actionscript 3 To Actionscript 2
Hello,
I have a problem migrating from AS3 to AS2.
I have the following code:
class Main extends MovieClip {
var g1:Graph;
function Main() {
g1 = new Graph(); // I create a new instance on Graph
addChild(g1); //add it to this movieclip
g1.startup(); //in startup I add several instances on Elem to g1
}
function updateElems()
{
for(var i:Number = 0; i < g1.numChildren; i++)//I iterate through childrens to update them
{
var elem:Elem = g1.getChildAt(i) as Elem;
elem.update();
}
}
}
I create an AS3 project and associate the stage to the Main class that adds a child - g1 - of type Graph using addChild(), then I add several Elem instances to Graph using addChild().
While running I need to update the Elem instances so I iterate through g1's children of type Elem, using getChildAt(i=0, numChildren).
I need to port this to AS2
In AS2
- there's no fl.core.UIComponent (I've used mx.core.UIComponent)
- mx.core.UIComponent doesn't have getChildAt and addChild methods
The questions are:
a) how can I add Main class to stage as I cannot link it from the user interface as this feature is only supported with as3?
b) how can I add g1 to Main?
c) how can I add instances of Elem to g1
c) how can I iterate through the children of g1, the Elem instances and update them?
Thanks!
View Replies !
View Related
|