Maths Problem in Action Script 2.0
Hi surfers,
We have a problem in Action Script 2.0 to solve the maths equation given below:
write a code in Action Script 2.0 to solve these two equation.
Aim: To know the value of "a" in both different equations.
1. 2a + 5 = 3a + 1
2. 4a + 3 = 11
Thanks in Advance.
Pls give me ASAP, i'm struggle here.
Hello, you are at the wrong forum. for AS 2.o questions, hop on there: http://forums.adobe.com/community/flash/flash_actionscript
BTY, people answer when they can, not when you want...
Similar Messages
-
Problem with action script from Schewe and Frasier book.
I am working on a Photoshop CS3 action script to
open raw files, do a couple of modifications
in Camera Raw, exit camera raw and save
the file as a jpeg.
I think this should work, because I am working
on an example out of "Camera raw with Adobe
Photoshop CS3" by Schewe and Frasier which
shows the step recorded.
See page 344 of Schewe and Frasier.
In figure 9-11 you see, after the open
statement, 10 lines of details like
"As camera raw"
"Model:Canon 350d" etc.
I get the file path and name line, but
none of the other details reflecting
actions in Camera Raw.
The problem is that in setting up the action, none
of the steps done in camera raw after I do the
open get recorded.
And it works in my old CS version !
Out of frustration I repeated the action
script creation in my old CS version and
it worked fine.
Any idea where I am screwing up ?Crappy format justification:
I sometimes have a day of family
type pictures that are in raw format
that I want to put up on the internet
quickly. I would like to be able to
apply the "Auto" feature, as in general
it seems to be pretty good for something
quick.
OK, it sorta works in CS, go here
http://www.angelplace.net/photos/sample.jpg
It sets up all of the details and gets the
"As camera raw" but opens the .dng file
rather than the Camera raw window.
The point is, these important settings
seem to be saved, which does not happen
in CS3. -
Problem with action script to button
Hello all.
I'm having a problem with my adobe flash CS3 action script. My button cant link to the other URL. I tried to put an action script but i fail. anyone can help me? here the attachment for my flash document.HELLO,
just check navigateToURL() -
function loadProgress(my_content:ProgressEvent):void {
var percent:Number = Math.floor( (my_content.bytesLoaded * 100) / my_content.bytesTotal );
percent_Txt.text = percent + "%";
preloader.gotoAndStop(percent);
function loadComplete(e:Event):void {currentFrame;}
loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loaderInfo.addEventListener(Event.COMPLETE, loadComplete);
is not working
Mean
the Text is to 1 - 100 % increase.
But not working that .
Only others are animating
Please some one help mefunction loadProgress(my_content:ProgressEvent):void {
var percent:Number = Math.floor( (my_content.bytesLoaded * 100) /
my_content.bytesTotal );
percent_Txt.text = percent + "%";
preloader.gotoAndStop(percent); // preloader should have frames
1,...,100.*
function loadComplete(e:Event):void {
currentFrame+1;
// the above will do nothing. what are you trying to do?
This action script is not working in my background. Any settings to change.? -
Problem with action script calculations
I have a simple action script 3 code that will not calculate the correct answer on my PC. I'm running flash cs5 on Window 7 OS. I can move the file to another machine running flash cs4 and it works, but when I run it on my laptop, I get funky answers. see cold below. I have uninstalled and reinstalled cs5 , run the cleanscript for cs5 and cs4 to make sure everything was removed. I have uninstalled and reinstalled flash player. but nothing seems to work. Any help will be appreciated. It acts like Action Script 3 is corrupt or something else that related to Action Script 3. Everything else seems to work. I also have a preloader running with the same issue. It is should be showing the percentage completed but it go 2 5 50 4 32 or something funky like that. Please help.
the code I'm using.
function calculateTotal(evtObject:MouseEvent):void {
var price:Number;
var totalCost:Number;
var numberOfJerseys:Number;
if (jerseyType.text == "2") {
price = 12;
if (jerseyType.text == "1") {
price = 10;
if (playerNames.text == "Y" || playerNames.text == "y") {
price += 1.50;
numberOfJerseys = int(numberOfPlayers.text) +int(numberOfCoaches.text);
totalCost = numberOfJerseys*price;
total.text = String(totalCost);
calc_btn.addEventListener(MouseEvent.CLICK, calculateTotal);
the preloader percentage is
var percent:int = amtLoaded*100
percent_txt.text = String(percent);HELLO,
just check navigateToURL() -
The Problem About Action Script..
When i published the fla document on adobe flash cs5 , flash cs5 doesn't publishing actionscript files.. I'm looking my swf file from any decompiler but i can't see actionscript files.. Please Help Me , Thank You.
I'm opening my swf file with swf decompiler and i can see the ''.as'' files in the Action folder.. Then i'm changing any text on any .as file with adobe flash cs5 and i'm publishing..When i opened my published swf file there are many problems and i'm looking my swf file with swf decompiler and my .as files has gone..There aren't any .as file and there isn't action folder.. Please help me, this is too important for me.. Sorry for my bad english , thanks..
-
Problem with action script 3 make input text box and button....
Hi every one I am trying to make a family book using "Air for Android" with a simple search engin in the book
air for android only work with AS3,
the search function is to type a person's name and hit submit then go to a specific frame.
have a problem making below code to work in AS3 and hopefully one of you guys can lead me in the right direction to fix the issue.
Currently, I have an input text box and a button. When you type specific words into the input box and then hit the button it sends you to a specific frame.
(it work find in AS2 but not in AS3,)
Here is my current code that is placed on the main timeline, first frame:
stop();
onEnterFrame = function () {
submit.onRelease = function() {
switch (yourname.text) {
case "name1" :
gotoAndStop(2);
break;
case "name2" :
gotoAndStop(3);
break;
My button that checks if the phrase is correct is called "submit" and my input box has an instance of "yourname".
My phrases that will be accepted in the input box are "name1" and "name2" which bring me to two different frames.
Basically, I'm having a problem with making this to work with AS3.you should use the default option in the switch statement
that way yourname contains something not in one of the case statements it will go to the default bit and execute teh code there
function onSubmit(e:MouseEvent):void
switch (yourname.text)
case "name1":
gotoAndStop(2);
break;
case "name2":
gotoAndStop(3);
break;
default:
goToAndStop(you frame you want);
break; -
I have 3 problems on action script on the following :
a) I have two instances on the stage. I want to link these 2
instances by drawing a line by clicking the mouse and drag from
one instance to another.
b) I have 2 instances A & B on the stage. I want to drag
instance A and place it on instance B, Instance A is unmovable
after
placing on instance B.
c) I have an instance on stage which is made visible = false
on load. onRelease of button this instance is visible = true. I go
to next frame, then I go back to previous frame, the
instance become visible = false again. How does the action Script
like by
letting the instance visible = true when I go to previous
frame.
By dafeiFlash CS3 works with events.
To handle clicks you have to capture the click event
To load a link you have navigateToURL:
http://livedocs.adobe.com/flex/2/langref/flash/net/package.html#navigateToURL() -
Action script problem for audio player
i have made a introduction with a audio and controller. I am facing one problem. I will like to play as soon as some one enter the page but it does not.
My action script is pasted below and kindly advise me for any changes that can be done
var soundReq:URLRequest = new URLRequest("Sonu Nigam_Alka Yagnik - Suraj Hua M.mp3");
var sound:Sound = new Sound();
var soundControl:SoundChannel = new SoundChannel();
var volumeControl:SoundTransform = new SoundTransform();
var resumeTime:Number = 0;
sound.load(soundReq); sound.addEventListener(Event.COMPLETE, onComplete);
up_btn.addEventListener(MouseEvent.CLICK, increaseVolume);
down_btn.addEventListener(MouseEvent.CLICK, decreaseVolume);
function onComplete(event:Event):void
play_btn.addEventListener(MouseEvent.CLICK, playSound);
stop_btn.addEventListener(MouseEvent.CLICK, stopSound);
function playSound(event:MouseEvent):void
{ soundControl = sound.play(resumeTime);
pause_btn.visible = true;
pause_btn.addEventListener(MouseEvent.CLICK, pauseSound);
play_btn.visible = false; play_btn.removeEventListener(MouseEvent.CLICK, playSound);
function pauseSound(event:MouseEvent):void {
resumeTime = soundControl.position;
soundControl.stop();
play_btn.visible = true;
play_btn.addEventListener(MouseEvent.CLICK, playSound);
pause_btn.visible = false;
pause_btn.removeEventListener(MouseEvent.CLICK, pauseSound);
function stopSound(event:MouseEvent):void {
soundControl.stop();
play_btn.visible = true;
play_btn.addEventListener(MouseEvent.CLICK, playSound);
pause_btn.visible = false; pause_btn.removeEventListener(MouseEvent.CLICK, pauseSound);
function increaseVolume(event:MouseEvent):void {
volumeControl.volume += .5;
soundControl.soundTransform = volumeControl;
function decreaseVolume(event:MouseEvent):void {
volumeControl.volume -= .5;
soundControl.soundTransform = volumeControl;
pause_btn.visible = false;i am having big problem with the coding below with the sound. As it we enter the site, the music auto start very loud which is not good at all for the ear drums. How do i adjust that?
www.hitenkajal.co.uk
var soundReq:URLRequest = new URLRequest("10 Kabhi Alvida Naa Kehna_0.mp3");
var sound:Sound = new Sound();
var soundControl:SoundChannel = new SoundChannel();
var volumeControl:SoundTransform = new SoundTransform();
var resumeTime:Number = 0;
sound.load(soundReq);
sound.addEventListener(Event.COMPLETE, onComplete);
up_btn.addEventListener(MouseEvent.CLICK, increaseVolume);
down_btn.addEventListener(MouseEvent.CLICK, decreaseVolume);
function onComplete(event:Event):void
play_btn.addEventListener(MouseEvent.CLICK, playSound);
stop_btn.addEventListener(MouseEvent.CLICK, stopSound);
function playSound(event:MouseEvent):void
soundControl = sound.play(resumeTime);
pause_btn.visible = true;
pause_btn.addEventListener(MouseEvent.CLICK, pauseSound);
play_btn.visible = false;
play_btn.removeEventListener(MouseEvent.CLICK, playSound);
function pauseSound(event:MouseEvent):void
resumeTime = soundControl.position;
soundControl.stop();
play_btn.visible = true;
play_btn.addEventListener(MouseEvent.CLICK, playSound);
pause_btn.visible = false;
pause_btn.removeEventListener(MouseEvent.CLICK, pauseSound);
function stopSound(event:MouseEvent):void
soundControl.stop();
play_btn.visible = true;
play_btn.addEventListener(MouseEvent.CLICK, playSound);
pause_btn.visible = false;
pause_btn.removeEventListener(MouseEvent.CLICK, pauseSound);
function increaseVolume(event:MouseEvent):void
volumeControl.volume = 1;
soundControl.soundTransform = volumeControl;
function decreaseVolume(event:MouseEvent):void
volumeControl.volume = 0.1;
soundControl.soundTransform = volumeControl;
pause_btn.visible = false;
playSound(null); -
CS4 Action Script display problems
I've just used Flash CS4 for the first time after using CS3 for some time. When using the Action Script window to write code I had the strangest problem. When writing or pasting code in the AS window the last couple of letters or characters get cut off. I checked my preferences and they were they same as they were in CS3 (just to be sure). Both CS3 & CS4 both have the Monaco font as the default. I solved the problem by changing the fint to Arial. Now the AS displays properly.
Wondered if anyone has seen this happen and if they knew if it was a bug or something?
I'm using CS4 with a newer MacBook Pro and sing AS2 in this project.
Thanks so much!
BCfirst button is called Enter and it is btn1 in the libary, i would like that to navigate to scene 2 frame 1. this was a graphics and i converted it to a button have also tried making it a movie clip it still doesn't work. the second button is Autobiogtaphy and it is btn2, i would like that to be navigated to the frame 10 and the frame is called About. I have CS4 and i realised all the stop actions worked when i saved it in CS3 and opedned it back up so since then i have been using that format. im also using AS3 if that makes any difference.
So i realised i haven't been much help on details hope this helps -
Problems adding url link to buttons in action Script 3
each time I added it link 1 to the button on file i get these error messages-
1046: Type was not found or was not a compile-time constant: link1.
1180: Call to a possibly undefined method link1.
Warning: 3594: exec is not a recognized method of the dynamic class RegExp. var r:Object = p.exec(s);
This is the code I am using: import flash.net.navigateToURL; import flash.net.URLRequest; var link_one:link1; link_one = new link1(); stage.addChild(link_one); link_one.addEventListener(MouseEvent.CLICK, buttonClickHandler); function buttonClickHandler(event:MouseEvent):void { var url:String = "http://www.masterpiececorp.com/ARMREF.htm"; var request:URLRequest = new URLRequest(url); navigateToURL(request); } I have no other problems with link 3 or 4, just link 1 I still cannot get my urls link to movie clips on the flash
Can you upload flash here? if not I have a image capture I can use to have you look at my buttons and action script code. i have been to every forum I know and not any have been helpful at all. This is my last hope.
Very frustrated newbie Gina T
Message was edited by: gtaylor0406The way you had your code originally would be correct...
var link_one:link1;
link_one = new link1();
addChild(link_one);
The 1046 error is indicating it doesn't recognize the link1 class. So the first thing you need to make sure of is that you have assigned the link1 class designation to whatever symbol that is in the library. -
Action script with reference to root causing problems in Captivate
Hi All,
I just inserted an animation into Captivate and it seems to
be working as intended; however, i receive a warning stating that
action script referencing "root" may cause the Captivate project
not to work properly or at all.
Has anyone experienced such a problems coming from action
script reference. It appears to be working fine, so I'd rather not
touch it if I can get away with it.If you run into issues there is a technote on Adobe.com that
will advise you
on how to remove or work around using _root references.
Ideally you would
never refer to _root at all.
Steve
http://twitter.com/Stevehoward999
Adobe Community Expert: eLearning, Mobile and Devices
European eLearning Summit - EeLS
Adobe-sponsored eLearning conference.
http://www.elearningsummit.eu -
Scroll panel action script problem
Hi, I have the following action script:
and its giving me the following errors:
Location: Scene 1, Layer 'action', Frame 1, Line 11
Description: 1120: Access of undefined prperty _xmouse,
Source: if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse
<b.yMin || _ymouse>b.yMax) {
Location: Scene 1, Layer 'action', Frame 1, Line 11
Description: 1120: Access of undefined prperty _xmouse,
Source: if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse
<b.yMin || _ymouse>b.yMax) {
Location: Scene 1, Layer 'action', Frame 1, Line 11
Description: 1120: Access of undefined prperty _ymouse,
Source: if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse
<b.yMin || _ymouse>b.yMax) {
Location: Scene 1, Layer 'action', Frame 1, Line 11
Description: 1120: Access of undefined prperty _ymouse,
Source: if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse
<b.yMin || _ymouse>b.yMax) {
Location: Scene 1, Layer 'action', Frame 1, Line 24
Description: 1120: Access of undefined prperty _xmouse,
Source: var xdist = _xmouse - 185;
Location: Scene 1, Layer 'action', Frame 1, Line 8
Description: 1120: Access of undefined prperty _root,
Source: var b = stroke.getBounds(_root);
Location: Scene 1, Layer 'action', Frame 1, Line 11
Description: 1120: Access of undefined prperty _ymouse,
Source: if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse
<b.yMin || _ymouse>b.yMax) {
HERE IS MY ACTION SCRIPT
HERE IS MY FILE
flash5.fla
I used the following tutorial
http://www.gotoandlearn.com/
Scrolling Thumbnail Panel.
Please help as to what I should do to fix it please.I can't be certain, because I don't have Flash CS3 on my
computer, but it reads as though your publish settings are set to
the wrong version of Actionscript. The code you have attached is
Actionscript 2, and those errors sound like something that would be
spit out if you are trying to publish to Actionscript 3. Check your
publish settings, and change to AS2. If you are already on AS2,
reply, and will look into further.
Hope this helps. -
Action Script problem with scrolling images
doing a tutorial and got to the stage of action scripting mouse control for scrolling images.
checked the script in Actions. And said it was ok...No errors found.
Tested the movie and there were 2 compiler errors reported.
Scene 1. layer 'action script', Frame 1, line 1: 1120:Access of undefined property _root. _root.onEnterFrame=funtion(){
Scene 1. layer 'action script', Frame 1, line 2: 1120:Access of undefined property _root. _if(_root._xmouse<50){
Scene 1. layer 'action script', Frame 1, line 1: Warning: 1058: Migration issue: The property _root.onEnterFrame=funtion(){
Can anyone help me understand this.
thanksIt sounds like you are mixing up AS2 code with AS3 compiling. You may need to change you publish settings to AS2.
-
I'm making a slideshow about 18 images in all 9 thumbnails and 9 full size images. The problem I keep running into is the "a script in this movie is causing flash player 9 to run slowly" error. The Flash is set to player 9 and action script 2.0. I have followed the uninstall reinstall tips in other threads and even tried it on another machines, ultimately coming up with the same results. I have read that there could possibly be too much script on the single frame so that said here is the script that is all on that first and only frame.
this.createEmptyMovieClip("container",1);
var imagesNumber:Number = 9;
for (i=1; i<=imagenumber; i++) {
container.attachMovie ("Cakethumb0"+i, "Cakethumb0"+i+"_mc",i);
Cakethumb_mc = container ["Cakethumb0"+i+"_mc"];
Cakethumb_mc._x =(i-1) *Cakethumb_mc._width;
Cakethumb_mc._y = (Stage.height-Cakethumb_mc.height)/2
Cakethumb_mc.largerImage = i;
Cakethumb_mc.onRelease = function() {
_root.attachMovie ("Cakeimage0"+this.largerImage,"large_mc",2);
large_mc._x = (Stage.width - large_mc._width)/2;
large_mc._y = (Stage.height - large_mc. _height)/2;
large_mc.onRelease = function() {
this.removeMovieClip();
container.onEnterFrame = function () {
this._x += Math.cos((-root._xmouse/Stage.width)*Math.PI)*15;
if (this._x>0) {
this._x = 0;
if (-this._x>(this._width-Stage.width)) {
this._x = -(this._width-Stage.width);
I appreciate any help you guys can send my way.Is the following a coding error where you declare a variable but misspell it when it gets put to use, or is the variable used somewhere else?
var imagesNumber:Number = 9;
for (i=1; i<=imagenumber; i++) {
Maybe you are looking for
-
My Online number seems to have disappeared Help
I have an online skype Uk number but in the last couple of days people have told me they get a message saying to say it is not a valid number. I tried myself calling my UK online number from Italy and got a message to say the area code is not valid (
-
I've been backing up the Sybase Inventory Database using 'STARTSER DBBACKUP, as documented in Shaun Pond's Cool Solutions article. This has run as a scheduled task via Remote Manager, has worked faultlessly for ages but has suddenly stopped working.
-
Hi! I'm starting developing my first j2ee application and i'm using weblogic server 6.1 as a j2ee application server. My application will consist in jsp pages in the presentation tier and enterprise java beans in the business tier. I would like to kn
-
Hi We have set up an InfoPath form with a data connection and is web enabled. But when we come to connect it says its not web enabled. How do I re publish with this option enabled rather than having to redo the who form? Thanks
-
Opening First Image Takes forever
Hey guys. Just as the title says, every time i start photoshop CS2 (latest update) (windows xp) the first image always takes a long time to load (e.g. 30 seconds) no matter the image or how long i give photoshop to load first. Any images after that l