Solved

Flash embed problem when jumping to a frame from Querystring

Posted on 2003-11-28
20
718 Views
Last Modified: 2010-04-03
Dear friends

I hv got stuck in a problem, which somehow i need to solve in a day. I have a asp page which runs a swf file. Now this swf file has to jump into a specific frame depending upon what is in the querystring of the page. It is being called by a number of pages like
file.asp?frame=5 .. and then file has to jump to frame 5. Now even if the swf file is same it is reloading everytime a new frame is called in the querystring.
file.asp?frame=5
file.asp>frame=6
file.asp?frame=7

they are all reloading the same swf again. Also the first time i call the file, it is not jumpin to the right destination frame. after first loadup, if i then refresh the page.. it shows the correct frame.

to see this problem live... pls check here
http://67.128.88.71/adit/sg/clients.asp

click on any logo (only 6 are clickable)..and ideally it shd open the same logo . but the first time it always some frame.. and then when u refresh it shows the correct frame...

pls gimme a solution for this
Thks a lot
zombeen

0
Comment
Question by:zombeen
  • 12
  • 8
20 Comments
 
LVL 2

Author Comment

by:zombeen
ID: 9841550
ALso, on my local server, this 2nd problem of wrong frame showing the first time is not happening. it always show the right frame
0
 
LVL 2

Author Comment

by:zombeen
ID: 9841569
the code i m ucing with my swf file is

<param name="movie" value="clients/casestudies.swf?frame=<%=request.QueryString("frame")%>">
param name="quality" value="high">
<embed src="clients/clients-amd.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="778" height="227"></embed>
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9841728
The first time it's always the same because the flash movie it's not fully loaded yet, and the player cannot redirect it to a frame that is not loaded..
0
 
LVL 2

Author Comment

by:zombeen
ID: 9841808
negatyve, but i hv a preloader before that...
also what can i do to not let this file load into cache again and again.
Right now i can see entries in my cache like
casestudies.swf?frame=4
casestudies.swf?frame=5
and so on

param name="movie" value="clients/casestudies.swf?frame=<%=request.QueryString("frame")%>">
param name="quality" value="high">
<embed src="clients/clients-amd.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="778" height="227"></embed>

0
 
LVL 27

Expert Comment

by:negatyve
ID: 9841920
>negatyve, but i hv a preloader before that...

But the gotoAndStop(frame) [ or gotoAndPlay(frame) ] is after or before the preloder?

>also what can i do to not let this file load into cache again and again.

anything. to view the file, it must be in the browser's cache
0
 
LVL 2

Author Comment

by:zombeen
ID: 9841968
_root.gotoAndPlay(Number(frame));
This is mentioned in the 2nd frame . the loader's in 1st frame

<param name="movie" value="clients/casestudies.swf?frame=<%=request.QueryString("frame")%>">
This line here is making the movie cache again n again. Can anything be done about this...

Thks once again
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9841975
if you mean that you want to update the movie every time, you could do something like:

<param name="movie" value="clients/casestudies.swf?update=ASP_CODE_FOR_RANDOM_NUMBER&frame=<%=request.QueryString("frame")%>">
0
 
LVL 2

Author Comment

by:zombeen
ID: 9842009
no negatyve...
i want that the swf file shd not reload again n again if the frame number is different. even if its the same file, just b'coz it uses diff querystring value, it is loading again n again, cuasing the speed to slow down

Cant we make it load only once in cache
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9842279
Oh, I'm sorry, now I understand. Try it this way:

[...]
      <param name="movie" value="clients/casestudies.swf">
      <param name="FlashVars" value="frame=<%=request.QueryString("frame")%>">
      <param name="quality" value="high">
      <embed
            src="clients/clients-amd.swf"
            FlashVars="frame=<%=request.QueryString("frame")%>"
            quality="high"
            pluginspage="http://www.macromedia.com/go/getflashplayer"
            type="application/x-shockwave-flash"
            width="778" height="227">
      </embed>
</object>
0
 
LVL 2

Author Comment

