Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-14-2007, 04:01 PM   #1
ScottQuillin
Registered User
 
Join Date: Apr 2007
Posts: 7
Question Every Graphic Opens Same Blank Page

Hello!

I have a Flash page that has multiple spinning graphics that open to smaller pages.

Example 1:

www.learntorip.us

Problem is, these little pages are hard to edit. So, I came up with the idea to use this Flash page as a gateway page to my other websites. This would require that each of the spinning graphics opens a blank page so the Flash page stays open.

I added the following code to the button:


on (release) {

//Goto Webpage Behavior
getURL("http://www.learntorip.com/","_blank");
//End Behavior

}

It works just the way I needed it to except that it opens this blank page on every graphic I click on!!

Example 2:

www.learntorip.org

Is it possible to do this or am I going to have to edit the smaller pages from Example 1 and just create a link that opens to a blank page?

Thank you so much in advance for any help!!

Scott Quillin
ScottQuillin is offline   Reply With Quote
Old 04-14-2007, 04:11 PM   #2
grass
Senior Member
 
Join Date: Apr 2006
Location: estonia
Posts: 739
Default

if you mean if it is possible to load all your graphics into single new window then try this:

getURL("http://www.learntorip.com/","myFlashWindow");

it should give the window a name at first cuz it doesn't exist and then use only this window....
__________________
I re-invent wheel to invent bike with 4 asses in the future!
grass is offline   Reply With Quote
Old 04-14-2007, 04:14 PM   #3
atomic
Banned by AS.org Staff
 
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
Default

You would need to open a popup, rather than using getURL, and always open the same popup on every button, through it's window name...

http://www.flash-db.com/PopUp/
atomic is offline   Reply With Quote
Old 04-14-2007, 04:23 PM   #4
abeall
Senior Member
 
Join Date: Feb 2006
Location: Washington, DC
Posts: 2,810
Send a message via AIM to abeall
Default

Quote:
It works just the way I needed it to except that it opens this blank page on every graphic I click on!!
FireFox blocks it from opening at all for me.
abeall is offline   Reply With Quote
Old 04-14-2007, 06:02 PM   #5
ScottQuillin
Registered User
 
Join Date: Apr 2007
Posts: 7
Default

Hi grass, atomic and abeall,

Thank you for your replies!

Actually, I'm trying to make each spinning graphic (www.learntorip.org) load a different website in a blank page. Right now, no matter which graphic I click on, they all to go www.learntorip.com.

I do not see each graphic separated in the Action Script so I'm really stuck here. I'm not very experienced with Action Script.

I just don't know where to add the following code

on (release) {

//Goto Webpage Behavior
getURL("http://www.learntorip.com/","_blank");
//End Behavior

}

to the individual graphics in Flash (if that can even be done).

Here is a copy of the script to hopefully assist anyone helping me:

stop()

import mx.utils.Delegate;
import mx.transitions.Tween;
import mx.transitions.easing.*;

var numOfItems:Number;
var radiusX:Number
var radiusY:Number
var centerX:Number
var centerY:Number
var speed:Number
var perspective:Number
var menuNames:Array = []
var home:MovieClip = this;
speed = 0.01;
perspective = 130;

MovieClip.prototype.ini = function(tx1){
var vars:Array = tx1.split("$$$$")
this.smashed.txt.autoSize = this.txt.autoSize = "left"
this.smashed.txt.htmlText = vars[0]
this.txt.htmlText = vars[1]
this.txt._x = (this.smashed._x + this.smashed._width) - 11
}

_global.fmt_container = {}
ASSetPropFlags(_global, "fmt_container", 7, 1);
_global.fmt_container.standard = this.global_font.getNewTextFormat()
_global.fmt_container._input = this.input_font.getNewTextFormat()

_global.def_fmt = _global.inp_fmt = new TextFormat()
var sample_fmt = _global.fmt_container.standard
_global.inp_fmt = _global.fmt_container._input
def_fmt.font = sample_fmt.font
def_fmt.bold = sample_fmt.bold
def_fmt.italic = sample_fmt.italic
def_fmt.size = sample_fmt.size