by:zombeen
ID: 9856219
Thks negatyve for such help. i m trying this now , and will get back soon
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 2

Author Comment

by:zombeen
ID: 9856267
negatyve, it works beautifully. Thks a ton.. one of the 2 problems still remain though. for some reason, it still loads a particular frame only (irrespective of Querystring value), and once the swf file is loaded once after that the correct frame is loaded always. on this u had remarked, that b'coz the frame might not be loaded at that time it is showing the first frame or so...but i have already put a preloader on the first frame..what can be the problem here?

You have done me a gr8 favour by answering the Ques. Pls see if u can help me on this, otherwise in any case i will award u the points after ur next post

Zombeen
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9857022
Could you write here your preloader code?
0
 
LVL 2

Author Comment

by:zombeen
ID: 9857084
my fla file is loaded here www.betashoes.co.uk/casestudies.zip
Pls see where i m going wrong
0
 
LVL 2

Author Comment

by:zombeen
ID: 9864796
negatyve cud you find any prob in the file?
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9865570
Maybe the problem is in that

if (bytesLoaded == bytesTotal) {
      _root.gotoAndPlay (3);
}

in the preloader code, where the gotoAndPlay(Number(frame)) is on frame 2 of the main timeline

That's exactly what I would do:

• open the fla
• edit the preloader clip
• delete frame 2 of the preloader
• delete the script from frame 1
• go back to the main timeline
• delete frame 2
• drop this code on frame 1

this.stop();
this.onEnterFrame = function()
{
      // this will get the total bytes loaded up to now
      var bytesLoaded = this.getBytesLoaded();
      // this will get the total Kilobytes loaded up to now
      var KbytesLoaded = Math.round(bytesLoaded / 1024) + " KB";
      // this will get the total bytes of the movie
      var bytesTotal = this.getBytesTotal();
      // this will get the total Kilobytes of the movie
      var KbytesTotal = Math.round(bytesTotal / 1024) + " KB";
      // this will set up the percentage of the movie loaded
      var percentSetup = ((bytesLoaded / bytesTotal) * 100);
      // this will put the percentage result in the text box
      percentage = Math.round(percentSetup) + "%";
      // this will set the loader bars scale property to 0 in the
      // beginning but it will expand as the percent level goes up.
      this.DropIn.LoaderBar._xscale = percentSetup;
      // this will check to see if the movie is loaded yet. If not
      // it will go to frame 2 and basically start over at frame
      // 1. In other words it will go back to the beginning of
      // the script above.
      if (bytesLoaded >= bytesTotal) {
            this.onEnterFrame = undefined
            this.gotoAndPlay(frame ? Number(frame) : 2);
      }
};

• open the library
• go to "Flash UI Components" folder
• do this thing for both "ScrollBar" and "ScrollPane" component
                    • click with the mouse right button on the component
                    • choose linkage from the context menu
                    • deselect the "Export in first frame" checkbox

• if you do everything, you should rememeber that now you should send to frame 2 instead of frame 3, frame 4 instead of frame 5 and so on
0
 
LVL 2

Author Comment

by:zombeen
ID: 9873952
thnx negatyve...

the problem is solved in terms of jumpting to the right frame... but now the text is not coming in the scroll panes. They are empty....!!!!....
I m sorry ot bother u again n again... but what can eb the problem now?

here's to see what is the problem (click on a logo)
http://67.128.88.71/adit/sg/clients.asp
0
 
LVL 27

Accepted Solution

by:
negatyve earned 100 total points
ID: 9874074
Have you made other changes?

(look here, frame=6)

http://www.negatyve.com/test/casestudies.html
0
 
LVL 2

Author Comment

by:zombeen
ID: 9880344
ya! i dont know what i hv missed.
negatyve, can u post the fla file on the server or email me at akohli.cdg@spectranet.com
That'll be gr8

Thks
zombeen
0
 
LVL 2

Author Comment

by:zombeen
ID: 9880525
this is marvellous negatyve... Thks a ton...
btw i was missing the linkage part for scroll components
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9881016
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now