function init(){
radiusX = Stage.width / 3.5;
radiusY = Stage.height / 7;
centerX = Stage.width / 2;
centerY = Stage.height / 2;
content._x = Stage.width / 2 + 55
content._y = Stage.height / 2 + 15
bot._width = top._width = Stage.width
menu._y = Stage.height - 20
bot._x = Stage.width - bot._width
bot._y = Stage.height - bot._height/2
name._x = name._width/2 + 10
player._x = Stage.width - player._width/2.2
menu.menuGen(true)
if(!firstLoaded){
xml.load("main.xml");
firstLoaded = true
}
if(_global.executeTocenter){
tocenter(_root.bg_container)
}
}


var aa = {}
aa.onResize = init
Stage.addListener(aa)

var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",100000);
tooltip._alpha = 0;

var xml:XML = new XML();
xml.ignoreWhite = true;

xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
{
var t = home.attachMovie("item","item"+i,i-1);
t.page = i
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
menuNames.push(nodes[i].attributes.tooltip)
t.content = nodes[i].attributes.content;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.r.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onPress = released;
}
_root.menu.menuGen()
}

function over()
{
var sou:Sound = new Sound();
sou.attachSound("sover");
sou.start();
this._parent.gotoAndStop(2)
home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
home.tooltip._alpha = 100;
}

function out()
{
this._parent.gotoAndStop(1)
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
}

function released(){
//Goto Webpage Behavior
getURL("http://learntorip.com","_blank");
//End Behavior

}

_global.curLink = false
_global.pageOn = true
_global.num = this._parent.page
_global.prev.enabled = true
_global.prev.gotoAndPlay(7)
menu["menuItem" + _global.num].bg.tt.enabled = false
menu["menuItem" + _global.num].bg.gotoAndStop(6)
_global.prev = menu["menuItem" + this._parent.page]
var sou:Sound = new Sound();
sou.attachSound("sdown");
sou.start();
content._visible = true
home.tooltip._alpha = 0;
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home["item"+i];
t.xPos = t._x;
t.yPos = t._y;
t.theScale = t._xscale;
delete t.icon.onRollOver;
delete t.icon.onRollOut;
delete t.icon.onPress;
delete t.onEnterFrame;
if(t != this._parent)
{
var tw0:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,tru e);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,tru e);
//var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,0,1,true);
}
else
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,t rue);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,t rue);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,Stage.width/2-280,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,Stage.height/2-65,1,true);
content.gotoAndPlay("p" + (t.page+1))
var s:Object = this;
s.onPress = unReleased;
}
}


function unReleased()
{
_global.pageOn = false
menu["menuItem" + this._parent.page].bg.tt.enabled = true
menu["menuItem" + this._parent.page].bg.gotoAndPlay(6)
var sou:Sound = new Sound();
sou.attachSound("sdown");
sou.start();

delete this.onPress;
content._visible = false
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home["item"+i];
if(t != this._parent)
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,0,t.theScale,1,tr ue);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,0,t.theScale,1,tr ue);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,0,100,1,true);
}
else
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,100,t.theScale,1, true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,100,t.theScale,1, true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,t.xPos,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,t.yPos,1,true);
tw.onMotionStopped = function()
{
if(_global.dust){
for(i in content){
removeMovieClip(content[i])
_global.dust = false
}
}
for(var i=0;i<numOfItems;i++)
{

var t:MovieClip = home["item"+i];
t.icon.onRollOver = Delegate.create(t.icon,over);
t.icon.onRollOut = Delegate.create(t.icon,out);
t.icon.onPress = Delegate.create(t.icon,released);
t.onEnterFrame = mover;

}
if(_global.nextReady){_root.menu["menuItem" + _global.num2].bg.tt.onRelease()}
}
}
}
}


function moveTip()
{
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
}



function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = (this._y - perspective) /(centerY+radiusY-perspective);
this._xscale = this._yscale = s*100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
}

this.onMouseMove = function()
{
speed = (this._xmouse-centerX)/7500;
}

init()

_root.createEmptyMovieClip("bg_container", -16000)
bg_container._alpha = 0

var lst = {}
lst.onLoadInit = function(mc){
_root.menu.swapDepths(mc)
_root.bot.swapDepths(mc)
mc._y += 200
tocenter(_root.bg_container)
}

var loader = new MovieClipLoader()
loader.addListener(lst)
loader.loadClip("bg.jpg", _root.bg_container)

function tocenter(target){
var tw6:Tween = new Tween(target,"_x",Strong.easeOut,target._x,Stage.w idth/2-target._width/2,50,false);
var tw7:Tween = new Tween(target,"_y",Strong.easeOut,target._y,Stage.h eight/2-target._height/2,50,false);
if(!_global.executeTocenter){var tw5:Tween = new Tween(target,"_alpha",Strong.easeOut,0,100,40,fals e);}
_global.executeTocenter = true
}

Thank you again for any help!!!

Scott Quillin
ScottQuillin is offline   Reply With Quote
Old 04-14-2007, 07:02 PM   #6
atomic
Banned by AS.org Staff
 
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
Default

You need to add a different url to your XML file, read it and store it as a url variable, and pass it on in your line...

t.icon.onPress = released(url);

And then change your released function...

function released(url){
//Goto Webpage Behavior
getURL(url,"_blank");
//End Behavior
}

Otherwise, each time you call the released function, since the url - http://learntorip.com - is hardcoded, then it always opens that page.
atomic is offline   Reply With Quote
Old 04-14-2007, 08:15 PM   #7
ScottQuillin
Registered User
 
Join Date: Apr 2007
Posts: 7
Default

Hi atomic!

The XML file with the graphics does not contain anything except image and title of graphic.

See Example:

<icons>
<icon image="1.png" tooltip="ScottQuillin.com"/>
<icon image="2.png" tooltip="Contact Me"/>
<icon image="3.png" tooltip="Links"/>
<icon image="4.png" tooltip="Music Room"/>
<icon image="5.png" tooltip="Multimedia Services"/>
<icon image="6.png" tooltip="Audio Production"/>
<icon image="7.png" tooltip="Guitar Instruction"/>
</icons>

There is a file that has a ton of code called texts.html.

Here it is (please note that I typed in my own little comments so I could find which page/section updated when I said specific things.

What a pain!

Here we go.....


&text1=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
||--|)|Lorem ipsum - stop saying that&
&text2=Big roomy paragraph for text 2
||--|)|Sit Dolore - sit boo boo&
&text3=Big room paragraph for text 3...blah you
||--|)|Lorem Ipsum - no thanks&

&con1=New London Square<br>West Warwick, Rhode Island<br>USA&
&con2=Telephone: 401.440.4511<br><a href="mailto:[email protected]"><font color="#77cccc">[email protected]</font></a>&

&awards_text_bottom=<font color="#FFCC33">Text 1</font><br>Paragraph 1, <font color="#FFCC33">Text 2</font> end of sentence.<br><br><font color="#FFCC33"><u>Text 3</u></font><br>Small paragraph 2. <font color="#FFCC33">Text 4</font>, paragraph 3.<br><br><font color="#FFCC33"><u>Text 5</u></font><br>Paragraph 4.
New Paragraph 1, <font color="#FFCC33">new text 1</u></font> end of sentence.<br><br><font color="#FFCC33"><u>new text 2</u></font><br>Paragraph 2. <font color="#FFCC33"><u>text 3</u></font>, paragraph 3.<br><br><font color="#FFCC33">text 4</font><br>paragraph 4, <font color="#FFCC33"><u>text 5</u></font> end of sentence.<br><br><font color="#FFCC33">text 5</font><br>paragraph 5. <font color="#FFCC33"><u>text 6</u></font>, end of sentence.
Last line of text.&

&ABOUTME=ABOUT SCOTT&
&MYWORK=MY BLOG&
&DOWNLOADS=DOWNLOADS&
&FRESHPHOTOS=GUITAR LESSONS&
&CONTACTS=CONTACT ME&
&AWARDS=GEAR&
&DOWNLOADS=LINKS&
&CLIENTS=LEARN TO RIP&
&SITENAME=&

&ww=<a href='http://www.learntorip.com' target="_blank">Click to visit LEARN TO RIP!</a>&
&ll=<b><font color='#9AF028'>Latest</font>$$$$news</b>&
&bb=<b><font color='#9AF028'>Biograhy</font>$$$$</b>&

&pe=<b><font color='#F72B2B'>Photographic</font>$$$$equipment</b>&
&mp=<b><font color='#F72B2B'>My</font>$$$$portfolio</b>&

&lp=<b><font color='#40B1FF'>Online Guitar Instruction</font>$$$$</b>&
&mc=<b><font color='#40B1FF'>WANT GRAPHIC HERE</font>$$$$</b>&
&rl=<b><font color='#40B1FF'>$$$$</b>&

&sa=<b><font color='#FFCC33'>Special</font>$$$$awards</b>&

&td=<b><font color='#FFffff'>Top</font>$$$$downloads</b>&
&od=<b><font color='#FFffff'>Other</font>$$$$downloads</b>&


&clients_last_project=<a href='http://www.learntorip.com' target="_blank">Click to visit LEARN TO RIP!</a>&

&clients_clients=clients sentence 1.<br><br>end of sentence.&

&about_welcome=welcome sentence 1 <font color='#9AF028'><u>text 1</u></font> end o sentence.&

&latest_news=<b>08.09.06</b><br>news sentence 1 <font color='#9AF028'><u>text 1</u></font><br><br><b>09.09.06</b><br>more news text <font color='#9AF028'><u>text 2</u></font> end of sentence.<br><br>&

&ln=NO IDEA WHAT ln is.&

&ln2=NO IDEA WHAT ln2 is.&


&clients_1=<a href='http://www.learntorip.com' target="_blank">Click to visit Learn to Rip!</a>&


&camera=<font color="#888888"><b>Camera: Nikon D200</b></font>&

&rates=Rates, well, you're over rated&

&downloads_1=<a href='http://www.learntorip.com/lesson01'>Video Lesson 1</a>&
&downloads_2=<a href='http://www.learntorip.com/lesson02'>Video Lesson 2</a>&
&downloads_3=<a href='http://www.learntorip.com/lesson03'>Video Lesson 3</a>&
&downloads_4=<a href='http://www.learntorip.com/lesson04'>Video Lesson 4</a>&
&downloads_5=<a href='http://www.learntorip.com/lesson05'>Video Lesson 5</a>&
&downloads_6=<a href='http://www.learntorip.com/lesson06'>Video Lesson 6</a>&


&down_1=<b>Down 1 sentence</b><br>Blah, blah, blah down 1.&
&down_2=<b>Down 2</b><br>Weah, weah, weah, down 2.&
&down_3=<b>Down 1 sentence</b><br>Doo doo doo down 3.&
&down_4=<b>Down 2</b><br>Gonna show up down 4?&

&emailAdr=[email protected]&

================================

I never saw anything like this. This is a big reason why I want to just load a different site in a blank window instead of playing around with this.

I'm not used to see code like this.

I guess I'm over my head.

THANKS FOR THE HELP!!!!!

:-)

:-)

Scott Quillin
ScottQuillin is offline   Reply With Quote
Old 04-15-2007, 11:08 AM   #8
ScottQuillin
Registered User
 
Join Date: Apr 2007
Posts: 7
Default

Any ideas? Anyone?

ScottQuillin is offline   Reply With Quote
Old 04-15-2007, 05:06 PM   #9
atomic
Banned by AS.org Staff
 
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
Default

Think you should re-read my above post...

I'm saying you should add a different url for each item in your xml file... Read it in as you're reading the image and the title graphic for each item, and then change your released script as I stated above...

If you still can't get it working, zip up all your files, and attach the zip to this forum, or post a link to download the package from some web space of your's.
atomic is offline   Reply With Quote
Old 04-15-2007, 08:37 PM   #10
ScottQuillin
Registered User
 
Join Date: Apr 2007
Posts: 7
Default

Quote:
Originally Posted by atomic View Post
Think you should re-read my above post...

I'm saying you should add a different url for each item in your xml file... Read it in as you're reading the image and the title graphic for each item, and then change your released script as I stated above...

If you still can't get it working, zip up all your files, and attach the zip to this forum, or post a link to download the package from some web space of your's.
Hello atomic,

Truthfully, I think I'm in way over my head. I've done a lot of tweaking this template, but the action script has me at a loss. I'm sure you explained it well...but the problem here is between the keyboard and the seat!



I so appreciate you offering to help me. I would have never imagined that someone (that I don't even know) would be willing to take the time to offer help with this. Thank you so very much!

Here is the link:

http://learntorip.org/SCOTTQUILLIN_4-15-07.zip

Thank again my friend!

Scott
ScottQuillin is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
asp page in iframe, link to control swf in main page drliebs ActionScript 2.0 2 12-06-2005 09:11 PM
page flip animation problem akgupta02 ActionScript 2.0 0 11-08-2004 01:12 PM
Path & Page that the swf is located on LeahSmart ActionScript 2.0 7 05-07-2004 02:55 AM
Conitnuous Movement Graphic based on Mouse Position bradleyscott Animation and Effects 1 04-03-2003 12:33 AM
How to create Web site loading different movies to your page? stanlee_max Flashants Support Forum 0 10-18-2002 01:47 AM


All times are GMT. The time now is 05:13 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.